Closed marshallmason closed 7 years ago
Are you absolutely certain GDC 4.9.2 is the compiler dub is actually invoking (and not 4.8.2, or some older DMD or something)? Because that's the same error I get on Scriptlike when using an older compiler based on DMD 2.065 or below (Scriptlike currently requires a compiler based on DMD front end 2.066 or up). But GDC 4.9.2 is based on a new enough DMD (2.066.1), and Scriptlike is working with GDC 4.9.2 on travis-ci, so it sounds like GDC 4.9.2 might not be the one actually getting run.
First off, try "dub test" rather than "dub run", since Scriptlike is a library, not an executable (so there's nothing to run other than the tests).
But use the -v option to check the compiler commands DUB is actually invoking (dub test -v
). I'm guessing it might not be invoking the compiler you expect. If it is running "gdc ...", make sure gdc --version
is reporting the version you expect.
Thanks for the ideas. I checked these things. dub test -v scriptlike says it is building scriptlike with the following command: gdc -o .dub/packages/scriptlike-0.9.3/.dub/build/unittest-unittest-linux.posix-x86_64-gdc_2065-A2F2D62D61655E5685A9F86ED9944A90/scriptlike_unittest -fdebug -g -funittest -Werror -Wall -fversion=unittest_scriptlike_d -fversion=Have_scriptlike -I.dub/packages/scriptlike-0.9.3/src/ .dub/packages/scriptlike-0.9.3/src/scriptlike/core.d .dub/packages/scriptlike-0.9.3/src/scriptlike/fail.d .dub/packages/scriptlike-0.9.3/src/scriptlike/file/extras.d .dub/packages/scriptlike-0.9.3/src/scriptlike/file/package.d .dub/packages/scriptlike-0.9.3/src/scriptlike/file/wrappers.d .dub/packages/scriptlike-0.9.3/src/scriptlike/interact.d .dub/packages/scriptlike-0.9.3/src/scriptlike/only.d .dub/packages/scriptlike-0.9.3/src/scriptlike/package.d .dub/packages/scriptlike-0.9.3/src/scriptlike/path/extras.d .dub/packages/scriptlike-0.9.3/src/scriptlike/path/package.d .dub/packages/scriptlike-0.9.3/src/scriptlike/path/wrappers.d .dub/packages/scriptlike-0.9.3/src/scriptlike/process.d .dub/packages/scriptlike-0.9.3/src/scriptlike/std.d
So, it appears it is indeed running gdc. I have never installed DMD or any other D compiler, so it's very unlikely that there is any conflict from a previous version or competing compilers. I have compilers for several other languages installed, but I doubt that matters.
When I run gdc --version, it reports: gdc (Debian 4.9.2-10) 4.9.2
If you've seen these errors on older versions of gdc but not on 4.9.2, your theory does sound extremely likely. There could be something kooky about the Debian build of gdc 4.9.2 that is not the case for travis-ci. That's the only thing I can think of that could explain the discrepancy.
If this is still an issue, what do you get when you compile & run the following with your version of GDC?:
import std.stdio;
import std.compiler;
void main()
{
writef("%s.%.3s", version_major, version_minor);
}
The first error I mentioned, in file/wrappers.d, is gone, as there is no slurp alias anymore. However, the second error I mentioned, in scriptlike/process.d is still there. FYI, this was tested on a fresh install of Debian Jessie.
The output you asked for is: 2.065.
On Thu, Feb 23, 2017 at 9:17 PM, Nick Sabalausky notifications@github.com wrote:
If this is still an issue, what do you get when you compile & run the following with your version of GDC?:
import std.stdio;import std.compiler; void main() { writef("%s.%.3s", version_major, version_minor); }
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Abscissa/scriptlike/issues/19#issuecomment-282206504, or mute the thread https://github.com/notifications/unsubscribe-auth/ANTWr-hSXkFulGDgq_67LE4JzL6XJJdeks5rfmfOgaJpZM4FxJSg .
Ahh, ok, that confirms what we were suspecting, apparently Debian's GDC v4.9.2 is built using DMDFE 2.065, whereas travis-ci's GDC v4.9.2 is built with DMDFE 2.066 instead. That's kind of unfortunate to have that discrepancy.
Unfortunately Scriptlike dropped support for DMDFE 2.065 (which is very old) back in v0.8.0, mainly because of bugs in how Phobos (mis)handled spaces in filepaths on Windows.
However, I'm adding a workaround for the compile issue anyway, since it ended up not being too difficult, and that spaces issue doesn't occur on Linux anyway. DMDFE 2.065 still is still not considered officially supported by Scriptlike though, but it should at least compile & work for you now anyway.
That said though, I'd highly recommend installing a newer D compiler (and maybe switching to DMD or LDC as LDC is kept much more up-to-date with D than GDC is), bypass apt if you need to, don't know about ldc but dmd is super easy to install manually - just download, extract and use.
I'm running gdc 4.9.2 on Debian Jessie. I used dub to fetch scriptlike 0.9.3. When I ran dub run scriptlike, it gave the following error:
file/wrappers.d:431: error: template scriptlike.file.wrappers.slurp(Types...)(Path filename, in string format) conflicts with alias scriptlike.file.wrappers.slurp at file/wrappers.d:63
Commenting out this line in file/wrappers.d is my work-around: alias slurp = std.file.slurp; ///ditto
However, some new errors then arise: scriptlike/process.d:165: error: mismatched function return type inference of ProcessOutput and Tuple!(int, "status", string, "output") scriptlike/process.d:165: error: cannot implicitly convert expression (executeShell(command, null, cast(Config)0, 18446744073709551615LU)) of type ProcessOutput to Tuple!(int, "status", string, "output")