Skip to content

Commit

Permalink
Avoid running dub recursively in pre-generate command, call D compile…
Browse files Browse the repository at this point in the history
…r 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).
  • Loading branch information
kinke committed Jun 10, 2022
1 parent c6e18bc commit 8718928
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dub.sdl
Original file line number Diff line number Diff line change
Expand Up @@ -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`
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_version.d
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down

0 comments on commit 8718928

Please sign in to comment.