Re: dub should be more command-line oriented

2018-01-10 Thread Computermatronic via Digitalmars-d

On Wednesday, 10 January 2018 at 15:07:40 UTC, Luís Marques wrote:
I often feel that dub relies too much on dub.[json|sdl] and too 
little on command-line switches. Here's the latest example:


[...]


You could just make a refactoring configuration and use the 
--config flag to specify it when necessary. (see: 
https://code.dlang.org/package-format?lang=json#configurations)


Re: Dll support: testers needed

2018-01-10 Thread Domain via Digitalmars-d
On Wednesday, 10 January 2018 at 13:14:10 UTC, Benjamin Thaut 
wrote:

Am 10.01.2018 um 13:39 schrieb Domain:


Sorry, my mistake. But I cannot use your binary:

D:\>dmd -m64 -shared dll.d -ofdll.dll
Error: unrecognized file extension dll




This works just fine for me. What is the output when you 
execute "dmd --version"?


D:\git\testdll\source>dmd --version
DMD64 D Compiler v2.078.0

Copyright (C) 1999-2018 by The D Language Foundation, All Rights 
Reserved written by Walter Bright


Re: Dll support: testers needed

2018-01-10 Thread Domain via Digitalmars-d
On Wednesday, 10 January 2018 at 13:14:10 UTC, Benjamin Thaut 
wrote:

Am 10.01.2018 um 13:39 schrieb Domain:


Sorry, my mistake. But I cannot use your binary:

D:\>dmd -m64 -shared dll.d -ofdll.dll
Error: unrecognized file extension dll




This works just fine for me. What is the output when you 
execute "dmd --version"?


I restart my computer, and it can produce dll now. But when I 
compile exe:

dmd -m64 -useshared app.d -ofapp.exe

app.obj : error LNK2019: 无法解析的外部符号 
_D3std12experimental6logger4core17stdThreadLocalLogFNdNfZCQCeQCdQBsQBo6Logger,该符号在函数 _D3std12experimental6logger4core__T18defaultLogFunctionVEQCdQCcQBrQBn8LogLeveli64Z__TQByVii9VAyaa5_6170702e64VQra8_6170702e6d61696eVQBna15_766f6964206170702e6d61696e2829VQCza3_617070TQDmZQFwFNfLQDxZv 中被引用
app.obj : error LNK2019: 无法解析的外部符号 
_D6object__T8__equalsTxaTxaZQqFNaNbNiNfAxaQdZb,该符号在函数 
_D3std5array__T8AppenderTAyaZQo4Data11__xopEqualsFKxSQBzQBy__TQBvTQBpZQCdQBqKxQBaZb 中被引用
app.obj : error LNK2019: 无法解析的外部符号 
_D3std12experimental6logger4core14globalLogLevelFNdNiNfZEQCdQCcQBrQBn8LogLevel,该符号在函数 _D3std12experimental6logger4core6Logger__T15memLogFunctionsVEQChQCgQBvQBr8LogLeveli64Z__T7logImplVii9VAyaa5_6170702e64VQra8_6170702e6d61696eVQBna15_766f6964206170702e6d61696e2829VQCza3_617070TQDmZQEdMFNfLQDyZv 中被引用
app.obj : error LNK2019: 无法解析的外部符号 
_D3std11concurrency7thisTidFNdNfZSQBgQBf3Tid,该符号在函数 
_D3std12experimental6logger4core6Logger__T15memLogFunctionsVEQChQCgQBvQBr8LogLeveli64Z__T7logImplVii9VAyaa5_6170702e64VQra8_6170702e6d61696eVQBna15_766f6964206170702e6d61696e2829VQCza3_617070TQDmZQEdMFNfLQDyZv 中被引用
app.obj : error LNK2019: 无法解析的外部符号 
_D3std8datetime8timezone9LocalTime6opCallFNaNbNeZyCQBxQBwQBqQBk,该符号在函 数 _D3std12experimental6logger4core6Logger__T15memLogFunctionsVEQChQCgQBvQBr8LogLeveli64Z__T7logImplVii9VAyaa5_6170702e64VQra8_6170702e6d61696eVQBna15_766f6964206170702e6d61696e2829VQCza3_617070TQDmZQEdMFNfLQDyZv 中被引用
app.obj : error LNK2019: 无法解析的外部符号 
_D3std12experimental6logger4core8MsgRange6__ctorMFNcNfCQCbQCaQBpQBl6LoggerZSQCwQCvQCkQCgQCe,该符号在函数 _D3std12experimental6logger4core6Logger__T15memLogFunctionsVEQChQCgQBvQBr8LogLeveli64Z__T7logImplVii9VAyaa5_6170702e64VQra8_6170702e6d61696eVQBna15_766f6964206170702e6d61696e2829VQCza3_617070TQDmZQEdMFNfLQDyZv 中被引用
app.obj : error LNK2019: 无法解析的外部符号 
_D3std8datetime7systime7SysTime6__ctorMFNaNbNcNflyCQBxQBw8timezone8TimeZoneZSQCxQCwQCqQCl,该符号在函数 _D3std8datetime7systime5Clock__T8currTimeVE4core4time9ClockTypei0ZQBiFNfyCQCuQCt8timezone8TimeZoneZSQDuQDtQDn7SysTime 中被引用
app.obj : error LNK2019: 无法解析的外部符号 
_D3std8datetime7systime17FILETIMEToStdTimeFNfMxPS4core3sys7windows7winbase8FILETIMEZl,该符号在函数 _D3std8datetime7systime5Clock__T11currStdTimeVE4core4time9ClockTypei0ZQBmFNdNeZl 中被引用
app.obj : error LNK2019: 无法解析的外部符号 
_D3std12experimental6logger4core8MsgRange3putMFNfwZv,该符号在函数 
_D3std5range10primitives__T5doPutTSQBh12experimental6logger4core8MsgRangeTaZQBxFNfKQBxKaZv 中被引用
app.obj : error LNK2001: 无法解析的外部符号 
_D3std8datetime7systime7SysTime6toHashMxFNaNbNiNfZm
app.obj : error LNK2001: 无法解析的外部符号 
_D3std8datetime7systime7SysTime8opEqualsMxFNaNbNfKxSQByQBxQBrQBmZb
app.obj : error LNK2001: 无法解析的外部符号 
_D3std8datetime7systime7SysTime8__xopCmpFKxSQBqQBpQBjQBeKxQpZi
app.obj : error LNK2001: 无法解析的外部符号 
_D3std8datetime7systime7SysTime8toStringMxFNbNfZAya

app.exe : fatal error LNK1120: 13 个无法解析的外部命令
Error: linker exited with status 1120


Sources:

///app.d:

import std.experimental.logger;
import core.sys.windows.windows;
import core.runtime;
extern(C) alias void function() startFn;
void main()
{
info("Loading dll1.dll");
auto handle1 = cast(HMODULE)Runtime.loadLibrary("dll1.dll");
auto fp1 = GetProcAddress(handle1, "start");
(cast(startFn)fp1)();

info("Loading dll2.dll");
auto handle2 = cast(HMODULE)Runtime.loadLibrary("dll2.dll");
auto fp2 = GetProcAddress(handle2, "start");
(cast(startFn)fp2)();
}

///dll1.d

import std.stdio;
import std.experimental.logger;
import core.sys.windows.dll;
mixin SimpleDllMain!(DllIsUsedFromC.no);
class MyLogger : Logger
{
this(LogLevel lv) @safe
{
super(lv);
}
override protected void writeLogMsg(ref LogEntry entry) 
@trusted

{
writefln("MyLogger: %s", entry.msg);
}
}
export extern(C) void start()
{
info("dll1 starting");
sharedLog = new MyLogger(LogLevel.info);
info("dll1 started");
}

///dll2.d

import std.stdio;
import std.experimental.logger;
import core.sys.windows.dll;
mixin SimpleDllMain!(DllIsUsedFromC.no);
export extern(C) void start()
{
info("dll2 started");
}

dmd -m64 app.d -ofapp.exe
dmd -m64 -shared dll1.d -ofdll1.dll
dmd -m64 -shared dll2.d -ofdll2.dll

output:

2018-01-11T12:04:51.635:app.d:main:9 Loading dll1.dll
2018-01-11T12:04:51.894:dll1.d:start:22 dll1 starting
MyLogger: dll1 started
2018-01-11T12:04:51.897:app.d:main:14 Loading dll2.dll
2018-01-11T12:04:52.164:dll2.d:start:9 dll2 started

I expected:
2018-01-11T12:04:51.635:app.d:main:9 Loading dll1.dll
20

Re: !Alert! code.dlang.org down

2018-01-10 Thread Guillaume Piolat via Digitalmars-d
On Wednesday, 10 January 2018 at 10:10:22 UTC, Martin 
Tschierschke wrote:
In the moment I don't have access, hopefully this is only 
temporal problem and the rescue team for fixing is already on 
the way...


Tips from the folks on Discord, for DUB outages:

1. If you have all required dependencies in your cache, and just 
want to avoid the network:


dub --skip-registry=all

Very useful on slow networks. However this won't help if you 
don't have the libraries in your cache.



2. If you wish to use a mirror

dub --skip-registry=standard -v 
--registry=http://code-mirror.dlang.io



3. If you need to fetch packages and mirror are down too

- git clone every repositery you need from GitHub
- $ dub add-local in every of these repositery
You might want to checkout older tags if you are not using 
the latest version of these repositeries.





Re: Unable to run D program on mac system when using dependency.

2018-01-10 Thread Simen Kjærås via Digitalmars-d
On Wednesday, 10 January 2018 at 12:44:01 UTC, Harbeer Kadian 
wrote:
I am pretty new to D language. I am working on existing code 
developed by others. Previous developers were using linux 
environment to build and run the D Application.

I am trying to do the same in MAC as it is my local environment.

Here is how my jub.json file looks like
{
"name" : "dsmasher",
"description" : "Hello World - A minimal DUB bundle.",
"dependencies" : {
"d2sqlite3": "~>0.9.7",
"botan": "~>1.12.9"
}
}


This seems to be a bug in Botan - the GitHub page lists the build 
as failing, and a look[1] at the build shows the exact same error 
messages.


--
  Simen

[0]: https://github.com/etcimon/botan
[1]: https://travis-ci.org/etcimon/botan/jobs/308953168


Re: Submit D Machine Learning libraries

2018-01-10 Thread aberba via Digitalmars-d

On Wednesday, 10 January 2018 at 12:41:09 UTC, angel wrote:

It is funny, there is 'DLib' under C++.

On Tuesday, 9 January 2018 at 20:39:25 UTC, aberba wrote:

On Tuesday, 9 January 2018 at 19:46:00 UTC, aberba wrote:

[...]


Also http://code.dlang.org/packages/dopt (A numerical 
optimisation and deep learning framework)


