Re: Hardcoded filepaths in compiled exe

2020-12-29 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 30 December 2020 at 01:21:37 UTC, Steven Schveighoffer wrote: On 12/29/20 7:46 PM, Basile B. wrote: On Tuesday, 29 December 2020 at 23:11:25 UTC, Steven Schveighoffer wrote: But I would think a feature should exist that masks the base directory of exception file names. Probably

Re: Hardcoded filepaths in compiled exe

2020-12-29 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/29/20 7:46 PM, Basile B. wrote: On Tuesday, 29 December 2020 at 23:11:25 UTC, Steven Schveighoffer wrote: But I would think a feature should exist that masks the base directory of exception file names. Probably worth an enhancement request. Also aren't dmd output binaries supposed to

Re: Hardcoded filepaths in compiled exe

2020-12-29 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 29 December 2020 at 23:11:25 UTC, Steven Schveighoffer wrote: But I would think a feature should exist that masks the base directory of exception file names. Probably worth an enhancement request. -Steve Also aren't dmd output binaries supposed to be "reproducible" ?

Re: Hardcoded filepaths in compiled exe

2020-12-29 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 29 December 2020 at 21:27:07 UTC, Raikia wrote: Interesting. I was able to clobber it with bbe with no issues. I'm surprised the compiler doesn't strip out this potentially sensitive metadata, but I guess I'll just patch it out as part of my build process. Thanks! Other super

Re: How to Install D on my new MacBook with M1 ARM computer

2020-12-29 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 29 December 2020 at 19:04:33 UTC, Dave Chapman wrote: Greetings, Apologies If I have double posted. I received a MacBook pro M1 for Christmas and I would like to install a D compiler on it. After looking at the downloads page I don't see how to install D on a new MacBook. I did

Re: Hardcoded filepaths in compiled exe

2020-12-29 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/29/20 4:27 PM, Raikia wrote: On Tuesday, 29 December 2020 at 19:30:53 UTC, Basile B. wrote: On Tuesday, 29 December 2020 at 16:13:53 UTC, Raikia wrote: Hey all, [...] $ strings -a program.exe | grep 'dmd2' C:\D\dmd2\windows\bin\..\..\src\phobos\std\file.d

Re: dmd: enum to!string slows down compilation

2020-12-29 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 29 December 2020 at 22:42:16 UTC, kdevel wrote: Why is the enum to!string conversion so slow? ~~~slowenumtostringconversion.d private enum S { A, B, C, D, }; [...] one factor is all the template constraints that are evaluated until the right std.conv.to overload gets selected.

dmd: enum to!string slows down compilation

