Re: How to make dub recursively build subPackages?

2022-02-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/2/22 5:14 AM, Vijay Nayar wrote: Greetings folks, In my project, I have a parent package with several sub-packages, each of which builds into either a library or an executable. I first started observing odd problems when I was running `dub build`, it would complain about different

Re: How to make dub recursively build subPackages?

2022-02-02 Thread Vijay Nayar via Digitalmars-d-learn
On Wednesday, 2 February 2022 at 10:14:25 UTC, Vijay Nayar wrote: Greetings folks, In my project, I have a parent package with several sub-packages, each of which builds into either a library or an executable. [...] I should point out there is 1 exception to subPackages not being

How to make dub recursively build subPackages?

2022-02-02 Thread Vijay Nayar via Digitalmars-d-learn
Greetings folks, In my project, I have a parent package with several sub-packages, each of which builds into either a library or an executable. I first started observing odd problems when I was running `dub build`, it would complain about different versions of vibe-d present, and it

Re: How to make dub recursively build subPackages?

2022-02-02 Thread Vijay Nayar via Digitalmars-d-learn
On Wednesday, 2 February 2022 at 14:07:08 UTC, Steven Schveighoffer wrote: On 2/2/22 5:14 AM, Vijay Nayar wrote: If you have them in the same repository, my recommendation is to use path dependencies instead of versions. So, e.g.: ```sdl dependency "funnel:proto" path="./proto" // in main

Re: How to make dub recursively build subPackages?

2022-02-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/2/22 1:42 PM, Vijay Nayar wrote: I made this change and it did indeed work correctly, thank you for that! Truthfully, it was not entirely clear to me how dub was deciding where to go to build. I had assumed that this was being done via the `subPackage` lines. Like many things in dub,

Re: How to make dub recursively build subPackages?

2022-02-02 Thread Vijay Nayar via Digitalmars-d-learn
On Wednesday, 2 February 2022 at 19:03:35 UTC, Steven Schveighoffer wrote: On 2/2/22 1:42 PM, Vijay Nayar wrote: Dub is kind of a hot mess in terms of the dependency resolution and ways to specify projects. I would love to see it cleaned up/reimplemented. -Steve For your larger more

ldc executable crashes with this code

2022-02-02 Thread forkit via Digitalmars-d-learn
Any reason why compiling this with ldc would cause the exe to crash? Compiling with DMD (using either declaration of palindrome works just fine though) // module test; import std; void main() { char[] palindrome = cast(char[])"able was I ere I saw elba"; //char[] palindrome

Re: ldc executable crashes with this code

2022-02-02 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Feb 02, 2022 at 11:21:52PM +, forkit via Digitalmars-d-learn wrote: [...] > char[] palindrome = cast(char[])"able was I ere I saw elba"; String literals are immutable by default. Casting immutable to mutable is UB (Undefined Behaviour). [...] > writeln(palindrome.reverse);

Re: ldc executable crashes with this code

2022-02-02 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Feb 03, 2022 at 01:39:33AM +, forkit via Digitalmars-d-learn wrote: > On Wednesday, 2 February 2022 at 23:30:50 UTC, H. S. Teoh wrote: > > On Wed, Feb 02, 2022 at 11:21:52PM +, forkit via Digitalmars-d-learn > > wrote: [...] > > > char[] palindrome = cast(char[])"able was I ere

Re: Can anyone provide an example of how D templates are overridable by global symbols?

2022-02-02 Thread Siarhei Siamashka via Digitalmars-d-learn
On Saturday, 29 January 2022 at 00:52:10 UTC, H. S. Teoh wrote: Trying out what I suggested on different OS's and toolchains will give you a good idea of what's actually out there. I will just reply with a quote from

Re: ldc executable crashes with this code

2022-02-02 Thread Tejas via Digitalmars-d-learn
On Wednesday, 2 February 2022 at 23:21:52 UTC, forkit wrote: Any reason why compiling this with ldc would cause the exe to crash? Compiling with DMD (using either declaration of palindrome works just fine though) // module test; import std; void main() { char[] palindrome =

Re: ldc executable crashes with this code

2022-02-02 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Feb 03, 2022 at 02:01:34AM +, forkit via Digitalmars-d-learn wrote: [...] > would be nice if the compiler told me something though :-( > > i.e. "hey, dude, you really wanna to that?" Mark your function @safe, and the compiler will stop you from unsafe casts of this nature. That's

Re: ldc executable crashes with this code

2022-02-02 Thread forkit via Digitalmars-d-learn
On Wednesday, 2 February 2022 at 23:30:50 UTC, H. S. Teoh wrote: On Wed, Feb 02, 2022 at 11:21:52PM +, forkit via Digitalmars-d-learn wrote: [...] char[] palindrome = cast(char[])"able was I ere I saw elba"; String literals are immutable by default. Casting immutable to mutable is

Re: ldc executable crashes with this code

2022-02-02 Thread Basile B. via Digitalmars-d-learn
On Thursday, 3 February 2022 at 01:39:33 UTC, forkit wrote: On Wednesday, 2 February 2022 at 23:30:50 UTC, H. S. Teoh wrote: [...] that explains ldc perhaps (although i don't really get it. It's cast to mutable and being assigned to mutable. in any case... ldc doesn't like it, but dmd is

Re: ldc executable crashes with this code

2022-02-02 Thread Basile B. via Digitalmars-d-learn
On Thursday, 3 February 2022 at 01:51:34 UTC, Basile B. wrote: On Thursday, 3 February 2022 at 01:39:33 UTC, forkit wrote: On Wednesday, 2 February 2022 at 23:30:50 UTC, H. S. Teoh wrote: [...] that explains ldc perhaps (although i don't really get it. It's cast to mutable and being

Re: ldc executable crashes with this code

2022-02-02 Thread forkit via Digitalmars-d-learn
On Thursday, 3 February 2022 at 01:39:33 UTC, forkit wrote: oops! forgot the .dup char[] palindrome = cast(char[])"able was I ere I saw elba".dup; ;-)

Re: ldc executable crashes with this code

2022-02-02 Thread forkit via Digitalmars-d-learn
On Thursday, 3 February 2022 at 01:57:12 UTC, H. S. Teoh wrote: would be nice if the compiler told me something though :-( i.e. "hey, dude, you really wanna to that?"

Re: ldc executable crashes with this code

2022-02-02 Thread forkit via Digitalmars-d-learn
On Thursday, 3 February 2022 at 03:25:39 UTC, H. S. Teoh wrote: On Thu, Feb 03, 2022 at 02:01:34AM +, forkit via Digitalmars-d-learn wrote: [...] would be nice if the compiler told me something though :-( i.e. "hey, dude, you really wanna to that?" Mark your function @safe, and the