[Issue 17838] rdmd file-descriptor issues with snap packages

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 24 13:25:53 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=17838

--- Comment #2 from Joseph Rushton Wakeling <joseph.wakeling at webdrake.net> ---
> With the improvements in 2.079, DMD now supports JSON output via stdout

That's hardly a viable solution.  The problem only arises when one attempts to
specify a different D compiler with the --compiler flag, and that compiler is
itself snap-packaged.

That would usually mean one is trying to use a different compiler than dmd --
i.e. ldmd2 or gdmd -- neither of which uses the 2.079 frontend yet.  And even
allowing for that, it's desirable to find a solution that does NOT work only
for future compiler releases.

We have to get away from this notion that a release of rdmd only has to work
with the dmd it's bundled with, and that it can ignore the question of working
properly with other D compilers on the same system, or D compilers using an
older frontend version.

This is ultimately an upstream bug that causes problems with the --compiler
flag in a narrow context.  We shouldn't work around it by causing problems with
the --compiler flag in almost EVERY context.

> Sure, have you tried patching spawnProcess out with
> a) execute and saving the output manually

Yes, but with limited success, probably because I didn't find a way that worked
with `spawnProcess`.  Probably the way forward here is to use `spawnShell`
instead, and to request that stdout be piped to a specified file name.  That
might also address other issues that people have had (e.g. one person mentioned
problems on Windows using a dmd.bat script that wrapped the true dmd compiler).

--


More information about the Digitalmars-d-bugs mailing list