aboutsummaryrefslogtreecommitdiffstats
path: root/community/dub/0001-Revert-cache-the-generated-test-main-file-dub_test_r.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/dub/0001-Revert-cache-the-generated-test-main-file-dub_test_r.patch')
-rw-r--r--community/dub/0001-Revert-cache-the-generated-test-main-file-dub_test_r.patch207
1 files changed, 0 insertions, 207 deletions
diff --git a/community/dub/0001-Revert-cache-the-generated-test-main-file-dub_test_r.patch b/community/dub/0001-Revert-cache-the-generated-test-main-file-dub_test_r.patch
deleted file mode 100644
index 6f81841ee9d..00000000000
--- a/community/dub/0001-Revert-cache-the-generated-test-main-file-dub_test_r.patch
+++ /dev/null
@@ -1,207 +0,0 @@
-From 4c37352b9ba6f85eac04dfa9a43fd3d3da25bf72 Mon Sep 17 00:00:00 2001
-From: Geod24 <pro.mathias.lang@gmail.com>
-Date: Mon, 22 Feb 2021 20:52:25 +0900
-Subject: Revert "cache the generated test main file: dub_test_root.d"
-
-This reverts commit df67d832c9a2911e30f19a01d9b5404d161b4215.
----
- source/dub/dub.d | 17 +----
- source/dub/generators/build.d | 62 ++++++++-----------
- test/cache-generated-test-config.sh | 24 -------
- test/cache-generated-test-config/.no_build | 0
- test/cache-generated-test-config/.no_run | 0
- test/cache-generated-test-config/.no_test | 0
- test/cache-generated-test-config/dub.sdl | 3 -
- .../cache-generated-test-config/source/test.d | 6 --
- 8 files changed, 29 insertions(+), 83 deletions(-)
- delete mode 100755 test/cache-generated-test-config.sh
- delete mode 100644 test/cache-generated-test-config/.no_build
- delete mode 100644 test/cache-generated-test-config/.no_run
- delete mode 100644 test/cache-generated-test-config/.no_test
- delete mode 100644 test/cache-generated-test-config/dub.sdl
- delete mode 100644 test/cache-generated-test-config/source/test.d
-
-diff --git a/source/dub/dub.d b/source/dub/dub.d
-index e88ece23..ec0fb331 100644
---- a/source/dub/dub.d
-+++ b/source/dub/dub.d
-@@ -658,7 +658,6 @@ class Dub {
- }
-
- // prepare the list of tested modules
--
- string[] import_modules;
- foreach (file; lbuildsettings.sourceFiles) {
- if (file.endsWith(".d")) {
-@@ -679,23 +678,11 @@ class Dub {
- }
- }
-
-- NativePath mainfile;
-- if (settings.tempBuild)
-- mainfile = getTempFile("dub_test_root", ".d");
-- else {
-- import dub.generators.build : computeBuildName;
-- mainfile = m_project.rootPackage.path ~ format(".dub/code/%s_dub_test_root.d", computeBuildName(test_config, settings, import_modules));
-- }
--
-- mkdirRecurse(mainfile.parentPath.toNativeString());
--
-- bool regenerateMainFile = settings.force || !existsFile(mainfile);
--
- // generate main file
-+ NativePath mainfile = getTempFile("dub_test_root", ".d");
- tcinfo.sourceFiles[""] ~= mainfile.toNativeString();
- tcinfo.mainSourceFile = mainfile.toNativeString();
--
-- if (!m_dryRun && regenerateMainFile) {
-+ if (!m_dryRun) {
- auto fil = openFile(mainfile, FileMode.createTrunc);
- scope(exit) fil.close();
- fil.write("module dub_test_root;\n");
-diff --git a/source/dub/generators/build.d b/source/dub/generators/build.d
-index 649fbe0b..75250f4b 100644
---- a/source/dub/generators/build.d
-+++ b/source/dub/generators/build.d
-@@ -32,24 +32,6 @@ string getObjSuffix(const scope ref BuildPlatform platform)
- return platform.platform.canFind("windows") ? ".obj" : ".o";
- }
-
--string computeBuildName(string config, GeneratorSettings settings, const string[][] hashing...)
--{
-- import std.digest;
-- import std.digest.md;
--
-- MD5 hash;
-- hash.start();
-- void addHash(in string[] strings...) { foreach (s; strings) { hash.put(cast(ubyte[])s); hash.put(0); } hash.put(0); }
-- foreach(strings; hashing)
-- addHash(strings);
-- auto hashstr = hash.finish().toHexString().idup;
--
-- return format("%s-%s-%s-%s-%s_v%s-%s", config, settings.buildType,
-- settings.platform.platform.join("."),
-- settings.platform.architecture.join("."),
-- settings.platform.compiler, settings.platform.compilerVersion, hashstr);
--}
--
- class BuildGenerator : ProjectGenerator {
- private {
- PackageManager m_packageMan;
-@@ -347,23 +329,33 @@ class BuildGenerator : ProjectGenerator {
-
- private string computeBuildID(string config, in BuildSettings buildsettings, GeneratorSettings settings)
- {
-- const(string[])[] hashing = [
-- buildsettings.versions,
-- buildsettings.debugVersions,
-- buildsettings.dflags,
-- buildsettings.lflags,
-- buildsettings.stringImportPaths,
-- buildsettings.importPaths,
-- settings.platform.architecture,
-- [
-- (cast(uint)buildsettings.options).to!string,
-- settings.platform.compilerBinary,
-- settings.platform.compiler,
-- settings.platform.compilerVersion,
-- ],
-- ];
--
-- return computeBuildName(config, settings, hashing);
-+ import std.digest;
-+ import std.digest.md;
-+ import std.bitmanip;
-+
-+ MD5 hash;
-+ hash.start();
-+ void addHash(in string[] strings...) { foreach (s; strings) { hash.put(cast(ubyte[])s); hash.put(0); } hash.put(0); }
-+ void addHashI(int value) { hash.put(nativeToLittleEndian(value)); }
-+ addHash(buildsettings.versions);
-+ addHash(buildsettings.debugVersions);
-+ //addHash(buildsettings.versionLevel);
-+ //addHash(buildsettings.debugLevel);
-+ addHash(buildsettings.dflags);
-+ addHash(buildsettings.lflags);
-+ addHash((cast(uint)buildsettings.options).to!string);
-+ addHash(buildsettings.stringImportPaths);
-+ addHash(buildsettings.importPaths);
-+ addHash(settings.platform.architecture);
-+ addHash(settings.platform.compilerBinary);
-+ addHash(settings.platform.compiler);
-+ addHashI(settings.platform.frontendVersion);
-+ auto hashstr = hash.finish().toHexString().idup;
-+
-+ return format("%s-%s-%s-%s-%s_%s-%s", config, settings.buildType,
-+ settings.platform.platform.join("."),
-+ settings.platform.architecture.join("."),
-+ settings.platform.compiler, settings.platform.frontendVersion, hashstr);
- }
-
- private void copyTargetFile(NativePath build_path, BuildSettings buildsettings, GeneratorSettings settings)
-diff --git a/test/cache-generated-test-config.sh b/test/cache-generated-test-config.sh
-deleted file mode 100755
-index 9f5ca6f7..00000000
---- a/test/cache-generated-test-config.sh
-+++ /dev/null
-@@ -1,24 +0,0 @@
--#!/usr/bin/env bash
--
--. $(dirname "${BASH_SOURCE[0]}")/common.sh
--cd ${CURR_DIR}/cache-generated-test-config
--rm -rf .dub
--
--${DUB} test --compiler=${DC}
--
--STAT="stat -c '%Y'"
--[[ "$OSTYPE" == "darwin"* ]] && STAT="stat -f '%m' -t '%Y'"
--
--EXECUTABLE_TIME="$(${STAT} cache-generated-test-config-test-library)"
--[ -z "$EXECUTABLE_TIME" ] && die $LINENO 'no EXECUTABLE_TIME was found'
--MAIN_TIME="$(${STAT} "$(ls .dub/code/*dub_test_root.d)")"
--[ -z "$MAIN_TIME" ] && die $LINENO 'no MAIN_TIME was found'
--
--${DUB} test --compiler=${DC}
--MAIN_FILES_COUNT=$(ls .dub/code/*dub_test_root.d | wc -l)
--
--[ $MAIN_FILES_COUNT -ne 1 ] && die $LINENO 'DUB generated more then one main file'
--[ "$EXECUTABLE_TIME" != "$(${STAT} cache-generated-test-config-test-library)" ] && die $LINENO 'The executable has been rebuilt'
--[ "$MAIN_TIME" != "$(${STAT} "$(ls .dub/code/*dub_test_root.d | head -n1)")" ] && die $LINENO 'The test main file has been rebuilt'
--
--exit 0
-\ No newline at end of file
-diff --git a/test/cache-generated-test-config/.no_build b/test/cache-generated-test-config/.no_build
-deleted file mode 100644
-index e69de29b..00000000
-diff --git a/test/cache-generated-test-config/.no_run b/test/cache-generated-test-config/.no_run
-deleted file mode 100644
-index e69de29b..00000000
-diff --git a/test/cache-generated-test-config/.no_test b/test/cache-generated-test-config/.no_test
-deleted file mode 100644
-index e69de29b..00000000
-diff --git a/test/cache-generated-test-config/dub.sdl b/test/cache-generated-test-config/dub.sdl
-deleted file mode 100644
-index ccfd0a22..00000000
---- a/test/cache-generated-test-config/dub.sdl
-+++ /dev/null
-@@ -1,3 +0,0 @@
--name "cache-generated-test-config"
--
--targetType "staticLibrary"
-\ No newline at end of file
-diff --git a/test/cache-generated-test-config/source/test.d b/test/cache-generated-test-config/source/test.d
-deleted file mode 100644
-index c6e2276c..00000000
---- a/test/cache-generated-test-config/source/test.d
-+++ /dev/null
-@@ -1,6 +0,0 @@
--module test;
--
--unittest
--{
-- assert(true);
--}
-\ No newline at end of file
---
-2.24.3 (Apple Git-128)
-