Closed the-horo closed 2 years ago
I see. Ideally ebuilds don't network at all during compilation. The VERSION file or whatever is missing should be created by other means. This has happened in the past, maybe the file location changed. Compare e.g. the mv src/VERSION dmd/VERSION || die "Failed to move 'src/VERSION' to 'dmd/VERSION'"
in dmd.eclass.
I have been investigating this VERSION
file issue and I think I've got an idea of what's happening.
First of all, in my initial comment, it was not the first line that, when executed, threw the exception, it was instead:
../generated/linux/release/64/version_check ../generated/linux/release/64 ../VERSION /etc
Looking at the make file we find the VERSION heading containing the following recipes:
$G/version_check: ../config.d $(HOST_DMD_PATH)
@echo " (HOST_DMD_RUN) $< $<"
$(HOST_DMD_RUN) $< -of$@
$G/VERSION: $G/version_check ../VERSION FORCE
@$< $G ../VERSION $(SYSCONFDIR)
FORCE: ;
Going next to the source code of ../config.d we see:
void main(const string[] args)
{
// [...]
const version_ = generateVersion(versionFile);
// [...]
}
string generateVersion(const string versionFile)
{
// [...]
const result = execute(["git", "-C", workDir, "describe", "--dirty"]);
// [...]
}
And, according to the standard, execute
will throw on failure to start the process, i.e. when git
is not available.
So, this problem doesn't look easy to fix.
We have some options though:
git
as a dependency for these particular versions (what I did)../config.d
file, similarly to what was done in dmd-2.088.0
(link)Good job tracing the issue down. I always went with manually placing the VERSION file where the makefile tests for it, but if git -C <path> describe --dirty
does not open any network connections, I see no problem running that in the sandbox and adding the dependency. We can go with option 1 then.
Dmd ebuilds 2.084-2.087 throw an exception that
git
was not found when trying to build:When
dev-vcs/git
is installed the build works fine.