Yeah. I noticed.


Re: Unable to run D program on mac system when using dependency.

2018-01-10 Thread Colin via Digitalmars-d
On Wednesday, 10 January 2018 at 12:44:01 UTC, Harbeer Kadian 
wrote:
I am pretty new to D language. I am working on existing code 
developed by others. Previous developers were using linux 
environment to build and run the D Application.

I am trying to do the same in MAC as it is my local environment.

[...]


What version of DMD are you using?


Re: dub should be more command-line oriented

2018-01-10 Thread Joakim via Digitalmars-d

On Wednesday, 10 January 2018 at 15:07:40 UTC, Luís Marques wrote:
I often feel that dub relies too much on dub.[json|sdl] and too 
little on command-line switches. Here's the latest example:


[...]


You're welcome to submit a pull for a command-line flag or a new 
build mode or however you best envision this fixed:


https://github.com/dlang/dub/pulls


dub should be more command-line oriented

2018-01-10 Thread Luís Marques via Digitalmars-d
I often feel that dub relies too much on dub.[json|sdl] and too 
little on command-line switches. Here's the latest example:


1) Write code
2) Start refactoring code
3) Compile and run to check the partially implemented change
4) dub gives a warning; the warning is expected due to the 
incomplete change; I don't care about it right now, I just want 
to check that something related to that change works
5) Because of the warning, dub doesn't even finish building the 
project

