From d49e2c82001c19a459828bac12d663b23e183147 Mon Sep 17 00:00:00 2001 From: Emmanuel Promayon Date: Tue, 29 Jan 2019 21:33:32 +0100 Subject: [PATCH 1/9] FIXED tentative to fix gitlab "bug fix" bug --- .gitlab/configure.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab/configure.sh b/.gitlab/configure.sh index ca30bca4..34a205c8 100755 --- a/.gitlab/configure.sh +++ b/.gitlab/configure.sh @@ -3,6 +3,8 @@ #set -x echo "Job $CI_JOB_NAME" +echo "PROJECT_SOURCE_DIR=$PROJECT_SOURCE_DIR" +echo "CI_PROJECT_DIR=$CI_PROJECT_DIR" if ! grep -q TRIGGER_STAGE_CONFIGURE "${PROJECT_LOG_DIR}/trigger-stage.txt"; then echo "Job skipped as /configure flag not in commit message and CAMITK_CI_STAGE < $STAGE_CONFIGURE"; @@ -31,7 +33,7 @@ fi echo "===== Running configure stage =====" if [ "$OS" == "win7" ]; then - # there is no xvfb on windows + # there is no xvfb on windows and gitlab-runner 11.7 requires windows path ctest -VV \ -DCTEST_SITE="$CDASH_SITE" \ -DCI_MODE="$CAMITK_CI_MODE" \ @@ -40,7 +42,7 @@ if [ "$OS" == "win7" ]; then -DCI_BUILD_SETTINGS="$COMPILER_CONFIG" \ -DCTEST_SOURCE_DIRECTORY="$PROJECT_SOURCE_DIR" \ -DCTEST_BINARY_DIRECTORY="$PROJECT_BUILD_DIR" \ - -S $PROJECT_SOURCE_DIR/sdk/cmake/ctest/ci-configure.cmake > >(tee ${PROJECT_LOG_DIR}/configure.log) 2>&1 + -S $PROJECT_SOURCE_DIR\sdk\cmake\ctest\ci-configure.cmake > >(tee ${PROJECT_LOG_DIR}/configure.log) 2>&1 else ctest -VV \ -DCTEST_SITE="$CDASH_SITE" \ -- GitLab From feaf0daca6c76bd19f57d7b4fac11d45f0ff6cb4 Mon Sep 17 00:00:00 2001 From: Emmanuel Promayon Date: Tue, 29 Jan 2019 21:35:17 +0100 Subject: [PATCH 2/9] FIXED seels a good track --- .gitlab/configure.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/configure.sh b/.gitlab/configure.sh index 34a205c8..9b6c7ee5 100755 --- a/.gitlab/configure.sh +++ b/.gitlab/configure.sh @@ -42,7 +42,7 @@ if [ "$OS" == "win7" ]; then -DCI_BUILD_SETTINGS="$COMPILER_CONFIG" \ -DCTEST_SOURCE_DIRECTORY="$PROJECT_SOURCE_DIR" \ -DCTEST_BINARY_DIRECTORY="$PROJECT_BUILD_DIR" \ - -S $PROJECT_SOURCE_DIR\sdk\cmake\ctest\ci-configure.cmake > >(tee ${PROJECT_LOG_DIR}/configure.log) 2>&1 + -S $PROJECT_SOURCE_DIR\\sdk\\cmake\\ctest\\ci-configure.cmake > >(tee ${PROJECT_LOG_DIR}/configure.log) 2>&1 else ctest -VV \ -DCTEST_SITE="$CDASH_SITE" \ -- GitLab From 2b53e0633d921b184f3f17f7d3a01e76c077e82c Mon Sep 17 00:00:00 2001 From: Emmanuel Promayon Date: Tue, 29 Jan 2019 21:41:20 +0100 Subject: [PATCH 3/9] FIXED another tentative (escaping the path) --- .gitlab/configure.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/configure.sh b/.gitlab/configure.sh index 9b6c7ee5..cc8f8315 100755 --- a/.gitlab/configure.sh +++ b/.gitlab/configure.sh @@ -42,7 +42,7 @@ if [ "$OS" == "win7" ]; then -DCI_BUILD_SETTINGS="$COMPILER_CONFIG" \ -DCTEST_SOURCE_DIRECTORY="$PROJECT_SOURCE_DIR" \ -DCTEST_BINARY_DIRECTORY="$PROJECT_BUILD_DIR" \ - -S $PROJECT_SOURCE_DIR\\sdk\\cmake\\ctest\\ci-configure.cmake > >(tee ${PROJECT_LOG_DIR}/configure.log) 2>&1 + -S "$PROJECT_SOURCE_DIR/sdk/cmake/ctest/ci-configure.cmake" > >(tee ${PROJECT_LOG_DIR}/configure.log) 2>&1 else ctest -VV \ -DCTEST_SITE="$CDASH_SITE" \ -- GitLab From 7dacc5428c9ce4805046209c97abfd15d02f7379 Mon Sep 17 00:00:00 2001 From: Emmanuel Promayon Date: Wed, 30 Jan 2019 07:21:26 +0100 Subject: [PATCH 4/9] Testing environment and forcing forward slash path --- .gitlab/configure.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab/configure.sh b/.gitlab/configure.sh index cc8f8315..ff153f22 100755 --- a/.gitlab/configure.sh +++ b/.gitlab/configure.sh @@ -34,6 +34,9 @@ echo "===== Running configure stage =====" if [ "$OS" == "win7" ]; then # there is no xvfb on windows and gitlab-runner 11.7 requires windows path + pwd + echo $0 + PROJECT_SOURCE_DIR=/c/dev/gitlab-runner/builds/f7180be6/0/CamiTK/CamiTK ctest -VV \ -DCTEST_SITE="$CDASH_SITE" \ -DCI_MODE="$CAMITK_CI_MODE" \ -- GitLab From 387a86e804a4dc458b236d8b61c942cba271b357 Mon Sep 17 00:00:00 2001 From: Emmanuel Promayon Date: Wed, 30 Jan 2019 08:59:58 +0100 Subject: [PATCH 5/9] FIXED replace backslash by forward slash gitlab-runner 11.7 fixes a bug on windows. From now on, CI_PROJECT_DIR uses \ (backslash) instead of / (forward slash) Even if displayed otherwise when printing the bash environment, CI_PROJECT_DIR (and therefore our custom PROJECT_SOURCE_DIR, variable, which is created in .gitlab-ci.yml from CI_PROJECT_DIR) contains backslash. When used from inside a bash shell (such as configure.sh), this confuses ctest. Backslashes have to be replaced by forward slashes. --- .gitlab/configure.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab/configure.sh b/.gitlab/configure.sh index ff153f22..6cc648cc 100755 --- a/.gitlab/configure.sh +++ b/.gitlab/configure.sh @@ -31,12 +31,14 @@ if [[ "$OS" != "win7" ]]; then fi echo "===== Running configure stage =====" +echo "Running from " $(ps $PPID | tail -n 1 ) if [ "$OS" == "win7" ]; then # there is no xvfb on windows and gitlab-runner 11.7 requires windows path pwd echo $0 - PROJECT_SOURCE_DIR=/c/dev/gitlab-runner/builds/f7180be6/0/CamiTK/CamiTK + # replace all backslash to forward slash (gitlab-runner 11.7 "fixes" a bug → on windows all path variables use backward slash instead of forward slash in previous version) + PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR//\\//} ctest -VV \ -DCTEST_SITE="$CDASH_SITE" \ -DCI_MODE="$CAMITK_CI_MODE" \ -- GitLab From 4614d52dba4f960d1c9b1dd4ae1e6630adfadf24 Mon Sep 17 00:00:00 2001 From: Emmanuel Promayon Date: Wed, 30 Jan 2019 09:28:19 +0100 Subject: [PATCH 6/9] FIXED for all script --- .gitlab/before.sh | 7 +++++++ .gitlab/configure.sh | 8 +------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.gitlab/before.sh b/.gitlab/before.sh index 1da1730e..2ad03eb6 100755 --- a/.gitlab/before.sh +++ b/.gitlab/before.sh @@ -63,9 +63,16 @@ else fi QT_VERSION=$(qmake --version | grep Qt | cut -f4 -d" " ) +# Path needs to use forward slashes +# This is ok on Linux but since gitlab-runner 11.7 on windows all path variables use backward slash instead of forward slash +# → Replace all backslash to forward slash +PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR//\\//} + # output all information to report file echo "Docker container id....... $CONTAINER_ID" > /tmp/report.txt echo "Job....................... $CI_JOB_NAME" >> /tmp/report.txt +echo "PROJECT_SOURCE_DIR........ $PROJECT_SOURCE_DIR" >> /tmp/report.txt +echo "CI_PROJECT_DIR............ $CI_PROJECT_DIR" >> /tmp/report.txt echo "Build Directory........... $PROJECT_BUILD_DIR" >> /tmp/report.txt echo "Log Directory............. $PROJECT_LOG_DIR" >> /tmp/report.txt echo "Branch.................... $CI_COMMIT_REF_NAME" >> /tmp/report.txt diff --git a/.gitlab/configure.sh b/.gitlab/configure.sh index 6cc648cc..38805150 100755 --- a/.gitlab/configure.sh +++ b/.gitlab/configure.sh @@ -31,14 +31,8 @@ if [[ "$OS" != "win7" ]]; then fi echo "===== Running configure stage =====" -echo "Running from " $(ps $PPID | tail -n 1 ) - +# there is no xvfb on windows if [ "$OS" == "win7" ]; then - # there is no xvfb on windows and gitlab-runner 11.7 requires windows path - pwd - echo $0 - # replace all backslash to forward slash (gitlab-runner 11.7 "fixes" a bug → on windows all path variables use backward slash instead of forward slash in previous version) - PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR//\\//} ctest -VV \ -DCTEST_SITE="$CDASH_SITE" \ -DCI_MODE="$CAMITK_CI_MODE" \ -- GitLab From 4ddd56551fca079c1640d52073df3a43d4ad43d9 Mon Sep 17 00:00:00 2001 From: Emmanuel Promayon Date: Wed, 30 Jan 2019 09:40:18 +0100 Subject: [PATCH 7/9] FIXED PROJECT_SOURCE_DIR should be exported So that it is exported to next bash script --- .gitlab/before.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/before.sh b/.gitlab/before.sh index 2ad03eb6..37c7ddb0 100755 --- a/.gitlab/before.sh +++ b/.gitlab/before.sh @@ -66,7 +66,7 @@ QT_VERSION=$(qmake --version | grep Qt | cut -f4 -d" " ) # Path needs to use forward slashes # This is ok on Linux but since gitlab-runner 11.7 on windows all path variables use backward slash instead of forward slash # → Replace all backslash to forward slash -PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR//\\//} +export PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR//\\//} # output all information to report file echo "Docker container id....... $CONTAINER_ID" > /tmp/report.txt -- GitLab From 078cb47d223c32155d479495a2c1c08f901f18c9 Mon Sep 17 00:00:00 2001 From: Emmanuel Promayon Date: Wed, 30 Jan 2019 10:06:56 +0100 Subject: [PATCH 8/9] FIXED transform backslash to slash in all scripts --- .gitlab/before.sh | 6 ------ .gitlab/check.sh | 6 ++++++ .gitlab/configure.sh | 6 +++++- .gitlab/coverage.sh | 6 ++++++ .gitlab/test.sh | 6 ++++++ 5 files changed, 23 insertions(+), 7 deletions(-) diff --git a/.gitlab/before.sh b/.gitlab/before.sh index 37c7ddb0..58d24968 100755 --- a/.gitlab/before.sh +++ b/.gitlab/before.sh @@ -1,6 +1,5 @@ #!/bin/bash - if [ "$OS" == "win7" ]; then # there is no docker on windows CONTAINER_ID=0 @@ -63,11 +62,6 @@ else fi QT_VERSION=$(qmake --version | grep Qt | cut -f4 -d" " ) -# Path needs to use forward slashes -# This is ok on Linux but since gitlab-runner 11.7 on windows all path variables use backward slash instead of forward slash -# → Replace all backslash to forward slash -export PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR//\\//} - # output all information to report file echo "Docker container id....... $CONTAINER_ID" > /tmp/report.txt echo "Job....................... $CI_JOB_NAME" >> /tmp/report.txt diff --git a/.gitlab/check.sh b/.gitlab/check.sh index c8fbbd74..a85cd757 100755 --- a/.gitlab/check.sh +++ b/.gitlab/check.sh @@ -1,6 +1,12 @@ #!/bin/bash +# Path needs to use forward slashes +# This is ok on Linux but since gitlab-runner 11.7 on windows all path variables use backward slash instead of forward slash +# → Replace all backslash to forward slash +export PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR//\\//} + echo "Job $CI_JOB_NAME" +echo "PROJECT_SOURCE_DIR=$PROJECT_SOURCE_DIR" if [ "$TRIGGER_STAGE_CHECK" == "false" ]; then echo "Job skipped as /check flag not in commit message and CAMITK_CI_STAGE < $STAGE_CHECK"; diff --git a/.gitlab/configure.sh b/.gitlab/configure.sh index 38805150..86f660d5 100755 --- a/.gitlab/configure.sh +++ b/.gitlab/configure.sh @@ -2,9 +2,13 @@ # Uncomment next line to print each bash command before it is executed #set -x +# Path needs to use forward slashes +# This is ok on Linux but since gitlab-runner 11.7 on windows all path variables use backward slash instead of forward slash +# → Replace all backslash to forward slash +export PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR//\\//} + echo "Job $CI_JOB_NAME" echo "PROJECT_SOURCE_DIR=$PROJECT_SOURCE_DIR" -echo "CI_PROJECT_DIR=$CI_PROJECT_DIR" if ! grep -q TRIGGER_STAGE_CONFIGURE "${PROJECT_LOG_DIR}/trigger-stage.txt"; then echo "Job skipped as /configure flag not in commit message and CAMITK_CI_STAGE < $STAGE_CONFIGURE"; diff --git a/.gitlab/coverage.sh b/.gitlab/coverage.sh index e5fb7afc..1467b32b 100755 --- a/.gitlab/coverage.sh +++ b/.gitlab/coverage.sh @@ -1,6 +1,12 @@ #!/bin/bash +# Path needs to use forward slashes +# This is ok on Linux but since gitlab-runner 11.7 on windows all path variables use backward slash instead of forward slash +# → Replace all backslash to forward slash +export PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR//\\//} + echo "Job $CI_JOB_NAME" +echo "PROJECT_SOURCE_DIR=$PROJECT_SOURCE_DIR" if ! grep -q TRIGGER_STAGE_COVERAGE "${PROJECT_LOG_DIR}/trigger-stage.txt"; then echo "Job skipped as /coverage flag not in commit message and CAMITK_CI_STAGE < $STAGE_CONFIGURE"; diff --git a/.gitlab/test.sh b/.gitlab/test.sh index 3b54141c..57082f12 100755 --- a/.gitlab/test.sh +++ b/.gitlab/test.sh @@ -2,7 +2,13 @@ # Uncomment next line to print each bash command before it is executed #set -x +# Path needs to use forward slashes +# This is ok on Linux but since gitlab-runner 11.7 on windows all path variables use backward slash instead of forward slash +# → Replace all backslash to forward slash +export PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR//\\//} + echo "Job $CI_JOB_NAME" +echo "PROJECT_SOURCE_DIR=$PROJECT_SOURCE_DIR" if ! grep -q TRIGGER_STAGE_TEST "${PROJECT_LOG_DIR}/trigger-stage.txt"; then echo "Job skipped as /test flag not in commit message and CAMITK_CI_STAGE < $STAGE_CONFIGURE"; -- GitLab From d50993e96c08703e2d8d966bf34dd80bb314481b Mon Sep 17 00:00:00 2001 From: Emmanuel Promayon Date: Wed, 30 Jan 2019 10:15:43 +0100 Subject: [PATCH 9/9] FIXED transform backslash to slash in ALL scripts --- .gitlab/build.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitlab/build.sh b/.gitlab/build.sh index 956c9fdb..99eec2b1 100755 --- a/.gitlab/build.sh +++ b/.gitlab/build.sh @@ -2,7 +2,13 @@ # Uncomment next line to print each bash command before it is executed #set -x +# Path needs to use forward slashes +# This is ok on Linux but since gitlab-runner 11.7 on windows all path variables use backward slash instead of forward slash +# → Replace all backslash to forward slash +export PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR//\\//} + echo "Job $CI_JOB_NAME" +echo "PROJECT_SOURCE_DIR=$PROJECT_SOURCE_DIR" if ! grep -q TRIGGER_STAGE_BUILD "${PROJECT_LOG_DIR}/trigger-stage.txt"; then echo "Job skipped as /build flag not in commit message and CAMITK_CI_STAGE < $STAGE_CONFIGURE"; -- GitLab