From 022af4300fdb953d59408e69f3da9c20eeed44f8 Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Sat, 2 Dec 2023 11:55:28 +0000 Subject: [PATCH 1/3] update version to v1.35.0 --- source/dub/version_.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/dub/version_.d b/source/dub/version_.d index a8dfa3ebe..e02900930 100644 --- a/source/dub/version_.d +++ b/source/dub/version_.d @@ -1,2 +1,2 @@ module dub.version_; -enum dubVersion = "v1.35.0-rc.1"; +enum dubVersion = "v1.35.0"; From 91c83c953d8846b95df01d06ba759d7a8ae31d55 Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Sat, 2 Dec 2023 13:56:40 +0000 Subject: [PATCH 2/3] purge changelog --- changelog/deep.dd | 14 -------------- changelog/describe-configs.dd | 6 ------ changelog/init_license.dd | 3 --- changelog/recipefile.dd | 15 --------------- 4 files changed, 38 deletions(-) delete mode 100644 changelog/deep.dd delete mode 100644 changelog/describe-configs.dd delete mode 100644 changelog/init_license.dd delete mode 100644 changelog/recipefile.dd diff --git a/changelog/deep.dd b/changelog/deep.dd deleted file mode 100644 index ebff9c27a..000000000 --- a/changelog/deep.dd +++ /dev/null @@ -1,14 +0,0 @@ -Added `--deep=` switch to dub build - -By specifying this flag, you can now build all the dependencies -of a staticLibrary. The default behavior is to only build the -library located in the root directory of the dub configuration -file. This allows better integration with other build systems -which require the libraries to be built upfront. - -``` -dub build --deep -``` - -If a staticLibrary A depends on staticLibrary B, and the --deep -flag is specified, dub will output both the A and B libraries. diff --git a/changelog/describe-configs.dd b/changelog/describe-configs.dd deleted file mode 100644 index 76c4c2ac7..000000000 --- a/changelog/describe-configs.dd +++ /dev/null @@ -1,6 +0,0 @@ -Added `default-config`, `configs`, `default-build`, `builds` data to dub describe - -- `default-config` will be a single string that is the `--config` configuration that DUB would pick when not provided any configuration such as in a simple `dub build` call -- `configs` is a list of all available configurations (default generated application and/or library, or the manually specified ones in the recipe) -- `default-build` will be a single string that is the `--build` build type that DUB would pick when not provided any (currently always "debug") -- `builds` is a list of all available build types (built-in + custom defined) diff --git a/changelog/init_license.dd b/changelog/init_license.dd deleted file mode 100644 index b585e60a4..000000000 --- a/changelog/init_license.dd +++ /dev/null @@ -1,3 +0,0 @@ -Dub init now has a select menu for package format and license - -When creating a package using `dub init` you are now prompted to select a license for the package. \ No newline at end of file diff --git a/changelog/recipefile.dd b/changelog/recipefile.dd deleted file mode 100644 index 2941dbc38..000000000 --- a/changelog/recipefile.dd +++ /dev/null @@ -1,15 +0,0 @@ -Added `--recipe=` switch to DUB - -You can now override which file is used as recipe, instead of the default -`dub.sdl` and `dub.json`. This means you can define multiple dub.json files for -local development, for example for special local-machine-only operations, and -select which one to use over the CLI. - -``` -dub build --recipe=custom-dub.json -``` - -This can also be used to pick dub.sdl over dub.json, if both of them exist in -the same directory. Although this is discouraged for interoperability with other -DUB-supporting tools and general confusion for users. Both existing at the same -time may also become an error when this switch is not specified in the future. From 8d39470ed5a33741c985f86d06c89842bdc77652 Mon Sep 17 00:00:00 2001 From: "richard (rikki) andrew cattermole" Date: Mon, 20 Nov 2023 22:05:02 +1300 Subject: [PATCH 3/3] Fix issue #2190 - windows: dub won't run if TEMP is unset or empty --- source/dub/commandline.d | 25 ++++++++++++--- test/issue2190-unset-TEMP.script.d | 51 ++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 5 deletions(-) create mode 100644 test/issue2190-unset-TEMP.script.d diff --git a/source/dub/commandline.d b/source/dub/commandline.d index 5bb5db064..d3367cb62 100644 --- a/source/dub/commandline.d +++ b/source/dub/commandline.d @@ -371,6 +371,8 @@ unittest { */ int runDubCommandLine(string[] args) { + import std.file : tempDir; + static string[] toSinglePackageArgs (string args0, string file, string[] trailing) { return [args0, "run", "-q", "--temp-build", "--single", file, "--"] ~ trailing; @@ -382,11 +384,24 @@ int runDubCommandLine(string[] args) logDiagnostic("DUB version %s", getDUBVersion()); - version(Windows){ - // rdmd uses $TEMP to compute a temporary path. since cygwin substitutes backslashes - // with slashes, this causes OPTLINK to fail (it thinks path segments are options) - // we substitute the other way around here to fix this. - environment["TEMP"] = environment["TEMP"].replace("/", "\\"); + { + version(Windows) { + // Guarantee that this environment variable is set + // this is specifically needed because of the Windows fix that follows this statement. + // While it probably isn't needed for all targets, it does simplify things a bit. + // Question is can it be more generic? Probably not due to $TMP + if ("TEMP" !in environment) + environment["TEMP"] = tempDir(); + + // rdmd uses $TEMP to compute a temporary path. since cygwin substitutes backslashes + // with slashes, this causes OPTLINK to fail (it thinks path segments are options) + // we substitute the other way around here to fix this. + + // In case the environment variable TEMP is empty (it should never be), we'll swap out + // opIndex in favor of get with the fallback. + + environment["TEMP"] = environment.get("TEMP", null).replace("/", "\\"); + } } auto handler = CommandLineHandler(getCommands()); diff --git a/test/issue2190-unset-TEMP.script.d b/test/issue2190-unset-TEMP.script.d new file mode 100644 index 000000000..398695346 --- /dev/null +++ b/test/issue2190-unset-TEMP.script.d @@ -0,0 +1,51 @@ +/+ dub.json: { + "name": "issue2190_unset_TEMP" +} +/ + +module issue2190_unset_TEMP.script; + +int main() +{ + import std.stdio; + import std.algorithm; + import std.path; + import std.process; + + const dir = __FILE_FULL_PATH__.dirName(); + + // doesn't matter, just pick something + const file = buildPath(dir, "single-file-sdl-default-name.d"); + + const dub = environment.get("DUB", buildPath(dirName(dir), "bin", "dub.exe")); + + int exitCode; + + void runTest(scope const string[] cmd) + { + const result = execute(cmd); + + if (result.status || result.output.canFind("Failed")) + { + writefln("\n> %-(%s %)", cmd); + writeln("==========================================================="); + writeln(result.output); + writeln("==========================================================="); + writeln("Last command failed with exit code ", result.status, '\n'); + exitCode = 1; + } + } + + environment.remove("TEMP"); + + // only guaranteed to be there on Windows + // See: runDubCommandLine in commandline + version(Windows) + { + runTest([ + dub, "build", + "--single", file, + ]); + } + + return exitCode; +}