From c2df4f6e2ae7571865174dd7223bb1f64a22d791 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Thu, 15 Dec 2016 05:36:29 +0100 Subject: [PATCH 1/6] Fix broken chmodzip.d script --- chmodzip.d | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/chmodzip.d b/chmodzip.d index 0476d8072e..ac960ec583 100644 --- a/chmodzip.d +++ b/chmodzip.d @@ -26,14 +26,13 @@ int main(string[] args) zr.expand(de); writefln("name = %s", de.name); writefln("\tcomment = %s", de.comment); - writefln("\tmadeVersion = x%04x", de.madeVersion); writefln("\textractVersion = x%04x", de.extractVersion); writefln("\tflags = x%04x", de.flags); writefln("\tcompressionMethod = %d", de.compressionMethod); writefln("\tcrc32 = x%08x", de.crc32); writefln("\texpandedSize = %s", de.expandedSize); writefln("\tcompressedSize = %s", de.compressedSize); - writefln("\teattr = %03o, %03o", de.externalAttributes >> 16, de.externalAttributes & 0xFFFF); + writefln("\teattr = %03o, %03o", de.fileAttributes); writefln("\tiattr = %03o", de.internalAttributes); //writefln("\tdate = %s", std.date.toString(std.date.toDtime(de.time))); writefln("\tdate = %s", SysTime(unixTimeToStdTime((de.time)))); @@ -74,11 +73,10 @@ L1: foreach (member; members) { - if (de.name == member && ((de.externalAttributes >> 16) & octal!7777) != newattr) + if (de.name == member && (de.fileAttributes & octal!7777) != newattr) { changes = true; - de._madeVersion = 0x317; // necessary or linux unzip will ignore attributes - de.externalAttributes = (de.externalAttributes & ~(octal!7777 << 16)) | (newattr << 16); + de.fileAttributes = de.fileAttributes & ~octal!7777 | newattr; break; } } From ac20b7c0c82d185ecdc347e7aa072fb737d5b75f Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Thu, 15 Dec 2016 18:18:39 +0100 Subject: [PATCH 2/6] Remove wrong implicit string concatenation from dman.d --- dman.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dman.d b/dman.d index 4d12aaa023..7eb90a6f7a 100644 --- a/dman.d +++ b/dman.d @@ -142,7 +142,7 @@ string CHeader(string topic) static string[] dmccmds = [ "assert.h", "complex.h", "ctype.h", "fenv.h", - "float.h", "locale.h", "math.h", "setjmp.h," + "float.h", "locale.h", "math.h", "setjmp.h,", "signal.h", "stdarg.h", "stddef.h", "stdio.h", "stdlib.h", "string.h", "time.h", "gc.h", "bios.h", "cerror.h", "disp.h", "dos.h", From 0c861c48e2e0b1dc05d015176a0257613573b02b Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Thu, 15 Dec 2016 18:19:02 +0100 Subject: [PATCH 3/6] Allow relative paths as compiler path --- rdmd_test.d | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/rdmd_test.d b/rdmd_test.d index 33a0187a7b..13ca103b43 100644 --- a/rdmd_test.d +++ b/rdmd_test.d @@ -54,6 +54,13 @@ void main(string[] args) "concurrency", &concurrencyTest, ); + // if the compiler contains a dir separator, it's not the in the global PATH + // but a relative path + // an absolute path or executable in the PATH is required as the test suite + // used chdir + if (compiler.canFind(dirSeparator)) + compiler = compiler.asAbsolutePath.array; + enforce(rdmd.exists, "Path to rdmd does not exist: %s".format(rdmd)); rdmdApp = tempDir().buildPath("rdmd_app_") ~ binExt; @@ -347,15 +354,20 @@ void runTests() assert(res.status == 0, res.output); assert(!res.output.canFind("compile_force_src")); - auto fullCompilerPath = environment["PATH"] - .splitter(pathSeparator) - .map!(dir => dir.buildPath(compiler ~ binExt)) - .filter!exists - .front; + // for absolute compiler path, we make the path relative again + string fullCompilerPath = void; + if (compiler.isAbsolute) + fullCompilerPath = compiler.asRelativePath(getcwd()).array; + else + fullCompilerPath = environment["PATH"] + .splitter(pathSeparator) + .map!(dir => dir.buildPath(compiler ~ binExt)) + .filter!exists + .front; res = execute([rdmdApp, "--compiler=" ~ fullCompilerPath, forceSrc]); assert(res.status == 0, res.output ~ "\nCan't run with --compiler=" ~ fullCompilerPath); - assert(res.output.canFind("compile_force_src")); + assert(res.output.canFind("compile_force_src"), "Can't find compile_force_src"); // Create an empty temporary directory and clean it up when exiting scope static struct TmpDir From c71b17bc9c14a4bcaa34c857e95895ee12b090b7 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Thu, 15 Dec 2016 05:57:13 +0100 Subject: [PATCH 4/6] Use {dmd,druntime,phobos} Makefiles instead of digger --- travis.sh | 65 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 46 insertions(+), 19 deletions(-) diff --git a/travis.sh b/travis.sh index 90c577e121..46ec82a558 100755 --- a/travis.sh +++ b/travis.sh @@ -2,43 +2,70 @@ set -uexo pipefail -DIGGER_DIR="../digger" -DIGGER="../digger/digger" +TRAVIS_BRANCH=${TRAVIS_BRANCH:-master} +DMD="../dmd/src/dmd" +N=2 # set to 64-bit by default if [ -z ${MODEL:-} ] ; then MODEL=64 fi +clone() { + local url="$1" + local path="$2" + local branch="$3" + for i in {0..4}; do + if git clone --depth=1 --branch "$branch" "$url" "$path"; then + break + elif [ $i -lt 4 ]; then + sleep $((1 << $i)) + else + echo "Failed to clone: ${url}" + exit 1 + fi + done +} + test_rdmd() { # run rdmd internal tests - rdmd -m$MODEL -main -unittest rdmd.d + rdmd --compiler=$DMD -m$MODEL -main -unittest rdmd.d # compile rdmd & testsuite - dmd -m$MODEL rdmd.d - dmd -m$MODEL rdmd_test.d + $DMD -m$MODEL rdmd.d + $DMD -m$MODEL rdmd_test.d # run rdmd testsuite - ./rdmd_test + ./rdmd_test --compiler=$DMD } -build_digger() { - git clone --recursive https://github.com/CyberShadow/Digger "$DIGGER_DIR" - (cd "$DIGGER_DIR" && rdmd --build-only -debug digger) -} +setup_repos() +{ + for repo in dmd druntime phobos dlang.org ; do + if [ ! -d "../${repo}" ] ; then + if [ $TRAVIS_BRANCH != master ] && [ $TRAVIS_BRANCH != stable ] && + ! git ls-remote --exit-code --heads https://github.com/dlang/$proj.git $TRAVIS_BRANCH > /dev/null; then + # use master as fallback for other repos to test feature branches + clone https://github.com/dlang/${repo}.git ../${repo} master + else + clone https://github.com/dlang/${repo}.git ../${repo} $TRAVIS_BRANCH + fi + fi + done -install_digger() { - $DIGGER build --model=$MODEL "master" - export PATH=$PWD/result/bin:$PATH + make -j$N -C ../dmd/src -f posix.mak MODEL=$MODEL HOST_DMD=dmd all + make -j$N -C ../druntime -f posix.mak MODEL=$MODEL HOST_DMD=$DMD + make -j$N -C ../phobos -f posix.mak MODEL=$MODEL HOST_DMD=$DMD } -if ! [ -d "$DIGGER_DIR" ] ; then - build_digger -fi - -install_digger +setup_repos -dmd --version +$DMD --version rdmd --help | head -n 1 +dub --version + +# all dependencies installed - run tests now +# TODO: fix changed +make -f posix.mak catdoc ddemangle detab dget dman dustmite tolf test_rdmd From 05d6dd793c5ee1ad03bf6569d61f7ca7a53001a7 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Thu, 15 Jun 2017 11:17:35 +0200 Subject: [PATCH 5/6] Exclude linking curl --- posix.mak | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/posix.mak b/posix.mak index 314d8b5aaa..521e693d41 100644 --- a/posix.mak +++ b/posix.mak @@ -61,13 +61,7 @@ $(ROOT)/dustmite: DustMite/dustmite.d DustMite/splitter.d $(DMD) $(MODEL_FLAG) $(DFLAGS) DustMite/dustmite.d DustMite/splitter.d -of$(@) #dreadful custom step because of libcurl dmd linking problem (Bugzilla 7044) -$(CURL_TOOLS): $(ROOT)/%: %.d - $(DMD) $(MODEL_FLAG) $(DFLAGS) -c -of$(@).o $(<) -# grep for the linker invocation and append -lcurl - LINKCMD=$$($(DMD) $(MODEL_FLAG) $(DFLAGS) -v -of$(@) $(@).o 2>/dev/null | grep $(@).o); \ - $${LINKCMD} -lcurl - -$(TOOLS) $(DOC_TOOLS): $(ROOT)/%: %.d +$(TOOLS) $(DOC_TOOLS) $(CURL_TOOLS): $(ROOT)/%: %.d $(DMD) $(MODEL_FLAG) $(DFLAGS) -of$(@) $(<) ALL_OF_PHOBOS_DRUNTIME_AND_DLANG_ORG = # ??? From 6461a2758f6573511dbb42187591031314f7b046 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Thu, 15 Jun 2017 11:18:35 +0200 Subject: [PATCH 6/6] add installer to the repo list --- travis.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis.sh b/travis.sh index 46ec82a558..70b2b5edab 100755 --- a/travis.sh +++ b/travis.sh @@ -41,7 +41,7 @@ test_rdmd() { setup_repos() { - for repo in dmd druntime phobos dlang.org ; do + for repo in dmd druntime phobos dlang.org installer ; do if [ ! -d "../${repo}" ] ; then if [ $TRAVIS_BRANCH != master ] && [ $TRAVIS_BRANCH != stable ] && ! git ls-remote --exit-code --heads https://github.com/dlang/$proj.git $TRAVIS_BRANCH > /dev/null; then