6) I want to force dub to build it, but there's no switch for that
7) I have to go check the docs for what is the dub.json setting 
that allows warnings (it's "buildRequirements": ["allowWarnings"])

8) I change dub.json
9) I compile it again

universe 1:
10) I finish the refactoring
11) I forget to remove the new setting

universe 2:
10) I remove "allowWarnings" immediately
11) while trying to do another intermediate testing step, I get 
another warning

12) goto 7 or 8


Re: Dll support: testers needed

2018-01-10 Thread Benjamin Thaut via Digitalmars-d

Am 10.01.2018 um 13:39 schrieb Domain:


Sorry, my mistake. But I cannot use your binary:

D:\>dmd -m64 -shared dll.d -ofdll.dll
Error: unrecognized file extension dll




This works just fine for me. What is the output when you execute "dmd 
--version"?


--
Kind Regards
Benjamin Thaut


Unable to run D program on mac system when using dependency.

2018-01-10 Thread Harbeer Kadian via Digitalmars-d
I am pretty new to D language. I am working on existing code 
developed by others. Previous developers were using linux 
environment to build and run the D Application.

I am trying to do the same in MAC as it is my local environment.

Here is how my jub.json file looks like
{
"name" : "dsmasher",
"description" : "Hello World - A minimal DUB bundle.",
"dependencies" : {
"d2sqlite3": "~>0.9.7",
"botan": "~>1.12.9"
}
}

