diff options
author | Geod24 <pro.mathias.lang@gmail.com> | 2019-08-19 03:17:35 +0900 |
---|---|---|
committer | Rasmus Thomsen <oss@cogitri.dev> | 2019-10-28 22:14:00 +0100 |
commit | 52c2e43cf53b2c085c27368d755c48d050b3b442 (patch) | |
tree | c3f27a7afc5028c372e7543b94f7fc9a5c577f34 | |
parent | 94995d82ea3c632196debddfa5935b2933abcef5 (diff) | |
download | aports-52c2e43cf53b2c085c27368d755c48d050b3b442.tar.bz2 aports-52c2e43cf53b2c085c27368d755c48d050b3b442.tar.xz |
testing/ldc: upgrade to 1.18.0
This replaces the bootstrapping (and outdated) LDC 1.8.0 package
with a build from source.
-rw-r--r-- | testing/ldc/01-stdio-fseek.patch | 37 | ||||
-rw-r--r-- | testing/ldc/02-conf.patch | 33 | ||||
-rw-r--r-- | testing/ldc/APKBUILD | 100 | ||||
-rw-r--r-- | testing/ldc/ldc2.package.conf | 24 |
4 files changed, 111 insertions, 83 deletions
diff --git a/testing/ldc/01-stdio-fseek.patch b/testing/ldc/01-stdio-fseek.patch new file mode 100644 index 0000000000..7736def277 --- /dev/null +++ b/testing/ldc/01-stdio-fseek.patch @@ -0,0 +1,37 @@ +--- a/runtime/phobos/std/stdio.d 2019-10-25 12:00:00.000000000 +0900 ++++ b/runtime/phobos/std/stdio.d 2019-10-25 12:42:42.000000000 +0900 +@@ -1098,6 +1098,14 @@ Throws: `Exception` if the file is not o + import std.conv : to, text; + import std.exception : enforce, errnoEnforce; + ++ // Some libc sanitize the whence input (e.g. glibc), but some don't, ++ // e.g. Microsoft runtime crashes on an invalid origin, ++ // and Musl additionally accept SEEK_DATA & SEEK_HOLE (Linux extension). ++ // To provide a consistent behavior cross platform, we use the glibc check ++ // See also https://issues.dlang.org/show_bug.cgi?id=19797 ++ enforce(origin == SEEK_SET || origin == SEEK_CUR || origin == SEEK_END, ++ "Invalid `origin` argument passed to `seek`, must be one of: SEEK_SET, SEEK_CUR, SEEK_END"); ++ + enforce(isOpen, "Attempting to seek() in an unopened file"); + version (Windows) + { +@@ -1105,9 +1113,6 @@ Throws: `Exception` if the file is not o + { + alias fseekFun = _fseeki64; + alias off_t = long; +- // Issue 19797 +- enforce(origin >= SEEK_SET && origin <= SEEK_END, +- "Could not seek in file `"~_name~"' (Invalid argument)"); + } + else + { +@@ -1151,7 +1156,8 @@ Throws: `Exception` if the file is not o + // f.rawWrite("abcdefghijklmnopqrstuvwxyz"); + // f.seek(-3, SEEK_END); + // assert(f.readln() == "xyz"); +- assertThrown(f.seek(0, 3)); ++ ++ assertThrown(f.seek(0, ushort.max)); + } + + /** diff --git a/testing/ldc/02-conf.patch b/testing/ldc/02-conf.patch new file mode 100644 index 0000000000..ad01f92d58 --- /dev/null +++ b/testing/ldc/02-conf.patch @@ -0,0 +1,33 @@ +diff -urp a/ldc2.conf.in b/ldc2.conf.in +--- a/ldc2.conf.in 2019-10-16 20:53:09.000000000 +0000 ++++ b/ldc2.conf.in 2019-10-26 06:43:17.000000000 +0000 +@@ -18,6 +18,7 @@ default: + { + // default switches injected before all explicit command-line switches + switches = [ ++ "-linker=bfd", + "-defaultlib=druntime-ldc",@ADDITIONAL_DEFAULT_LDC_SWITCHES@ + ]; + // default switches appended after all explicit command-line switches +diff -urp a/ldc2_install.conf.in b/ldc2_install.conf.in +--- a/ldc2_install.conf.in 2019-10-16 20:53:09.000000000 +0000 ++++ b/ldc2_install.conf.in 2019-10-26 06:43:54.000000000 +0000 +@@ -18,6 +18,7 @@ default: + { + // default switches injected before all explicit command-line switches + switches = [ ++ "-linker=bfd", + "-defaultlib=phobos2-ldc,druntime-ldc",@ADDITIONAL_DEFAULT_LDC_SWITCHES@ + ]; + // default switches appended after all explicit command-line switches +diff -urp a/ldc2_phobos.conf.in b/ldc2_phobos.conf.in +--- a/ldc2_phobos.conf.in 2019-10-16 20:53:09.000000000 +0000 ++++ b/ldc2_phobos.conf.in 2019-10-26 06:51:09.000000000 +0000 +@@ -18,6 +18,7 @@ default: + { + // default switches injected before all explicit command-line switches + switches = [ ++ "-linker=bfd", + "-defaultlib=phobos2-ldc,druntime-ldc",@ADDITIONAL_DEFAULT_LDC_SWITCHES@ + ]; + // default switches appended after all explicit command-line switches diff --git a/testing/ldc/APKBUILD b/testing/ldc/APKBUILD index 71e5ed553a..b9a8f7e8be 100644 --- a/testing/ldc/APKBUILD +++ b/testing/ldc/APKBUILD @@ -1,7 +1,7 @@ # Contributor: Mathias LANG <pro.mathias.lang@gmail.com> # Maintainer: Mathias LANG <pro.mathias.lang@gmail.com> pkgname=ldc -pkgver=1.8.0 +pkgver=1.18.0 pkgrel=0 pkgdesc="The LLVM-based D Compiler" url="https://github.com/ldc-developers/ldc" @@ -10,73 +10,55 @@ url="https://github.com/ldc-developers/ldc" # Once we can use GDC for bootstrapping, this can be "all" arch="x86_64" license="BSD-3-Clause AND BSL-1.0 AND (Artistic-1.0 OR GPL-2.0-or-later) AND NCSA AND MIT" -depends="libexecinfo" -makedepends="chrpath cmake llvm5-libs libexecinfo-static" +depends="libexecinfo tzdata" +makedepends="bash chrpath cmake curl-dev diffutils dlang-compiler gdb grep llvm9-dev llvm9-static libedit-dev libexecinfo-static py-pip zlib-dev" # A user might want to install the '-runtime' subpackage when they have # a dynamically-linked D program. -subpackages="$pkgname-runtime $pkgname-doc $pkgname-static" +subpackages="$pkgname-runtime $pkgname-static" provides="dlang-compiler" -source="https://github.com/ldc-developers/ldc/releases/download/v$pkgver/ldc2-$pkgver-alpine-linux-x86_64.tar.xz - ldc2.package.conf" -builddir="$srcdir/" +source="https://github.com/ldc-developers/ldc/releases/download/v$pkgver/ldc-$pkgver-src.tar.gz + 01-stdio-fseek.patch + 02-conf.patch" +builddir="$srcdir/ldc-$pkgver-src/" build() { - rootdir="$srcdir/ldc2-$pkgver-alpine-linux-x86_64/" - - # Unfortunately the upstream-provided version has the builder's /home/ in its rpath - strip it - chrpath -d "$rootdir/bin/ldc2" - chrpath -d "$rootdir/bin/ldmd2" - # This exe is not installed, just used in build, but do it for completeness - chrpath -d "$rootdir/bin/ldc-build-runtime" - - # Now build the runtime - the compiler itself is already built by upstream - "$rootdir"/bin/ldc-build-runtime --buildDir="$builddir/ldc-runtime-build/" + if [ "$CBUILD" != "$CHOST" ]; then + CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux" + fi + cmake \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DBUILD_SHARED_LIBS=True \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_FLAGS="$CXXFLAGS" \ + -DCMAKE_C_FLAGS="$CFLAGS" \ + $CMAKE_CROSSOPTS "$builddir" + make # CMake added the rpaths to the shared libs - strip them - chrpath -d "$builddir"/ldc-runtime-build/lib/*.so + chrpath -d "$builddir"/lib/*.so* : } check() { - rootdir="$srcdir/ldc2-$pkgver-alpine-linux-x86_64/" - libroot="$builddir/ldc-runtime-build/lib/" - - echo 'import std.stdio; void main () { try throw new Exception(null); catch (Exception) writeln("Hello World!"); }' > hello_world.d - if [ "$($rootdir/bin/ldmd2 -conf='' -I$rootdir/import/ldc -I$rootdir/import/ -L-L$libroot -defaultlib=phobos2-ldc,druntime-ldc -L-lexecinfo -L-rpath=$libroot -run hello_world.d)" != "Hello World!" ]; then - return 1 - fi - : + # Dependency to lit-test + python -m pip install --user lit + + # Note: The testsuite does not parallelize well, as the `clean` target get run in parallel. + # Hence `-j${JOBS}` was left out on purpose + # + # - dmd-testsuite takes too long to run and has more to do with language checks + # which are less relevant to us than platform integration tests + # - lit-test disabled because 'TEST 'LDC :: debuginfo/print_gdb.d' FAILED' + # Something to do with TLS variables not being printable in GDB + # - 'druntime-test-shared' fails, probably because it is using `Object.factory` + # - 'druntime-test-stdcpp' fails for an unknown reason and is temporarily disabled + # - 'druntime-test-exceptions' fails for an unknown reason and is temporarily disabled + ctest --output-on-failure -E "dmd-testsuite|lit-tests|druntime-test-exceptions|druntime-test-shared|druntime-test-stdcpp" } package() { - depends="$pkgname-runtime $pkgname-static" - rootdir="$srcdir/ldc2-$pkgver-alpine-linux-x86_64/" - - install -s -D "$rootdir/bin/ldc2" "$pkgdir/usr/bin/ldc2" - install -s -D "$rootdir/bin/ldmd2" "$pkgdir/usr/bin/ldmd2" - - install -D "$srcdir/ldc2.package.conf" "$pkgdir/etc/ldc2.conf" - - install -D "$rootdir/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" - - # Install the import files - for impfile in $(find "$rootdir/import" -name "*.d*"); - do - target="${impfile##*import/}" - install -D "$impfile" "$pkgdir/usr/include/dlang/$pkgname-$pkgver/$target" - done - - # Install the static runtime libraries - for libn in "libdruntime-ldc" "libdruntime-ldc-debug" "libphobos2-ldc" "libphobos2-ldc-debug"; - do - install -D "$builddir/ldc-runtime-build/lib/$libn.a" "$pkgdir/usr/lib/$libn.a" - done - - # Install the shared runtime libraries - for libn in "libdruntime" "libphobos2"; - do - install -D "$builddir/ldc-runtime-build/lib/$libn-ldc-shared.so.2.0.78" "$pkgdir/usr/lib/$libn-ldc-shared.so.2.0.78" - done + make DESTDIR="$pkgdir" install } runtime() { @@ -86,10 +68,9 @@ runtime() { mkdir -p "$subpkgdir/usr/lib/" for libn in "libdruntime" "libphobos2"; do - mv "$pkgdir/usr/lib/$libn-ldc-shared.so.2.0.78" "$subpkgdir/usr/lib/$libn-ldc-shared.so.2.0.78" - ln -s "$libn-ldc-shared.so.2.0.78" "$pkgdir/usr/lib/$libn-ldc-shared.so.78" - ln -s "$libn-ldc-shared.so.2.0.78" "$pkgdir/usr/lib/$libn-ldc-shared.so" + mv "$pkgdir"/usr/lib/$libn-ldc-shared.so* "$subpkgdir/usr/lib/" done + mv "$pkgdir"/usr/lib/libldc-jit.so* "$subpkgdir/usr/lib" mv "$pkgdir"/usr/lib/*.so* "$subpkgdir/usr/lib/" : @@ -103,5 +84,6 @@ static() { mv "$pkgdir"/usr/lib/*.a "$subpkgdir/usr/lib/" } -sha512sums="3a870c9e7e9500d4e2a47e53d10cb10641319223200e3730abf9b6debf1c261cef11bac0b797ee2aa66c63c950461326273e0c14685b6d641155de307997e1af ldc2-1.8.0-alpine-linux-x86_64.tar.xz -0fd1613ffdd52db1f486ad15bc5f2df2f2f1b94bddf12d67a38897f73cd83d5d222bb184dd88df1058be9f9d31fdb6c8d6850d6ce672d25e4a0cbbf579d248a1 ldc2.package.conf" +sha512sums="fe7529c33d0e43dfb71f474dfa381b88ee476b70933c8f80fc063d9a015df24a75e2b607a7242cc4b9cd4b6ac7559aec8f2883016bf7252342742322fcccbd4d ldc-1.18.0-src.tar.gz +20d6bb560867052edeed6005e15473dae25c62002c7bd47f0e37610ffd5e94a50b49244c2a9b814f4858babca403f120ae6028cd86f964dd4734736eda068536 01-stdio-fseek.patch +eb86e4be0ecf72aaabbd5608c8056bb9cede035895e766330b6d14f14c06dc513fcecc1b6e56ab6fc9fc26c220a689cc8b1394a30a319189c414f1e067c1d983 02-conf.patch" diff --git a/testing/ldc/ldc2.package.conf b/testing/ldc/ldc2.package.conf deleted file mode 100644 index b7eb7febf1..0000000000 --- a/testing/ldc/ldc2.package.conf +++ /dev/null @@ -1,24 +0,0 @@ -// See comments in driver/config.d in ldc source tree for grammar description of -// this config file. - -// The default group is required -default: -{ - // default switches injected before all explicit command-line switches - switches = [ - // ldc2 is installed in $pkgdir/usr/bin/ldc2 - // Imports are in $pkgdir/usr/include/dlang/ldc-1.8.0/ - "-I%%ldcbinarypath%%/../include/dlang/ldc-1.8.0/ldc/", - "-I%%ldcbinarypath%%/../include/dlang/ldc-1.8.0/", - "-defaultlib=phobos2-ldc,druntime-ldc" - ]; - // default switches appended after all explicit command-line switches - post-switches = [ - // libs are installed to $pkgdir/usr/lib/ - // `libexecinfo` includes `backtrace`, which is used by druntime, - // and is part of glibc - "-L-L%%ldcbinarypath%%/../lib", - "-L--no-warn-search-mismatch", - "-L-lexecinfo" - ]; -}; |