2020-12-29 Thread kdevel via Digitalmars-d-learn
Why is the enum to!string conversion so slow? ~~~slowenumtostringconversion.d private enum S { A, B, C, D, }; version (fast) { string resolve (E) (E e) { static foreach (m; __traits (allMembers, E)) if (e == __traits (getMember, E, m)) return m; assert

Re: Hardcoded filepaths in compiled exe

2020-12-29 Thread Raikia via Digitalmars-d-learn
On Tuesday, 29 December 2020 at 19:30:53 UTC, Basile B. wrote: On Tuesday, 29 December 2020 at 16:13:53 UTC, Raikia wrote: Hey all, [...] $ strings -a program.exe | grep 'dmd2' C:\D\dmd2\windows\bin\..\..\src\phobos\std\file.d C:\D\dmd2\windows\bin\..\..\src\phobos\std\utf.d

Re: 64-bit compilation in Wine

2020-12-29 Thread Raikia via Digitalmars-d-learn
On Tuesday, 29 December 2020 at 20:29:15 UTC, H. S. Teoh wrote: On Tue, Dec 29, 2020 at 07:39:14PM +, Raikia via Digitalmars-d-learn wrote: [...] So interestingly, I actually got this to work by running "sudo wine" instead of just "wine". No idea why wine needs root access on the

Re: 64-bit compilation in Wine

2020-12-29 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Dec 29, 2020 at 07:39:14PM +, Raikia via Digitalmars-d-learn wrote: [...] > So interestingly, I actually got this to work by running "sudo wine" > instead of just "wine". No idea why wine needs root access on the > underlying system for wine to operate properly but ok... > > Now I'm

Re: Nasty supprise when using c 'anonymous struct and union' in D with 'static struct'

2020-12-29 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Dec 29, 2020 at 12:50:06PM -0500, Steven Schveighoffer via Digitalmars-d-learn wrote: > On 12/29/20 12:45 PM, H. S. Teoh wrote: [...] > > You need to add 'static' to the (outer) struct declarations in your > > unittest block, because otherwise they *will* have a context > > pointer. > >

Re: Nasty supprise when using c 'anonymous struct and union' in D with 'static struct'

2020-12-29 Thread Arjan via Digitalmars-d-learn
On Tuesday, 29 December 2020 at 17:49:20 UTC, Steven Schveighoffer wrote: On 12/29/20 12:13 PM, Arjan wrote: On Tuesday, 29 December 2020 at 14:42:07 UTC, Steven Schveighoffer wrote: On 12/29/20 7:38 AM, Arjan wrote: see https://en.cppreference.com/w/c/language/struct structs only add

Re: 64-bit compilation in Wine

2020-12-29 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 29 December 2020 at 19:39:14 UTC, Raikia wrote: So interestingly, I actually got this to work by running "sudo wine" instead of just "wine". No idea why wine needs root access on the underlying system for wine to operate properly but ok... weird. i should try that too later.

Re: 64-bit compilation in Wine

2020-12-29 Thread Raikia via Digitalmars-d-learn
On Tuesday, 29 December 2020 at 18:09:55 UTC, Adam D. Ruppe wrote: On Tuesday, 29 December 2020 at 17:49:19 UTC, Raikia wrote: "LLVM ERROR: Could not acquire a cryptographic context: Unknown error (0x80090017) I sometimes get this too, it seems to be a bug in wine. I actually kept an old

Re: Hardcoded filepaths in compiled exe

2020-12-29 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 29 December 2020 at 16:13:53 UTC, Raikia wrote: Hey all, [...] $ strings -a program.exe | grep 'dmd2' C:\D\dmd2\windows\bin\..\..\src\phobos\std\file.d C:\D\dmd2\windows\bin\..\..\src\phobos\std\utf.d C:\D\dmd2\windows\bin\..\..\src\phobos\std\base64.d This problem is more

How to Install D on my new MacBook with M1 ARM computer

2020-12-29 Thread Dave Chapman via Digitalmars-d-learn
Greetings, Apologies If I have double posted. I received a MacBook pro M1 for Christmas and I would like to install a D compiler on it. After looking at the downloads page I don't see how to install D on a new MacBook. I did not see a precompiled version to download with the possible

Re: 64-bit compilation in Wine

2020-12-29 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 29 December 2020 at 17:49:19 UTC, Raikia wrote: "LLVM ERROR: Could not acquire a cryptographic context: Unknown error (0x80090017) I sometimes get this too, it seems to be a bug in wine. I actually kept an old version of wine around where it works, and a new version side by

Re: Nasty supprise when using c 'anonymous struct and union' in D with 'static struct'

2020-12-29 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/29/20 12:45 PM, H. S. Teoh wrote: On Tue, Dec 29, 2020 at 05:13:19PM +, Arjan via Digitalmars-d-learn wrote: [...] On the C/C++ side there is no static. I added those on the D side to to make sure there is no context pointer being added, since that will change the layout and size of

Re: Nasty supprise when using c 'anonymous struct and union' in D with 'static struct'

2020-12-29 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/29/20 12:13 PM, Arjan wrote: On Tuesday, 29 December 2020 at 14:42:07 UTC, Steven Schveighoffer wrote: On 12/29/20 7:38 AM, Arjan wrote: see https://en.cppreference.com/w/c/language/struct I added in some printouts of the addresses of the variables. It appears that if you add static

64-bit compilation in Wine

2020-12-29 Thread Raikia via Digitalmars-d-learn
Hey all, I'm trying to get DMD to compile in x64 under Wine but I'm having issues with: "LLVM ERROR: Could not acquire a cryptographic context: Unknown error (0x80090017) Stack dump: 0. Program arguments: C:\D\dmd2\windows\bin\lld-link.exe /NOLOGO test.obj /DEFAULTLIB:phobos64

Re: Nasty supprise when using c 'anonymous struct and union' in D with 'static struct'

2020-12-29 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Dec 29, 2020 at 05:13:19PM +, Arjan via Digitalmars-d-learn wrote: [...] > On the C/C++ side there is no static. I added those on the D side to > to make sure there is no context pointer being added, since that will > change the layout and size of struct. (in the c/c++ code those

Re: Nasty supprise when using c 'anonymous struct and union' in D with 'static struct'

2020-12-29 Thread Arjan via Digitalmars-d-learn
On Tuesday, 29 December 2020 at 14:42:07 UTC, Steven Schveighoffer wrote: On 12/29/20 7:38 AM, Arjan wrote: see https://en.cppreference.com/w/c/language/struct I added in some printouts of the addresses of the variables. It appears that if you add static to the struct, it now becomes a

Hardcoded filepaths in compiled exe

2020-12-29 Thread Raikia via Digitalmars-d-learn
Hey all, I'm trying to compile a release-level binary but it looks like the resulting executable has metadata in it that I would like to avoid. I've tried using both LDC and DMD with the below commands (I've tried many variations of them, you can see the switches are in an attempt to remove

Re: C++ or D?

2020-12-29 Thread Imperatorn via Digitalmars-d-learn
On Tuesday, 10 November 2020 at 01:00:50 UTC, Mark wrote: Hi all, my question would be about using D or not using D. Is the newest C++ iteration any good compared to D? [...] https://ibb.co/syQRs9v

Re: Reading files using delimiters/terminators

2020-12-29 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/26/20 7:13 PM, Rekel wrote: I'm trying to read a file with entries seperated by '\n\n' (empty line), with entries containing '\n'. I thought the File.readLine(KeepTerminator, Terminator) might work, as it seems to accept strings as terminators, since there seems to have been a thread

Re: Nasty supprise when using c 'anonymous struct and union' in D with 'static struct'

2020-12-29 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/29/20 7:38 AM, Arjan wrote: see https://en.cppreference.com/w/c/language/struct It seems the 'static' must NOT be used here to get the equivalent behavior of c, when left in the assertions will fail. Is this expected? ``` unittest { struct W { align(1):     long k;     long l; }

Nasty supprise when using c 'anonymous struct and union' in D with 'static struct'

2020-12-29 Thread Arjan via Digitalmars-d-learn
see https://en.cppreference.com/w/c/language/struct It seems the 'static' must NOT be used here to get the equivalent behavior of c, when left in the assertions will fail. Is this expected? ``` unittest { struct W { align(1): long k; long l; } struct V { align(1): union //

Re: C++ interop, abstract struct problem

2020-12-29 Thread RSY via Digitalmars-d-learn
Here is a debugger view of the passed IAllocator& https://i.imgur.com/p04Tj4a.png

Re: C++ interop, abstract struct problem

2020-12-29 Thread RSY via Digitalmars-d-learn
Hmm, something seems to be very wrong, here what i got so far ``` D struct IAllocator { } struct DefaultAllocator { // BASE -- IAllocator base = IAllocator(); alias base this; //

Re: Range of dub package versions

2020-12-29 Thread ShadoLight via Digitalmars-d-learn
On Monday, 28 December 2020 at 23:49:02 UTC, rikki cattermole wrote: $ dub upgrade [..] Unless you change the version invalidating it, it most likely won't upgrade by itself. Thanks Rikki - that explains it and, indeed, worked perfectly. Thanks!