The program is very simple
import std.stdio;

int main () {
   return 0;
}

But when I build it throws following errors.

/Library/D/dmd/src/druntime/import/object.d(3440,23): Error: 
template memutils.refcounted.RefCounted!(X509CertificateImpl, 
ThreadMem).RefCounted.opCast does not match any template 
declaration
/Library/D/dmd/src/druntime/import/object.d(3440,49): Error: 
template memutils.refcounted.RefCounted!(X509CertificateImpl, 
ThreadMem).RefCounted.opCast does not match any template 
declaration
/Library/D/dmd/src/druntime/import/object.d(3441,39): Error: 
template memutils.refcounted.RefCounted!(X509CertificateImpl, 
ThreadMem).RefCounted.opCast does not match any template 
declaration

../../../.dub/packages/memutils-0.4.9/memutils/source/memutils/vector.d(790,10):
 Error: template instance 
object.__equals!(const(RefCounted!(X509CertificateImpl, ThreadMem)), 
const(RefCounted!(X509CertificateImpl, ThreadMem))) error instantiating
../../../.dub/packages/memutils-0.4.9/memutils/source/memutils/helpers.d(71,27):
instantiated from here: opEquals!()
../../../.dub/packages/botan-1.12.9/botan/source/botan/tls/server.d(689,38):
instantiated from here: 
opEquals!(RefCounted!(Vector!(RefCounted!(X509CertificateImpl, ThreadMem), 
ThreadMem), ThreadMem))
/Library/D/dmd/bin/dmd failed with exit code 1.
  ^^^ Terminated, exit code: 2 ^^^
  Build terminated.  

I am using dmd compiler for this.
Please help if you have any idea.



Re: Submit D Machine Learning libraries

2018-01-10 Thread angel via Digitalmars-d

It is funny, there is 'DLib' under C++.

On Tuesday, 9 January 2018 at 20:39:25 UTC, aberba wrote:

