From 871892851a04caf09a675576e10f13d56af76902 Mon Sep 17 00:00:00 2001 From: Martin Kinkelin Date: Fri, 10 Jun 2022 02:37:31 +0200 Subject: [PATCH] Avoid running dub recursively in pre-generate command, call D compiler directly As we see spurious failures (version_.di not generated/importable) when calling dub recursively. The generate_version executable is built each time this way, not cached by dub anymore, but it's built pretty quickly (0.5 secs with LDC on my Linux x64 box, 0.3 secs with DMD). --- dub.sdl | 2 +- scripts/generate_version.d | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dub.sdl b/dub.sdl index 0bb20dc..42bad87 100644 --- a/dub.sdl +++ b/dub.sdl @@ -7,7 +7,7 @@ libs "ssl" "crypto" platform="posix" configuration "library-autodetect" { targetType "sourceLibrary" excludedSourceFiles "source/deimos/openssl/applink.d" - preGenerateCommands `${DUB} scripts/generate_version.d` platform="posix" + preGenerateCommands `$DC -run scripts/generate_version.d` platform="posix" versions `DeimosOpenSSLAutoDetect` } diff --git a/scripts/generate_version.d b/scripts/generate_version.d index ae19cea..766bf28 100644 --- a/scripts/generate_version.d +++ b/scripts/generate_version.d @@ -30,7 +30,7 @@ import std.string; import std.uni; // file full path is: $SOME_PATH/openssl/scripts/generate_version.d -// We want: $SOME_PATH/openssl/deimos/openssl/ +// We want: $SOME_PATH/openssl/source/deimos/openssl/ immutable TARGET_DIR_PATH = __FILE_FULL_PATH__ .dirName.dirName.buildPath("source", "deimos", "openssl");