www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - dip1000 issue

reply Orfeo <orfeo.davia gmail.com> writes:
I wanted to highlight a problem that drove me crazy.

I've a project that link FuzzyCopy [1], that was compiled without 
problems.
So I add FuzzyCopy library [1], I update dmd, then:

```
$ dmd --version
DMD64 D Compiler v2.082.0
Copyright (C) 1999-2018 by The D Language Foundation, All Rights 
Reserved written by Walter Bright

$ dub build --verbose
....
/usr/bin/dmd -dip1000 -dip25 -c 
-of.dub/build/application-debug-linux.posix-x86_64-dmd_2082-C9F52D2A0CA0970ECB
5169BD9B6C34D/jan.o -debug -g -w -version=VibeDefaultMain
-version=VibeUseOpenSSL11 ..... -vcolumns
FAIL 
.dub/build/application-debug-linux.posix-x86_64-dmd_2082-C9F52D2A0CA09
0ECB75169BD9B6C34D/ jan executable

/usr/bin/dmd failed with exit code -11.
```

after losing a lot of time, I realized that the problem was 
`-dip1000`: in FuzzyCopy dub is written:
```json
"dflags": ["-dip1000", "-dip25"],
```
If I remove it all works like a charm.

So, is it  correct that my project inherits settings of another 
library?
And why (maybe a silly question) `-dip1000`dip1000  my project so 
badly without warning..

Thank you


- [1] https://github.com/burner/FuzzyCopy
- [2] https://github.com/burner/FuzzyCopy/blob/master/dub.json
Sep 07 2018
parent reply Orfeo <orfeo.davia gmail.com> writes:
Sorry, I pressed send too quickly
On Friday, 7 September 2018 at 14:04:47 UTC, Orfeo wrote:

 I've a project that link FuzzyCopy [1], that was compiled 
 without problems.
 So I add FuzzyCopy library [1], I update dmd, then:
==> I've a project that was compiled without problems. So I add FuzzyCopy library [1], I update dmd, then:
 And why (maybe a silly question) `-dip1000`dip1000  my project 
 so badly without warning..
==> And why (maybe a silly question) `-dip1000` breaks my project so badly without warning..
Sep 07 2018
parent reply rikki cattermole <rikki cattermole.co.nz> writes:
On 08/09/2018 2:29 AM, Orfeo wrote:
 ==> And why (maybe a silly question) `-dip1000` breaks  my project so 
 badly without warning..
DIP 1000 is an experimental addition to D, that is yet to be complete. It is a compiler switch for a reason, it isn't ready for usage, only some experimentation.
Sep 07 2018
parent reply Orfeo <orfeo.davia gmail.com> writes:
On Friday, 7 September 2018 at 14:36:18 UTC, rikki cattermole 
wrote:
 On 08/09/2018 2:29 AM, Orfeo wrote:
 ==> And why (maybe a silly question) `-dip1000` breaks  my 
 project so badly without warning..
DIP 1000 is an experimental addition to D, that is yet to be complete. It is a compiler switch for a reason, it isn't ready for usage, only some experimentation.
Thank you very much... I agree with you, but if someone adds `dip1000` in a library and I link it, my project inherits this setting. What do you think? is it correct? Some suggestions to avoid it?
Sep 07 2018
parent Steven Schveighoffer <schveiguy gmail.com> writes:
On 9/7/18 7:59 AM, Orfeo wrote:
 On Friday, 7 September 2018 at 14:36:18 UTC, rikki cattermole wrote:
 On 08/09/2018 2:29 AM, Orfeo wrote:
 ==> And why (maybe a silly question) `-dip1000` breaks  my project so 
 badly without warning..
DIP 1000 is an experimental addition to D, that is yet to be complete. It is a compiler switch for a reason, it isn't ready for usage, only some experimentation.
Thank you very much... I agree with you, but if someone adds `dip1000` in a library and I link it,  my project inherits this setting. What do you think? is it correct? Some suggestions to avoid it?
The sub-project is being compiled with dip1000. I don't know what the rules are for dip1000 and dub, but it's likely the flags are propagated. One of the main drawbacks of dip1000 is that if you don't have it enabled on ALL projects, you will likely run into linker errors. It's like compiling 2 libraries with different versions and expecting them to link. It's probably the reason dub forwards the switches. Separately, if dmd is failing with signal 11 (SEGFAULT), this is a compiler bug. The compiler should never segfault. At this point, it's hard to tell from what you have given what may cause the error. But maybe if your project is open source, you can file a bug with the link to the project? Or if you can narrow down the code in your project to a minimum that causes the error, it can be diagnosed further. -Steve
Sep 13 2018