On Tuesday, 9 January 2018 at 19:46:00 UTC, aberba wrote:
[1] is a curated list of machine learning libraries for 
several programming languages (no D library in list). I don't 
know much about ML that much to suggest any of those in the 
Dub registry. I know we have Vectorflow from Netflix 
(http://code.dlang.org/packages/vectorflow), D computer Vision 
(https://code.dlang.org/packages/dcv), and all these MIR 
related libs (http://code.dlang.org/search?q=mir)


Please make pull request for D at 
https://github.com/josephmisiti/awesome-machine-learning


[1] https://github.com/josephmisiti/awesome-machine-learning


Might win some people over.


Also http://code.dlang.org/packages/dopt (A numerical 
optimisation and deep learning framework)




Re: Dll support: testers needed

2018-01-10 Thread Domain via Digitalmars-d
On Wednesday, 10 January 2018 at 11:30:47 UTC, Benjamin Thaut 
wrote:

Am 10.01.2018 um 05:18 schrieb Domain:
On Saturday, 6 January 2018 at 19:32:51 UTC, Benjamin Thaut 
wrote:
I'm currently back on dll support and I'm applying finishing 
touches to my dll support PR. Now I want to know if I missed 
any corner cases and it would be great if a few more people 
gave the dll support a try.


[...]


I am glad to see this happen. But my use case is not working:
http://forum.dlang.org/post/giywzmvfeuddvmvkr...@forum.dlang.org


Hi Domain,

what your describing is a very simple use case and should 
definitly work. Did you try it using my binary distribution? 
Please post a repro-case. I don't have the time to rebuild 
everyones use case and saying "My use case is not working" does 
not help at all.


Sorry, my mistake. But I cannot use your binary:

D:\>dmd -m64 -shared dll.d -ofdll.dll
Error: unrecognized file extension dll




Re: !Alert! code.dlang.org down

2018-01-10 Thread Daniel Kozak via Digitalmars-d
OK, I am unable to compile dub-registry :D, I have only 4GB free RAM and it
seems it is not enought LOL

On Wed, Jan 10, 2018 at 12:03 PM, Daniel Kozak  wrote:

> Thank you :)
>
> On Wed, Jan 10, 2018 at 11:53 AM, Seb via Digitalmars-d <
> digitalmars-d@puremagic.com> wrote:
>
>> On Wednesday, 10 January 2018 at 10:36:57 UTC, Daniel Kozak wrote:
>>
>>> I am able to provide my VPS for mirroring too. Is there a tutorial how
>>> to do it?
>>>
>>
>> The dub-registry binary can be started with `--mirror=
>> https://code.dlang.org`
>> Martin even an Ansible script for dub-mirror.dlang.io:
>>
>> https://github.com/dlang/ci/blob/master/ansible/roles/dub_re
>> gistry_mirror/tasks/main.yml
>>
>> It boils down to these tasks:
>>
>> 1) git clone https://github.com/dlang/dub-registry
>> 2) dub #  <- maybe -b release
>> 3) Install mongo and start
>>
>> sudo apt-get install mongodb && sudo systemctl enable mongodb && sudo
>> systemctl start mongodb
>>
>> 4) Configure a systemd service
>>
>> Here's my systemd service:
>>
>> /etc/systemd/system/dub-registry.service
>>>
>>
>> -
>> [Unit]
>> Description=DUB registry
>> OnFailure=unit-status-mail@%n.service
>>
>> [Service]
>> Environment="PORT=9001"
>> ExecStart=/opt/projects/dub-registry/dub-registry --port 8005 --mirror=
>> https://code.dlang.org --hostname=code-mirror2.dlang.org --vv
>> WorkingDirectory=/opt/projects/dub-registry
>> Restart=always
>> RestartSec=30
>> User=dub-registry
>>
>> [Install]
>> WantedBy=multi-user.target
>> --
>>
>>
>> [Unit]
>>>
>> Description=Unit Status Mailer Service
>> After=network.target
>>
>> [Service]
>> Type=simple
>> ExecStart=/opt/bin/unit-status-mail.sh "%I" "Hostname: %H" "Machine ID:
>> %m" "Boot ID: %b"
>> 
>>
>>
>> /opt/bin/unit-status-mail.sh
>>>
>>
>> 
>> #!/bin/bash
>> MAILTO="root"
>> MAILFROM="unit-status-mailer"
>> UNIT=$1
>>
>> EXTRA=""
>> for e in "${@:2}"; do
>>   EXTRA+="$e"$'\n'
>> done
>>
>> UNITSTATUS=$(systemctl status $UNIT)
>> UNITLOG=$(journalctl -u $UNIT -r | head -n 100)
>>
>> sendmail $MAILTO <> From:$MAILFROM
>> To:$MAILTO
>> Subject:Status of: $UNIT
>>
>> Status report for unit: $UNIT
>> $EXTRA
>>
>> $UNITSTATUS
>>
>> $UNITLOG
>> EOF
>>
>> echo -e "Status mail sent to: $MAILTO for unit: $UNIT"
>> ---
>>
>> 5) Configure Nginx
>>
>> /etc/nginx/sites-available/dub-mirror
>>>
>> ---
>>
>> server {
>> listen 80;
>> listen [::]:80;
>> server_name code-mirror2.dlang.io;
>>
>> location / {
>> proxy_pass http://localhost:8005;
>> }
>> }
>> ---
>>
>> 6) Configure Letsencrypt for SSL (optional)
>> 7) Add yourself to this list:
>>
>> https://github.com/dlang/dub/blob/master/source/dub/dub.d#L64
>>
>> Note that with a few tweaks it's possible to run the dub-registry on
>> Heroku:
>>
>> https://github.com/dlang/dub-registry/pull/231
>>
>
>


Re: Dll support: testers needed

2018-01-10 Thread Benjamin Thaut via Digitalmars-d

Am 10.01.2018 um 05:18 schrieb Domain:

