ldc-developers / ldc2.snap

Snap package definition for LDC, the LLVM-based D compiler
11 stars 4 forks source link

Work around Azure Piplines build problems by chown'ing root directory #90

Closed WebDrake closed 4 years ago

WebDrake commented 4 years ago

Using chown to set root as the owner of / was suggested on the snapcraft forums, and appears to work for others: https://forum.snapcraft.io/t/permissions-problem-using-snapcraft-in-azure-pipelines/13258/14

WebDrake commented 4 years ago

It may also be necessary to install either multipass or lxd. However, let's see if the current patch works already.

WebDrake commented 4 years ago

It seems like the patch fixes build errors per se, but exposes some testsuite problems: https://dev.azure.com/ldc-developers/e8373dcc-baf1-4de3-96d6-27efe4141dc5/_apis/build/builds/1230/logs/6

2020-02-18T23:28:42.6375477Z The following tests FAILED:
2020-02-18T23:28:42.6375718Z    3240 - dmd-testsuite-debug (Failed)
2020-02-18T23:28:42.6376029Z    3242 - dmd-testsuite (Failed)
2020-02-18T23:28:42.6376340Z    3244 - dmd-testsuite-debug_32 (Failed)
2020-02-18T23:28:42.6376662Z    3246 - dmd-testsuite_32 (Failed)

@kinke any idea what's going on here? It looks like it's the same test failing in each case:

2020-02-18T23:28:42.4629480Z Test compilable/ddocYear.d failed.  The logged output:
2020-02-18T23:28:42.4629874Z Executing post-test script: tools/postscript.sh compilable/extra-files/ddocYear-postscript.sh compilable ddocYear ../../../../build/dmd-testsuite_32/fa05101184acdad0d400b58f8816599bbd4ddb3f5f24d07e3000eee211ee12
2020-02-18T23:28:42.4630382Z + source compilable/extra-files/ddocYear-postscript.sh
2020-02-18T23:28:42.4630555Z +++ date +%Y
2020-02-18T23:28:42.4630693Z ++ YEAR=2020
2020-02-18T23:28:42.4631008Z ++ sed s/__YEAR__/2020/ compilable/extra-files/ddocYear.html
2020-02-18T23:28:42.4631493Z ++ grep -v 'Generated by Ddoc from' ../../../../build/dmd-testsuite_32/compilable/ddocYear.html
2020-02-18T23:28:42.4631941Z ++ diff -pu --strip-trailing-cr ../../../../build/dmd-testsuite_32/compilable/ddocYear.html.1 ../../../../build/dmd-testsuite_32/compilable/ddocYear.html.2
2020-02-18T23:28:42.4632333Z --- ../../../../build/dmd-testsuite_32/compilable/ddocYear.html.1  2020-02-18 23:27:35.430719743 +0000
2020-02-18T23:28:42.4632737Z +++ ../../../../build/dmd-testsuite_32/compilable/ddocYear.html.2  2020-02-18 23:27:35.434719742 +0000
2020-02-18T23:28:42.4633057Z @@ -537,7 +537,7 @@
2020-02-18T23:28:42.4633231Z    <section class="section ddoc_sections">
2020-02-18T23:28:42.4633365Z    <div class="ddoc_summary">
2020-02-18T23:28:42.4633502Z    <p class="para">
2020-02-18T23:28:42.4633773Z -    2019
2020-02-18T23:28:42.4633922Z +    2020
2020-02-18T23:28:42.4634017Z    </p>
2020-02-18T23:28:42.4634128Z  </div>
2020-02-18T23:28:42.4634240Z  
2020-02-18T23:28:42.4634722Z /home/vsts/work/1/s/parts/ldc/build/bin/ldmd2 -conf= -m32 -Icompilable -D -Dd../../../../build/dmd-testsuite_32/compilable -o- -O  -od../../../../build/dmd-testsuite_32/compilable -of../../../../build/dmd-testsuite_32/compilable/ddocYear_0.o  -c compilable/ddocYear.d 
2020-02-18T23:28:42.4635026Z 
2020-02-18T23:28:42.4635101Z 
2020-02-18T23:28:42.4635213Z ==============================
2020-02-18T23:28:42.4635356Z Test compilable/ddocYear.d failed: expected rc == 0, exited with rc == 1
2020-02-18T23:28:42.4635469Z 
2020-02-18T23:28:42.4635816Z Makefile:369: recipe for target '../../../../build/dmd-testsuite_32/compilable/ddocYear.d.out' failed
2020-02-18T23:28:42.4636208Z make[1]: *** [../../../../build/dmd-testsuite_32/compilable/ddocYear.d.out] Error 1
kinke commented 4 years ago

The expected 'hardcoded' year (2019; in tests/d2/dmd-testsuite/compilable/extra-files/ddocYear.html) is wrong by now. It's a pretty lame test (to be fixed upstream).

WebDrake commented 4 years ago

Ouch! That's a bit of a scary test case if it requires manual update each year ... :-\

Any preferences/thoughts on the best way to handle this?

WebDrake commented 4 years ago

I can look into dropping that one test case in the ctest invocation, but I'd rather not if it can be avoided.

kinke commented 4 years ago

Any preferences/thoughts on the best way to handle this?

https://github.com/dlang/dmd/pull/10802. This has already regressed multiple times apparently.

kinke commented 4 years ago

I can look into dropping that one test case in the ctest invocation

Not possible; this is one of many tests run as part of a single dmd-testsuite CTest test. You'll either need to remove .../compilable/ddocYear.d or fix up the .html before running the tests.

WebDrake commented 4 years ago

Updated with a horrible workaround:

diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
index a040690..3dcb9e1 100644
--- a/snap/snapcraft.yaml
+++ b/snap/snapcraft.yaml
@@ -45,6 +45,9 @@ parts:
         -GNinja
       ninja -v
       DESTDIR=../install ninja -v install
+      # Work around horrible DMD testsuite bug
+      sed -i 's/    2019/    __YEAR__/g' \
+          ../src/tests/d2/dmd-testsuite/compilable/extra-files/ddocYear.html
       ctest --output-on-failure --verbose -E "std\.net\.curl|std\.process|lit-tests"
     stage:
     - -etc/ldc2.conf