On Wednesday, 10 May 2017 at 08:17:00 UTC, Iain Buclaw wrote:
On 10 May 2017 at 05:11, Solomon E via D.gnu
<d.gnu@puremagic.com> wrote:
$ gdc program.d -Isubdir subdir/first_module.d
subdir/second_module.d
cc1d: ../../src/gcc/d/dfrontend/import.c:144: void
Import::load(Scope*):
Assertion `mod->isPackageFile == (p->isPkgMod == PKGmodule)'
failed.
cc1d: internal compiler error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-6/README.Bugs> for instructions.
I can't reproduce this, but is a front-end bug anyway, so
should be reproducible in DMD too (if you compile it without
-release).
Sorry I didn't reply about this in a timely manner. The gdc
compiler versions that produced the assertion error were 2.068
and earlier. I had thought it was being fixed, because the code
there changed within a few days of when I first found that
assertion error. Then I waited for the upgrade to get to me. It's
not a problem any more in dmd 2.074, which should mean it's fixed
if it was a front end problem.
For the other error, about importing an import if that's what the
problem was, I found that in gdc 2.068. It was a new error that
hadn't seen before in experiments that used to work, in earlier
gdc versions than 2.068, so I'm glad I was able to help find a
current bug that you could fix.
Also, the gdc compiler has sometimes allowed importing a module
qualified by a folder or package name, where the 2.074 dmd
compiler gives an error on that sort of import, saying that the
module must be imported as its own name. I don't know which is
the way it really should be.
Those experiments I was doing were about different ways to build
and use a personal D library or a folder that would be used like
a library from different project folders. The way I decided was
best for me was just to keep it simple, by making a folder with
symlinks to the versions of my D source files that I want to use
like a library. That way sometimes it's only necessary to mention
that folder correctly after -I in the compile command line,
instead of having to mention every file that's imported.
(Also that way I don't have to recompile a library .a file with a
makefile for every code change and after every D compiler version
update, which I found out does cause a failure to build if it's
not recompiled.)