On Saturday, 6 January 2018 at 19:32:51 UTC, Benjamin Thaut wrote:
I'm currently back on dll support and I'm applying finishing touches 
to my dll support PR. Now I want to know if I missed any corner cases 
and it would be great if a few more people gave the dll support a try.


[...]


I am glad to see this happen. But my use case is not working:
http://forum.dlang.org/post/giywzmvfeuddvmvkr...@forum.dlang.org


Hi Domain,

what your describing is a very simple use case and should definitly 
work. Did you try it using my binary distribution? Please post a 
repro-case. I don't have the time to rebuild everyones use case and 
saying "My use case is not working" does not help at all.


--
Kind Regards
Benjamin Thaut


Re: !Alert! code.dlang.org down

2018-01-10 Thread Daniel Kozak via Digitalmars-d
Thank you :)

On Wed, Jan 10, 2018 at 11:53 AM, Seb via Digitalmars-d <
digitalmars-d@puremagic.com> wrote:

> On Wednesday, 10 January 2018 at 10:36:57 UTC, Daniel Kozak wrote:
>
>> I am able to provide my VPS for mirroring too. Is there a tutorial how to
>> do it?
>>
>
> The dub-registry binary can be started with `--mirror=https://code.dlang.o
> rg`
> Martin even an Ansible script for dub-mirror.dlang.io:
>
> https://github.com/dlang/ci/blob/master/ansible/roles/dub_re
> gistry_mirror/tasks/main.yml
>
> It boils down to these tasks:
>
> 1) git clone https://github.com/dlang/dub-registry
> 2) dub #  <- maybe -b release
> 3) Install mongo and start
>
> sudo apt-get install mongodb && sudo systemctl enable mongodb && sudo
> systemctl start mongodb
>
> 4) Configure a systemd service
>
> Here's my systemd service:
>
> /etc/systemd/system/dub-registry.service
>>
>
> -
> [Unit]
> Description=DUB registry
> OnFailure=unit-status-mail@%n.service
>
> [Service]
> Environment="PORT=9001"
> ExecStart=/opt/projects/dub-registry/dub-registry --port 8005 --mirror=
> https://code.dlang.org --hostname=code-mirror2.dlang.org --vv
> WorkingDirectory=/opt/projects/dub-registry
> Restart=always
> RestartSec=30
> User=dub-registry
>
> [Install]
> WantedBy=multi-user.target
> --
>
>
> [Unit]
>>
> Description=Unit Status Mailer Service
> After=network.target
>
> [Service]
> Type=simple
> ExecStart=/opt/bin/unit-status-mail.sh "%I" "Hostname: %H" "Machine ID:
> %m" "Boot ID: %b"
> 
>
>
> /opt/bin/unit-status-mail.sh
>>
>
> 
> #!/bin/bash
> MAILTO="root"
> MAILFROM="unit-status-mailer"
> UNIT=$1
>
> EXTRA=""
> for e in "${@:2}"; do
>   EXTRA+="$e"$'\n'
> done
>
> UNITSTATUS=$(systemctl status $UNIT)
> UNITLOG=$(journalctl -u $UNIT -r | head -n 100)
>
> sendmail $MAILTO < From:$MAILFROM
> To:$MAILTO
> Subject:Status of: $UNIT
>
> Status report for unit: $UNIT
> $EXTRA
>
> $UNITSTATUS
>
> $UNITLOG
> EOF
>
> echo -e "Status mail sent to: $MAILTO for unit: $UNIT"
> ---
>
> 5) Configure Nginx
>
> /etc/nginx/sites-available/dub-mirror
>>
> ---
>
> server {
> listen 80;
> listen [::]:80;
> server_name code-mirror2.dlang.io;
>
> location / {
> proxy_pass http://localhost:8005;
> }
> }
> ---
>
> 6) Configure Letsencrypt for SSL (optional)
> 7) Add yourself to this list:
>
> https://github.com/dlang/dub/blob/master/source/dub/dub.d#L64
>
> Note that with a few tweaks it's possible to run the dub-registry on
> Heroku:
>
> https://github.com/dlang/dub-registry/pull/231
>


Re: !Alert! code.dlang.org down

2018-01-10 Thread Seb via Digitalmars-d

On Wednesday, 10 January 2018 at 10:36:57 UTC, Daniel Kozak wrote:
I am able to provide my VPS for mirroring too. Is there a 
tutorial how to do it?


