Troubleshooting DUB invocations

Sebastiaan Koppe mail at skoppe.eu
Tue Nov 19 13:41:32 UTC 2019


On Tuesday, 19 November 2019 at 12:06:36 UTC, Dukc wrote:
> On Monday, 18 November 2019 at 19:35:13 UTC, Sebastiaan Koppe 
> wrote:
>> Well yes. But that is just the way things worked up until now, 
>> ldc and dub just pick the host machine.
>>
>> Luckily there is the new dub `--arch` argument that can take a 
>> llvm triple, in our case wasm32-unknown-unknown-wasm. This 
>> causes dub not to add the `--no-as-needed`.
>
> That was news to me - I thought everything was always being 
> compiled to WASM.

Well it is, but some versions from the host were still set. E.g. 
version(linux).

>> Except, that it also passes the triple upwards the dependency 
>> tree. Now all the dependencies of spasm get compiled targeting 
>> wasm. This is a good thing, except that the optional package 
>> which spasm depends on fails to compile with it. There is a 
>> newer version that fixes the configuration, but that one fails 
>> because of the `from.std` import idiom (it imports the std 
>> package from phobos which doesn't recognise wasm and fails 
>> with "Unknown OS").
>
> I have sometimes thought that perhaps a static assert isn't the 
> best thing to use for unimplemented features in Phobos, 
> precisely because of this issue. A @disabled function stub 
> would serve better, unless I'm missing something.

Either way, as long as there is a clear way to debug why it ended 
up there. Unlike what we have now where you need to dig endlessly.

> "ending up"? If it's like what getting Phobos to work has been 
> for me, you're continuing the game, not ending up playing it ;D.

Yeah it is a pain, and since wasm/betterc isn't tested (or 
barely), anyone is free to break it. E.g. the recent change to 
the std.range.chain function, which suddenly wasn't betterC 
anymore...

>> Another workaround that you can use right now is by adding the 
>> `--build-mode=allAtOnce` argument to dub. It effectively gets 
>> you the old behaviour. It is what I am using in my CI to get 
>> it to go green again.
>
> Do not hurry more than you want -I already got my 
> extract-dub-failure workaround working.

Sure, but stuff just needs to work. I updated the BUILDING.md 
file in spasm as well.


More information about the Digitalmars-d-learn mailing list