Dear GDC developers, when gdc is used to generate a depfile (make format), if code uses feature import(file), file is not reported in list of dependencies. I tested with gdc-{8,9,10}. # cat main.d import std.stdio; void main() { writeln(import(".bashrc")); } # gdc main.d -J. -MMD # cat main.deps main.o: main.d Until version 8, gdc has support for fdeps option. Problem is that format used (dictated by dmd) is useless in Make/Ninja build systems. # gdc-8 -fdeps main.d -J. ... depsFile main (main.d) : .bashrc (/home/user/.bashrc) ... I build my code using meson project, which relies on depfiles created by compiler. Thus, a dependency is missed. Would that be possible to add file imported at compilation time in list of dependencies? Technically, I think this file is not read at same time than other import, but I still think that would be a great add to gdc. Thank you, Pierrick
Yes, I have too noticed this and have a fix in the gdc development branch, will backport it to gcc trunk as soon as I cherry-pick out parts not related to supporting the self-hosted front-end.
(In reply to ibuclaw from comment #1) > Yes, I have too noticed this and have a fix in the gdc development branch, > will backport it to gcc trunk as soon as I cherry-pick out parts not related > to supporting the self-hosted front-end. Very good news. Hope it will land in first release of gcc-10 first release.
The master branch has been updated by Iain Buclaw <ibuclaw@gcc.gnu.org>: https://gcc.gnu.org/g:4a01f7b1e73e98a86520d8a825ddd3777faa7c33 commit r10-7320-g4a01f7b1e73e98a86520d8a825ddd3777faa7c33 Author: Iain Buclaw <ibuclaw@gdcproject.org> Date: Sun Mar 22 00:10:17 2020 +0100 d: Fix missing dependencies in depfile for imported files (PR93038) A new field for tracking imported files was added to the front-end, this makes use of it by writing all such files in the make dependency list. gcc/d/ChangeLog: 2020-03-22 Iain Buclaw <ibuclaw@gdcproject.org> PR d/93038 * d-lang.cc (deps_write): Add content imported files to the make dependency list. gcc/testsuite/ChangeLog: 2020-03-22 Iain Buclaw <ibuclaw@gdcproject.org> PR d/93038 * gdc.dg/fileimports/pr93038.txt: New test. * gdc.dg/pr93038.d: New test.
Exposed information from the front-end, fix committed.
The master branch has been updated by Iain Buclaw <ibuclaw@gcc.gnu.org>: https://gcc.gnu.org/g:fbe60463bb80d859d4842f0113a6b24fe9cc9bd4 commit r10-7323-gfbe60463bb80d859d4842f0113a6b24fe9cc9bd4 Author: Iain Buclaw <ibuclaw@gdcproject.org> Date: Sun Mar 22 13:11:10 2020 +0100 d: Generate phony targets for content imported files (PR93038) This is in addition to the last change which started including them in the make dependency list. gcc/d/ChangeLog: 2020-03-22 Iain Buclaw <ibuclaw@gdcproject.org> PR d/93038 * d-lang.cc (deps_write): Generate phony targets for content imported files. gcc/testsuite/ChangeLog: 2020-03-22 Iain Buclaw <ibuclaw@gdcproject.org> PR d/93038 * gdc.dg/pr93038b.d: New test.