The dub-registry binary can be started with 
`--mirror=https://code.dlang.org`

Martin even an Ansible script for dub-mirror.dlang.io:

https://github.com/dlang/ci/blob/master/ansible/roles/dub_registry_mirror/tasks/main.yml

It boils down to these tasks:

1) git clone https://github.com/dlang/dub-registry
2) dub #  <- maybe -b release
3) Install mongo and start

sudo apt-get install mongodb && sudo systemctl enable mongodb && 
sudo systemctl start mongodb


4) Configure a systemd service

Here's my systemd service:


/etc/systemd/system/dub-registry.service


-
[Unit]
Description=DUB registry
OnFailure=unit-status-mail@%n.service

[Service]
Environment="PORT=9001"
ExecStart=/opt/projects/dub-registry/dub-registry --port 8005 
--mirror=https://code.dlang.org --hostname=code-mirror2.dlang.org 
--vv

WorkingDirectory=/opt/projects/dub-registry
Restart=always
RestartSec=30
User=dub-registry

[Install]
WantedBy=multi-user.target
--



[Unit]

Description=Unit Status Mailer Service
After=network.target

[Service]
Type=simple
ExecStart=/opt/bin/unit-status-mail.sh "%I" "Hostname: %H" 
"Machine ID: %m" "Boot ID: %b"





/opt/bin/unit-status-mail.sh



#!/bin/bash
MAILTO="root"
MAILFROM="unit-status-mailer"
UNIT=$1

EXTRA=""
for e in "${@:2}"; do
  EXTRA+="$e"$'\n'
done

UNITSTATUS=$(systemctl status $UNIT)
UNITLOG=$(journalctl -u $UNIT -r | head -n 100)

sendmail $MAILTO <
/etc/nginx/sites-available/dub-mirror

---

server {
listen 80;
listen [::]:80;
server_name code-mirror2.dlang.io;

location / {
proxy_pass http://localhost:8005;
}
}
---

6) Configure Letsencrypt for SSL (optional)
7) Add yourself to this list:

https://github.com/dlang/dub/blob/master/source/dub/dub.d#L64

Note that with a few tweaks it's possible to run the dub-registry 
on Heroku:


https://github.com/dlang/dub-registry/pull/231


Re: !Alert! code.dlang.org down

2018-01-10 Thread Daniel Kozak via Digitalmars-d
I am able to provide my VPS for mirroring too. Is there a tutorial how to
do it?

On Wed, Jan 10, 2018 at 11:27 AM, Seb via Digitalmars-d <
digitalmars-d@puremagic.com> wrote:

> On Wednesday, 10 January 2018 at 10:10:22 UTC, Martin Tschierschke wrote:
>
>> In the moment I don't have access, hopefully this is only temporal
>> problem and the rescue team for fixing is already on the way...
>>
>
> Hehe, I'm working on adding more stability to our CI infrastructure, e.g.
>
> https://github.com/travis-ci/travis-build/pull/1282
> https://github.com/dlang/installer/pull/214
> https://github.com/dlang/installer/pull/291
>
> DUB >= 1.6.0 comes with a couple of mirrors and should softly fallback to
> them:
>
> https://code-mirror.dlang.io
> http://code-mirror3.dlang.io
>
> code-mirror2 seems to be down too. I will have a look into that.
>


Re: !Alert! code.dlang.org down

2018-01-10 Thread Seb via Digitalmars-d
On Wednesday, 10 January 2018 at 10:10:22 UTC, Martin 
Tschierschke wrote:
In the moment I don't have access, hopefully this is only 
temporal problem and the rescue team for fixing is already on 
the way...


Hehe, I'm working on adding more stability to our CI 
infrastructure, e.g.


https://github.com/travis-ci/travis-build/pull/1282
https://github.com/dlang/installer/pull/214
https://github.com/dlang/installer/pull/291

DUB >= 1.6.0 comes with a couple of mirrors and should softly 
fallback to them:


https://code-mirror.dlang.io
http://code-mirror3.dlang.io

code-mirror2 seems to be down too. I will have a look into that.


!Alert! code.dlang.org down

2018-01-10 Thread Martin Tschierschke via Digitalmars-d
In the moment I don't have access, hopefully this is only 
temporal problem and the rescue team for fixing is already on the 
way...