From aaa7206b868c873c87f04a8d73520c160b789ae8 Mon Sep 17 00:00:00 2001 From: Matias Piipari Date: Wed, 21 Dec 2022 12:57:19 +0200 Subject: [PATCH 01/13] Fix up the patches for 5.7.2 --- platforms/Linux/DEB/Shared/build_deb.sh | 4 +- platforms/Linux/DEB/Shared/versions.sh | 6 +- .../Linux/DEB/Ubuntu/focal/debian/changelog | 6 ++ .../Linux/DEB/Ubuntu/focal/debian/control.in | 60 +++++++++---------- .../debian/patches/build-preset-install-dir | 22 +++++-- .../focal/debian/patches/fix-toolchain-path | 20 +++---- platforms/Linux/DEB/Ubuntu/focal/debian/rules | 6 +- .../focal/debian/swiftlang-X.Y.Z.install.in | 1 - .../Ubuntu/focal/debian/swiftlang.install.in | 1 + .../Ubuntu/focal/debian/swiftlang.links.in | 9 +-- 10 files changed, 75 insertions(+), 60 deletions(-) delete mode 100644 platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang-X.Y.Z.install.in create mode 100644 platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.install.in diff --git a/platforms/Linux/DEB/Shared/build_deb.sh b/platforms/Linux/DEB/Shared/build_deb.sh index da865eed..697c0dfb 100755 --- a/platforms/Linux/DEB/Shared/build_deb.sh +++ b/platforms/Linux/DEB/Shared/build_deb.sh @@ -22,7 +22,7 @@ package_dir=${staging_dir}/swiftlang-${debversion} # clean rm -rf ${package_dir} && mkdir -p ${package_dir} -# copy control files to pakcage build directory +# copy control files to package build directory cp -r ${here}/debian ${package_dir}/ cp -r ${package_dir}/debian/control.in ${package_dir}/debian/control @@ -36,7 +36,7 @@ mk-build-deps --install ${package_dir}/debian/control.in --tool 'apt-get -y -o D # build the installable package # TODO: add signing key information cd ${package_dir} -DEB_BUILD_OPTIONS=parallel=64 debuild +DEB_BUILD_OPTIONS=parallel=64 DEB_LINTIAN=false debuild -sa -S # copy the final packages to /output cd ${staging_dir} diff --git a/platforms/Linux/DEB/Shared/versions.sh b/platforms/Linux/DEB/Shared/versions.sh index 89ea0aab..d7ebdf13 100644 --- a/platforms/Linux/DEB/Shared/versions.sh +++ b/platforms/Linux/DEB/Shared/versions.sh @@ -1,10 +1,10 @@ #!/bin/sh -debversion=5.7.1 +debversion=5.7.2 -swift_version=5.7.1-RELEASE +swift_version=5.7.2-RELEASE icu_version=65-1 -yams_version=4.0.2 +yams_version=5.0.1 swift_argument_parser_version=1.0.3 swift_crypto_version=1.1.5 ninja_version=1.10.2 diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/changelog b/platforms/Linux/DEB/Ubuntu/focal/debian/changelog index 8d5d499c..999aa418 100644 --- a/platforms/Linux/DEB/Ubuntu/focal/debian/changelog +++ b/platforms/Linux/DEB/Ubuntu/focal/debian/changelog @@ -1,3 +1,9 @@ +swiftlang (5.7.2-3) focal; urgency=medium + + * Debian packaging updated for Swift 5.7.2. + + -- Matias Piipari Tue, 6 Dec 2022 15:53:00 +0200 + swiftlang (5.6.0-1) focal; urgency=medium * Debian packaging introduction for Swift 5.6. diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/control.in b/platforms/Linux/DEB/Ubuntu/focal/debian/control.in index b791951f..cef080f7 100644 --- a/platforms/Linux/DEB/Ubuntu/focal/debian/control.in +++ b/platforms/Linux/DEB/Ubuntu/focal/debian/control.in @@ -3,45 +3,43 @@ Section: devel Priority: optional Maintainer: Swift Maintainers Build-Depends: debhelper-compat (= 12), devscripts, - clang, cmake, git, icu-devtools, ninja-build, pkg-config, - libcurl4-openssl-dev, libedit-dev, libicu-dev, libncurses5-dev, - libpython3-dev, libsqlite3-dev, libxml2-dev, - python, python-six, python2-dev, python3-six, python3-distutils, python3-psutil, - rsync, swig, systemtap-sdt-dev, tzdata, unzip, uuid-dev -Standards-Version: 4.4.1 + clang, cmake, git, icu-devtools, ninja-build, pkg-config, + libcurl4-openssl-dev, libedit-dev, libicu-dev, libncurses5-dev, + libpython3-dev, libsqlite3-dev, libxml2-dev, + python, python-six, python2-dev, python3-six, python3-distutils, python3-psutil, + rsync, swig, systemtap-sdt-dev, tzdata, unzip, uuid-dev +Standards-Version: 4.6.1 Homepage: https://www.swift.org Package: swiftlang Architecture: all Depends: swiftlang-x.y.z, ${misc:Depends} Description: Swift programming language - Swift is a general-purpose programming language built using - a modern approach to safety, performance, and software design - patterns. - . - The goal of the Swift project is to create the best available - language for uses ranging from systems programming, to mobile - and desktop apps, scaling up to cloud services. Most - importantly, Swift is designed to make writing and maintaining - correct programs easier for the developer. - . - This package contains the convenience symlinks for the latest - version of Swift. + Swift is a general-purpose programming language built using + a modern approach to safety, performance, and software design + patterns. + The goal of the Swift project is to create the best available + language for uses ranging from systems programming, to mobile + and desktop apps, scaling up to cloud services. Most + importantly, Swift is designed to make writing and maintaining + correct programs easier for the developer. + This package contains the convenience symlinks for the latest + version of Swift. Package: swiftlang-x.y.z Architecture: amd64 arm64 Depends: ${shlibs:Depends}, ${misc:Depends}, - libc6-dev, libcurl4-openssl-dev, libgcc-9-dev, libstdc++-9-dev, libxml2-dev, - libz3-dev, uuid-dev, zlib1g-dev, - binutils, git, pkg-config, tzdata, unzip - python3 + libc6-dev, libcurl4-openssl-dev, libgcc-9-dev, libstdc++-9-dev, libxml2-dev, + libz3-dev, uuid-dev, zlib1g-dev, + binutils, git, pkg-config, tzdata, unzip, + python3 Description: Swift programming language, release x.y.z - Swift is a general-purpose programming language built using - a modern approach to safety, performance, and software design - patterns. - . - The goal of the Swift project is to create the best available - language for uses ranging from systems programming, to mobile - and desktop apps, scaling up to cloud services. Most - importantly, Swift is designed to make writing and maintaining - correct programs easier for the developer. + Swift is a general-purpose programming language built using + a modern approach to safety, performance, and software design + patterns. + The goal of the Swift project is to create the best available + language for uses ranging from systems programming, to mobile + and desktop apps, scaling up to cloud services. Most + importantly, Swift is designed to make writing and maintaining + correct programs easier for the developer. + diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/patches/build-preset-install-dir b/platforms/Linux/DEB/Ubuntu/focal/debian/patches/build-preset-install-dir index a262cc95..edd19e50 100644 --- a/platforms/Linux/DEB/Ubuntu/focal/debian/patches/build-preset-install-dir +++ b/platforms/Linux/DEB/Ubuntu/focal/debian/patches/build-preset-install-dir @@ -3,16 +3,28 @@ Description: Make target installation directory a command line option time on the command line. Author: Julien Blache -Index: swiftlang-5.6.3/swift/utils/build-presets.ini +Index: swiftlang-5.7.2/swift/utils/build-presets.ini =================================================================== ---- swiftlang-5.6.3.orig/swift/utils/build-presets.ini -+++ swiftlang-5.6.3/swift/utils/build-presets.ini -@@ -831,7 +831,7 @@ install-swiftpm +--- swiftlang-5.7.2.orig/swift/utils/build-presets.ini ++++ swiftlang-5.7.2/swift/utils/build-presets.ini +@@ -824,7 +824,10 @@ install-swiftpm install-swift-driver install-xctest install-libicu -install-prefix=/usr +install-prefix=%(install_prefix)s - install-libcxx ++skip-early-swift-driver ++skip-build-benchmarks ++skip-test-toolchain-benchmarks install-sourcekit-lsp install-swiftdocc + build-swift-static-stdlib +@@ -837,7 +840,6 @@ build-swift-stdlib-unittest-extra + test-installable-package + + # Build the benchmarks against the toolchain. +-toolchain-benchmarks + + # Path to the root of the installation filesystem. + install-destdir=%(install_destdir)s + diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/patches/fix-toolchain-path b/platforms/Linux/DEB/Ubuntu/focal/debian/patches/fix-toolchain-path index 82a49415..b66289ea 100644 --- a/platforms/Linux/DEB/Ubuntu/focal/debian/patches/fix-toolchain-path +++ b/platforms/Linux/DEB/Ubuntu/focal/debian/patches/fix-toolchain-path @@ -3,11 +3,11 @@ Description: Fix toolchain path for build-script-helper.py assumption that /usr is used. Author: Julien Blache -Index: swiftlang-5.6.3/swift/benchmark/scripts/build_script_helper.py +Index: swiftlang-5.7.2/swift/benchmark/scripts/build_script_helper.py =================================================================== ---- swiftlang-5.6.3.orig/swift/benchmark/scripts/build_script_helper.py -+++ swiftlang-5.6.3/swift/benchmark/scripts/build_script_helper.py -@@ -53,7 +53,7 @@ def main(): +--- swiftlang-5.7.2.orig/swift/benchmark/scripts/build_script_helper.py ++++ swiftlang-5.7.2/swift/benchmark/scripts/build_script_helper.py +@@ -51,7 +51,7 @@ def main(): if not os.path.isdir(bin_dir): os.makedirs(bin_dir) @@ -16,11 +16,11 @@ Index: swiftlang-5.6.3/swift/benchmark/scripts/build_script_helper.py perform_build(args, swiftbuild_path, "debug", "Benchmark_Onone", "-Onone") perform_build(args, swiftbuild_path, "release", "Benchmark_Osize", "-Osize") perform_build(args, swiftbuild_path, "release", "Benchmark_O", "-O") -Index: swiftlang-5.6.3/swift/utils/swift_build_support/swift_build_support/products/benchmarks.py +Index: swiftlang-5.7.2/swift/utils/swift_build_support/swift_build_support/products/benchmarks.py =================================================================== ---- swiftlang-5.6.3.orig/swift/utils/swift_build_support/swift_build_support/products/benchmarks.py -+++ swiftlang-5.6.3/swift/utils/swift_build_support/swift_build_support/products/benchmarks.py -@@ -100,13 +100,17 @@ class Benchmarks(product.Product): +--- swiftlang-5.7.2.orig/swift/utils/swift_build_support/swift_build_support/products/benchmarks.py ++++ swiftlang-5.7.2/swift/utils/swift_build_support/swift_build_support/products/benchmarks.py +@@ -100,11 +100,17 @@ class Benchmarks(product.Product): def _get_toolchain_path(host_target, product, args): @@ -28,9 +28,7 @@ Index: swiftlang-5.6.3/swift/utils/swift_build_support/swift_build_support/produ # this logic initially was inside run_build_script_helper # and was factored out so it can be used in testing as well -- toolchain_path = swiftpm.SwiftPM.get_install_destdir(args, -- host_target, -- product.build_dir) +- toolchain_path = product.host_install_destdir(host_target) + install_destdir = args.install_destdir + if swiftpm.SwiftPM.has_cross_compile_hosts(args): + install_destdir = swiftpm.SwiftPM.get_install_destdir(args, diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/rules b/platforms/Linux/DEB/Ubuntu/focal/debian/rules index f30714ec..224474e1 100755 --- a/platforms/Linux/DEB/Ubuntu/focal/debian/rules +++ b/platforms/Linux/DEB/Ubuntu/focal/debian/rules @@ -61,7 +61,7 @@ override_dh_makeshlibs: # packaging, or a different dependency mechanism will be instituted. override_dh_shlibdeps: - dh_shlibdeps -l/opt/swift/$(SWIFTLANG_PKG_VER)/lib/swift/linux/ + dh_shlibdeps -l/usr/lib/swiftlang/$(SWIFTLANG_PKG_VER)/lib/swift/linux/ override_dh_dwz: # Disable DWARF debug info compression; it is failing, so we'll @@ -69,7 +69,7 @@ override_dh_dwz: override_dh_auto_build: swift/utils/build-script $(BUILD_SCRIPT_ARGS) --preset=buildbot_linux,no_assertions,no_test \ - install_prefix=/opt/swift/$(SWIFTLANG_PKG_VER) \ + install_prefix=/usr/lib/swiftlang/$(SWIFTLANG_PKG_VER) \ install_destdir=$(SWIFT_BUILDDIR)/discard \ installable_package=$(SWIFT_BUILDDIR)/swiftdeb-$(SWIFTLANG_PKG_VER).tar.gz @@ -82,4 +82,4 @@ override_dh_auto_install: tar -C $(CURDIR)/debian/tmp -xzf $(SWIFT_BUILDDIR)/swiftdeb-$(SWIFTLANG_PKG_VER).tar.gz # Manually compress manpages, since they are in a non-standard location - find $(CURDIR)/debian/tmp/opt/swift/$(SWIFTLANG_PKG_VER)/share/man -type f -exec gzip \{\} \; + find $(CURDIR)/debian/tmp/usr/lib/swiftlang/$(SWIFTLANG_PKG_VER)/share/man -type f -exec gzip \{\} \; diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang-X.Y.Z.install.in b/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang-X.Y.Z.install.in deleted file mode 100644 index 3c0f5a32..00000000 --- a/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang-X.Y.Z.install.in +++ /dev/null @@ -1 +0,0 @@ -opt/swift/X.Y.Z/* diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.install.in b/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.install.in new file mode 100644 index 00000000..002f07ee --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.install.in @@ -0,0 +1 @@ +usr/lib/swiftlang/X.Y.Z/* diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.links.in b/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.links.in index cb2a6c4a..4b0e27ff 100644 --- a/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.links.in +++ b/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.links.in @@ -1,4 +1,5 @@ -opt/swift/X.Y.Z/bin/swift usr/bin/swift -opt/swift/X.Y.Z/bin/swiftc usr/bin/swiftc -opt/swift/X.Y.Z/bin/sourcekit-lsp usr/bin/sourcekit-lsp -opt/swift/X.Y.Z/share/man/man1/swift.1.gz usr/share/man/man1/swift.1.gz +usr/lib/swiftlang/X.Y.Z/bin/swift usr/bin/swift +usr/lib/swiftlang/X.Y.Z/bin/swiftc usr/bin/swiftc +usr/lib/swiftlang/X.Y.Z/bin/lldb usr/bin/swift-lldb +usr/lib/swiftlang/X.Y.Z/bin/sourcekit-lsp usr/bin/sourcekit-lsp +usr/lib/swiftlang/X.Y.Z/share/man/man1/swift.1.gz usr/share/man/man1/swift.1.gz From 4eebf68802da2d2e930667563ced66e05480de2d Mon Sep 17 00:00:00 2001 From: Matias Piipari Date: Wed, 21 Dec 2022 14:43:57 +0200 Subject: [PATCH 02/13] Drops the -X.Y.Z package as prep for re-dividing into lib, dev, bin This is prep for turning the binary packages into libswiftlang, swiftlang-dev, swiftlang (swiftlang-lldb in succession?) --- .../Linux/DEB/Ubuntu/focal/debian/control.in | 19 +++---------------- platforms/Linux/DEB/Ubuntu/focal/debian/rules | 2 +- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/control.in b/platforms/Linux/DEB/Ubuntu/focal/debian/control.in index cef080f7..aa2d1e30 100644 --- a/platforms/Linux/DEB/Ubuntu/focal/debian/control.in +++ b/platforms/Linux/DEB/Ubuntu/focal/debian/control.in @@ -12,28 +12,13 @@ Standards-Version: 4.6.1 Homepage: https://www.swift.org Package: swiftlang -Architecture: all -Depends: swiftlang-x.y.z, ${misc:Depends} -Description: Swift programming language - Swift is a general-purpose programming language built using - a modern approach to safety, performance, and software design - patterns. - The goal of the Swift project is to create the best available - language for uses ranging from systems programming, to mobile - and desktop apps, scaling up to cloud services. Most - importantly, Swift is designed to make writing and maintaining - correct programs easier for the developer. - This package contains the convenience symlinks for the latest - version of Swift. - -Package: swiftlang-x.y.z Architecture: amd64 arm64 Depends: ${shlibs:Depends}, ${misc:Depends}, libc6-dev, libcurl4-openssl-dev, libgcc-9-dev, libstdc++-9-dev, libxml2-dev, libz3-dev, uuid-dev, zlib1g-dev, binutils, git, pkg-config, tzdata, unzip, python3 -Description: Swift programming language, release x.y.z +Description: Swift programming language Swift is a general-purpose programming language built using a modern approach to safety, performance, and software design patterns. @@ -42,4 +27,6 @@ Description: Swift programming language, release x.y.z and desktop apps, scaling up to cloud services. Most importantly, Swift is designed to make writing and maintaining correct programs easier for the developer. + This package contains the convenience symlinks for the latest + version of Swift. diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/rules b/platforms/Linux/DEB/Ubuntu/focal/debian/rules index 224474e1..ffaeffa7 100755 --- a/platforms/Linux/DEB/Ubuntu/focal/debian/rules +++ b/platforms/Linux/DEB/Ubuntu/focal/debian/rules @@ -25,7 +25,7 @@ clean:: sed -e 's/x.y.z/$(SWIFTLANG_PKG_VER)/g' < debian/control.in > debian/control rm -f debian/swiftlang-*.install debian/swiftlang.links - sed -e 's/X.Y.Z/$(SWIFTLANG_PKG_VER)/g' < debian/swiftlang-X.Y.Z.install.in > debian/swiftlang-$(SWIFTLANG_PKG_VER).install + sed -e 's/X.Y.Z/$(SWIFTLANG_PKG_VER)/g' < debian/swiftlang.install.in > debian/swiftlang.install sed -e 's/X.Y.Z/$(SWIFTLANG_PKG_VER)/g' < debian/swiftlang.links.in > debian/swiftlang.links rm -rf $(SWIFT_BUILDDIR) From 8d0350e0ae46fc90202d2943b41348c0b00de67d Mon Sep 17 00:00:00 2001 From: Matias Piipari Date: Wed, 21 Dec 2022 23:19:33 +0200 Subject: [PATCH 03/13] Build and upload a signed source package to Launchpad using a GH action --- .github/workflows/build-ubuntu-debs.yaml | 54 +++++++++++++++++++ platforms/Linux/DEB/Shared/build_deb.sh | 28 ++++++++-- platforms/Linux/DEB/Ubuntu/.dput.cf | 7 +++ .../Linux/DEB/Ubuntu/focal/debian/changelog | 8 ++- 4 files changed, 92 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/build-ubuntu-debs.yaml create mode 100644 platforms/Linux/DEB/Ubuntu/.dput.cf diff --git a/.github/workflows/build-ubuntu-debs.yaml b/.github/workflows/build-ubuntu-debs.yaml new file mode 100644 index 00000000..692df790 --- /dev/null +++ b/.github/workflows/build-ubuntu-debs.yaml @@ -0,0 +1,54 @@ +name: Build signed src package for Launchpad binary build & PPA distrib + +on: + push: + branches: [main, ubuntu-for-5.7.2] + +jobs: + build-focal: + runs-on: ubuntu-20.04 + environment: swiftlang-ppa + steps: + - name: Import GPG Key + uses: crazy-max/ghaction-import-gpg@v5 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + + - name: List keys + run: gpg -K + + - name: Checkout + uses: actions/checkout@v3 + + - name: Install build dependencies + run: | + sudo apt install -y --no-install-recommends devscripts dpkg-dev dput equivs + + - name: Build source package + working-directory: platforms/Linux/DEB/Ubuntu/focal + run: | + sudo mkdir -p /output + sudo chown $USER /output + bash ./build_deb.sh -s + + - name: Sign source package + working-directory: /output + run: | + echo $(ls) + debsign -k $DEBSIGN_KEYID swiftlang_*_source.changes + env: + DEBEMAIL: ${{ secrets.DEBEMAIL }} + DEBFULLNAME: ${{ secrets.DEBFULLNAME }} + DEBSIGN_KEYID: ${{secrets.DEBSIGN_KEYID }} + + - name: Copy .dput.cf in place + working-directory: platforms/Linux/DEB/Ubuntu + run: cp .dput.cf ~/.dput.cf + + - name: Upload to Launchpad for binary build + working-directory: /output + run: dput ppa:swiftlang/swiftlang swiftlang_*_source.changes + env: + DEBEMAIL: ${{ secrets.DEBEMAIL }} + DEBFULLNAME: ${{ secrets.DEBFULLNAME }} + DEBSIGN_KEYID: ${{secrets.DEBSIGN_KEYID }} diff --git a/platforms/Linux/DEB/Shared/build_deb.sh b/platforms/Linux/DEB/Shared/build_deb.sh index 697c0dfb..6c57d62c 100755 --- a/platforms/Linux/DEB/Shared/build_deb.sh +++ b/platforms/Linux/DEB/Shared/build_deb.sh @@ -10,6 +10,15 @@ set -eux +source_only_pkg=FALSE # build binary deb by default +while getopts ":s" option; do + case $option in + s) + source_only_pkg=TRUE + ;; + esac +done + here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # load version definitions @@ -31,16 +40,27 @@ ${here}/build_source_package.sh ${staging_dir} # install the build dependencies cd ${staging_dir} -mk-build-deps --install ${package_dir}/debian/control.in --tool 'apt-get -y -o Debug::pkgProblemResolver=yes --no-install-recommends' +mk-build-deps --install ${package_dir}/debian/control.in --root-cmd sudo --remove --tool 'apt-get -y -o Debug::pkgProblemResolver=yes --no-install-recommends' # build the installable package # TODO: add signing key information cd ${package_dir} -DEB_BUILD_OPTIONS=parallel=64 DEB_LINTIAN=false debuild -sa -S + +if [ "$source_only_pkg" == "TRUE" ]; then + DEB_BUILD_OPTIONS=parallel=64 debuild --no-lintian -uc -us -sa -S +else + DEB_BUILD_OPTIONS=parallel=64 debuild +fi # copy the final packages to /output cd ${staging_dir} -cp *.deb /output/ -cp *.ddeb /output/ + +if [ "$source_only_pkg" == "FALSE" ]; then + cp *.deb /output/ + cp *.ddeb /output/ +fi + cp *.dsc /output/ cp *.tar.* /output/ +cp *.changes /output/ +cp *.buildinfo /output/ diff --git a/platforms/Linux/DEB/Ubuntu/.dput.cf b/platforms/Linux/DEB/Ubuntu/.dput.cf new file mode 100644 index 00000000..85a09591 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/.dput.cf @@ -0,0 +1,7 @@ +[swiftlang] +fqdn = ppa.launchpad.net +method = sftp +incoming = ~swiftlang/ubuntu/swiftlang/ +login = swiftlang-uploader +allow_unsigned_uploads = 0 + diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/changelog b/platforms/Linux/DEB/Ubuntu/focal/debian/changelog index 999aa418..22cfd28d 100644 --- a/platforms/Linux/DEB/Ubuntu/focal/debian/changelog +++ b/platforms/Linux/DEB/Ubuntu/focal/debian/changelog @@ -1,8 +1,14 @@ +swiftlang (5.7.2-4) focal; urgency=medium + + * Drops the division into `swiftlang` and `swiftlang-X.Y.Z` + + -- Matias Piipari Tue, 6 Dec 2022 15:53:00 +0200 + swiftlang (5.7.2-3) focal; urgency=medium * Debian packaging updated for Swift 5.7.2. - -- Matias Piipari Tue, 6 Dec 2022 15:53:00 +0200 + -- Matias Piipari Tue, 6 Dec 2022 15:53:00 +0200 swiftlang (5.6.0-1) focal; urgency=medium From 8b38ef9a63e7e3c32ea4311e0a131bd5c23d4bb6 Mon Sep 17 00:00:00 2001 From: Matias Piipari Date: Sun, 1 Jan 2023 23:07:57 +0200 Subject: [PATCH 04/13] Divide into lib, dev, bin + metapackage and add Jammy build - Re-divide into libswiftlang-X.Y.Z, libswiftlang-X.Y.Z-dev, libswiftlang-X.Y.Z-bin, swiftlang metapackage - Add Jammy build - Share resource files with symlinks between different series where possible --- .github/workflows/build-ubuntu-debs.yaml | 19 ++- platforms/Linux/DEB/Shared/build_deb.sh | 19 ++- platforms/Linux/DEB/Ubuntu/bionic/README.md | 1 - .../Linux/DEB/Ubuntu/focal/debian/changelog | 10 +- .../Linux/DEB/Ubuntu/focal/debian/control.in | 22 +++- .../focal/debian/libswiftlang-dev.install.in | 1 + .../focal/debian/libswiftlang.install.in | 1 + .../debian/patches/build-preset-install-dir | 31 +---- .../debian/patches/cmake_parallel_bootstrap | 22 +--- .../fix-integration-tests-package-path | 111 +----------------- .../focal/debian/patches/fix-toolchain-path | 43 +------ .../debian/patches/python3_hwasan_symbolize | 15 +-- .../DEB/Ubuntu/focal/debian/patches/series | 6 +- platforms/Linux/DEB/Ubuntu/focal/debian/rules | 86 +------------- .../focal/debian/swiftlang.alternatives.in | 1 + .../Ubuntu/focal/debian/swiftlang.install.in | 2 +- .../Ubuntu/focal/debian/swiftlang.links.in | 5 - .../DEB/Ubuntu/focal/docker-compose.yaml | 2 +- platforms/Linux/DEB/Ubuntu/hirsute/README.md | 1 - .../Linux/DEB/Ubuntu/jammy/.dockerignore | 1 + platforms/Linux/DEB/Ubuntu/jammy/Dockerfile | 21 ++++ platforms/Linux/DEB/Ubuntu/jammy/build_deb.sh | 1 + .../DEB/Ubuntu/jammy/build_source_package.sh | 1 + .../DEB/Ubuntu/jammy/debian/README.source | 16 +++ .../Linux/DEB/Ubuntu/jammy/debian/changelog | 6 + .../Linux/DEB/Ubuntu/jammy/debian/control.in | 51 ++++++++ .../Linux/DEB/Ubuntu/jammy/debian/copyright | 1 + .../jammy/debian/libswiftlang-dev.install.in | 1 + .../jammy/debian/libswiftlang.install.in | 1 + .../debian/patches/build-preset-install-dir | 1 + .../debian/patches/cmake_parallel_bootstrap | 1 + .../fix-integration-tests-package-path | 1 + .../jammy/debian/patches/fix-toolchain-path | 1 + .../debian/patches/python3_hwasan_symbolize | 1 + .../DEB/Ubuntu/jammy/debian/patches/series | 1 + platforms/Linux/DEB/Ubuntu/jammy/debian/rules | 1 + .../DEB/Ubuntu/jammy/debian/source/format | 1 + .../jammy/debian/swiftlang.alternatives.in | 1 + .../Ubuntu/jammy/debian/swiftlang.install.in | 1 + .../DEB/Ubuntu/jammy/docker-compose.yaml | 47 ++++++++ platforms/Linux/DEB/Ubuntu/jammy/versions.sh | 1 + .../shared/debian/libswiftlang-dev.install.in | 29 +++++ .../shared/debian/libswiftlang.install.in | 1 + .../debian/patches/build-preset-install-dir | 18 +++ .../debian/patches/cmake_parallel_bootstrap | 21 ++++ .../fix-integration-tests-package-path | 110 +++++++++++++++++ .../shared/debian/patches/fix-toolchain-path | 42 +++++++ .../debian/patches/python3_hwasan_symbolize | 14 +++ .../DEB/Ubuntu/shared/debian/patches/series | 5 + .../Linux/DEB/Ubuntu/shared/debian/rules | 96 +++++++++++++++ .../shared/debian/swiftlang.alternatives.in | 9 ++ .../Ubuntu/shared/debian/swiftlang.install.in | 9 ++ 52 files changed, 568 insertions(+), 342 deletions(-) delete mode 100644 platforms/Linux/DEB/Ubuntu/bionic/README.md create mode 120000 platforms/Linux/DEB/Ubuntu/focal/debian/libswiftlang-dev.install.in create mode 120000 platforms/Linux/DEB/Ubuntu/focal/debian/libswiftlang.install.in mode change 100644 => 120000 platforms/Linux/DEB/Ubuntu/focal/debian/patches/build-preset-install-dir mode change 100644 => 120000 platforms/Linux/DEB/Ubuntu/focal/debian/patches/cmake_parallel_bootstrap mode change 100644 => 120000 platforms/Linux/DEB/Ubuntu/focal/debian/patches/fix-integration-tests-package-path mode change 100644 => 120000 platforms/Linux/DEB/Ubuntu/focal/debian/patches/fix-toolchain-path mode change 100644 => 120000 platforms/Linux/DEB/Ubuntu/focal/debian/patches/python3_hwasan_symbolize mode change 100644 => 120000 platforms/Linux/DEB/Ubuntu/focal/debian/patches/series mode change 100755 => 120000 platforms/Linux/DEB/Ubuntu/focal/debian/rules create mode 120000 platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.alternatives.in mode change 100644 => 120000 platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.install.in delete mode 100644 platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.links.in delete mode 100644 platforms/Linux/DEB/Ubuntu/hirsute/README.md create mode 100644 platforms/Linux/DEB/Ubuntu/jammy/.dockerignore create mode 100644 platforms/Linux/DEB/Ubuntu/jammy/Dockerfile create mode 120000 platforms/Linux/DEB/Ubuntu/jammy/build_deb.sh create mode 120000 platforms/Linux/DEB/Ubuntu/jammy/build_source_package.sh create mode 100644 platforms/Linux/DEB/Ubuntu/jammy/debian/README.source create mode 100644 platforms/Linux/DEB/Ubuntu/jammy/debian/changelog create mode 100644 platforms/Linux/DEB/Ubuntu/jammy/debian/control.in create mode 120000 platforms/Linux/DEB/Ubuntu/jammy/debian/copyright create mode 120000 platforms/Linux/DEB/Ubuntu/jammy/debian/libswiftlang-dev.install.in create mode 120000 platforms/Linux/DEB/Ubuntu/jammy/debian/libswiftlang.install.in create mode 120000 platforms/Linux/DEB/Ubuntu/jammy/debian/patches/build-preset-install-dir create mode 120000 platforms/Linux/DEB/Ubuntu/jammy/debian/patches/cmake_parallel_bootstrap create mode 120000 platforms/Linux/DEB/Ubuntu/jammy/debian/patches/fix-integration-tests-package-path create mode 120000 platforms/Linux/DEB/Ubuntu/jammy/debian/patches/fix-toolchain-path create mode 120000 platforms/Linux/DEB/Ubuntu/jammy/debian/patches/python3_hwasan_symbolize create mode 120000 platforms/Linux/DEB/Ubuntu/jammy/debian/patches/series create mode 120000 platforms/Linux/DEB/Ubuntu/jammy/debian/rules create mode 100644 platforms/Linux/DEB/Ubuntu/jammy/debian/source/format create mode 120000 platforms/Linux/DEB/Ubuntu/jammy/debian/swiftlang.alternatives.in create mode 120000 platforms/Linux/DEB/Ubuntu/jammy/debian/swiftlang.install.in create mode 100644 platforms/Linux/DEB/Ubuntu/jammy/docker-compose.yaml create mode 120000 platforms/Linux/DEB/Ubuntu/jammy/versions.sh create mode 100644 platforms/Linux/DEB/Ubuntu/shared/debian/libswiftlang-dev.install.in create mode 100644 platforms/Linux/DEB/Ubuntu/shared/debian/libswiftlang.install.in create mode 100644 platforms/Linux/DEB/Ubuntu/shared/debian/patches/build-preset-install-dir create mode 100644 platforms/Linux/DEB/Ubuntu/shared/debian/patches/cmake_parallel_bootstrap create mode 100644 platforms/Linux/DEB/Ubuntu/shared/debian/patches/fix-integration-tests-package-path create mode 100644 platforms/Linux/DEB/Ubuntu/shared/debian/patches/fix-toolchain-path create mode 100644 platforms/Linux/DEB/Ubuntu/shared/debian/patches/python3_hwasan_symbolize create mode 100644 platforms/Linux/DEB/Ubuntu/shared/debian/patches/series create mode 100755 platforms/Linux/DEB/Ubuntu/shared/debian/rules create mode 100644 platforms/Linux/DEB/Ubuntu/shared/debian/swiftlang.alternatives.in create mode 100644 platforms/Linux/DEB/Ubuntu/shared/debian/swiftlang.install.in diff --git a/.github/workflows/build-ubuntu-debs.yaml b/.github/workflows/build-ubuntu-debs.yaml index 692df790..49673e31 100644 --- a/.github/workflows/build-ubuntu-debs.yaml +++ b/.github/workflows/build-ubuntu-debs.yaml @@ -5,27 +5,27 @@ on: branches: [main, ubuntu-for-5.7.2] jobs: - build-focal: - runs-on: ubuntu-20.04 + build-ubuntu-packages: + strategy: + matrix: + os: [{version: ubuntu-20.04, codename: focal}, {version: ubuntu-22.04, codename: jammy}] + runs-on: ${{ matrix.os.version }} environment: swiftlang-ppa steps: - name: Import GPG Key uses: crazy-max/ghaction-import-gpg@v5 with: gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} - - - name: List keys - run: gpg -K - + - name: Checkout uses: actions/checkout@v3 - name: Install build dependencies run: | - sudo apt install -y --no-install-recommends devscripts dpkg-dev dput equivs + sudo apt install -y --no-install-recommends devscripts dpkg-dev dput equivs rsync - name: Build source package - working-directory: platforms/Linux/DEB/Ubuntu/focal + working-directory: platforms/Linux/DEB/Ubuntu/${{ matrix.os.codename }} run: | sudo mkdir -p /output sudo chown $USER /output @@ -34,14 +34,13 @@ jobs: - name: Sign source package working-directory: /output run: | - echo $(ls) debsign -k $DEBSIGN_KEYID swiftlang_*_source.changes env: DEBEMAIL: ${{ secrets.DEBEMAIL }} DEBFULLNAME: ${{ secrets.DEBFULLNAME }} DEBSIGN_KEYID: ${{secrets.DEBSIGN_KEYID }} - - name: Copy .dput.cf in place + - name: Copy dput configuration in place working-directory: platforms/Linux/DEB/Ubuntu run: cp .dput.cf ~/.dput.cf diff --git a/platforms/Linux/DEB/Shared/build_deb.sh b/platforms/Linux/DEB/Shared/build_deb.sh index 6c57d62c..6aaf28cd 100755 --- a/platforms/Linux/DEB/Shared/build_deb.sh +++ b/platforms/Linux/DEB/Shared/build_deb.sh @@ -24,23 +24,32 @@ here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # load version definitions . ${here}/versions.sh -# working in /tmp since docker file sharing makes this very slow to do dirctly on the share +# working in /tmp since docker file sharing makes this very slow to do directly on the share staging_dir=/tmp/swift-deb-builder package_dir=${staging_dir}/swiftlang-${debversion} # clean rm -rf ${package_dir} && mkdir -p ${package_dir} -# copy control files to package build directory -cp -r ${here}/debian ${package_dir}/ -cp -r ${package_dir}/debian/control.in ${package_dir}/debian/control +# use rsync to copy control, rules, patches files to package build directory, +# including relative symlink targets +rsync --archive --copy-links ${here}/debian ${package_dir}/ +cp ${package_dir}/debian/control.in ${package_dir}/debian/control # build the source package ${here}/build_source_package.sh ${staging_dir} # install the build dependencies cd ${staging_dir} -mk-build-deps --install ${package_dir}/debian/control.in --root-cmd sudo --remove --tool 'apt-get -y -o Debug::pkgProblemResolver=yes --no-install-recommends' + +if [ -f /.dockerenv ]; then + root_cmd="" # no --root-cmd assumed needed when executing in container +else + root_cmd="--root-cmd=sudo" +fi + +mk-build-deps --install ${package_dir}/debian/control ${root_cmd} --remove --tool 'apt-get -y -o Debug::pkgProblemResolver=yes' + # build the installable package # TODO: add signing key information diff --git a/platforms/Linux/DEB/Ubuntu/bionic/README.md b/platforms/Linux/DEB/Ubuntu/bionic/README.md deleted file mode 100644 index 5da2f6c8..00000000 --- a/platforms/Linux/DEB/Ubuntu/bionic/README.md +++ /dev/null @@ -1 +0,0 @@ -## bionic diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/changelog b/platforms/Linux/DEB/Ubuntu/focal/debian/changelog index 22cfd28d..2591bf95 100644 --- a/platforms/Linux/DEB/Ubuntu/focal/debian/changelog +++ b/platforms/Linux/DEB/Ubuntu/focal/debian/changelog @@ -1,12 +1,6 @@ -swiftlang (5.7.2-4) focal; urgency=medium +swiftlang (5.7.2-0~focal3) focal; urgency=medium - * Drops the division into `swiftlang` and `swiftlang-X.Y.Z` - - -- Matias Piipari Tue, 6 Dec 2022 15:53:00 +0200 - -swiftlang (5.7.2-3) focal; urgency=medium - - * Debian packaging updated for Swift 5.7.2. + * Replaces `swiftlang` + `swiftlang-X.Y.Z` packages with `libswiftlang-X.Y.Z`, `libswiftlang-X.Y.Z-dev`, `swiftlang-X.Y.Z-bin` and meta-package `swiftlang`. -- Matias Piipari Tue, 6 Dec 2022 15:53:00 +0200 diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/control.in b/platforms/Linux/DEB/Ubuntu/focal/debian/control.in index aa2d1e30..be108765 100644 --- a/platforms/Linux/DEB/Ubuntu/focal/debian/control.in +++ b/platforms/Linux/DEB/Ubuntu/focal/debian/control.in @@ -11,11 +11,22 @@ Build-Depends: debhelper-compat (= 12), devscripts, Standards-Version: 4.6.1 Homepage: https://www.swift.org -Package: swiftlang -Architecture: amd64 arm64 +Package: libswiftlang-x.y.z +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Runtime libraries for the Swift programming language + +Package: libswiftlang-x.y.z-dev +Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, libc6-dev, libcurl4-openssl-dev, libgcc-9-dev, libstdc++-9-dev, libxml2-dev, - libz3-dev, uuid-dev, zlib1g-dev, + libz3-dev, uuid-dev, zlib1g-dev +Description: Headers, static libraries for the Swift programming language + +Package: swiftlang-x.y.z-bin +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, + libswiftlang-x.y.z, libswiftlang-x.y.z-dev, binutils, git, pkg-config, tzdata, unzip, python3 Description: Swift programming language @@ -30,3 +41,8 @@ Description: Swift programming language This package contains the convenience symlinks for the latest version of Swift. +Package: swiftlang +Architecture: any +Depends: + libswiftlang-x.y.z, libswiftlang-x.y.z-dev, swiftlang-x.y.z-bin +Description: Virtual package that provides the most recent version of the Swift programming language \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/libswiftlang-dev.install.in b/platforms/Linux/DEB/Ubuntu/focal/debian/libswiftlang-dev.install.in new file mode 120000 index 00000000..9ec6117d --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/focal/debian/libswiftlang-dev.install.in @@ -0,0 +1 @@ +../../shared/debian/libswiftlang-dev.install.in \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/libswiftlang.install.in b/platforms/Linux/DEB/Ubuntu/focal/debian/libswiftlang.install.in new file mode 120000 index 00000000..c2076ad2 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/focal/debian/libswiftlang.install.in @@ -0,0 +1 @@ +../../shared/debian/libswiftlang.install.in \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/patches/build-preset-install-dir b/platforms/Linux/DEB/Ubuntu/focal/debian/patches/build-preset-install-dir deleted file mode 100644 index edd19e50..00000000 --- a/platforms/Linux/DEB/Ubuntu/focal/debian/patches/build-preset-install-dir +++ /dev/null @@ -1,30 +0,0 @@ -Description: Make target installation directory a command line option - Use a variable for the install prefix, so we can specify it at build - time on the command line. -Author: Julien Blache - -Index: swiftlang-5.7.2/swift/utils/build-presets.ini -=================================================================== ---- swiftlang-5.7.2.orig/swift/utils/build-presets.ini -+++ swiftlang-5.7.2/swift/utils/build-presets.ini -@@ -824,7 +824,10 @@ install-swiftpm - install-swift-driver - install-xctest - install-libicu --install-prefix=/usr -+install-prefix=%(install_prefix)s -+skip-early-swift-driver -+skip-build-benchmarks -+skip-test-toolchain-benchmarks - install-sourcekit-lsp - install-swiftdocc - build-swift-static-stdlib -@@ -837,7 +840,6 @@ build-swift-stdlib-unittest-extra - test-installable-package - - # Build the benchmarks against the toolchain. --toolchain-benchmarks - - # Path to the root of the installation filesystem. - install-destdir=%(install_destdir)s - diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/patches/build-preset-install-dir b/platforms/Linux/DEB/Ubuntu/focal/debian/patches/build-preset-install-dir new file mode 120000 index 00000000..386f0a36 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/focal/debian/patches/build-preset-install-dir @@ -0,0 +1 @@ +../../../shared/debian/patches/build-preset-install-dir \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/patches/cmake_parallel_bootstrap b/platforms/Linux/DEB/Ubuntu/focal/debian/patches/cmake_parallel_bootstrap deleted file mode 100644 index 99a4c097..00000000 --- a/platforms/Linux/DEB/Ubuntu/focal/debian/patches/cmake_parallel_bootstrap +++ /dev/null @@ -1,21 +0,0 @@ -Description: Enable parallel boostrap for CMake - CMake's bootstrap can be parallelized, but wasn't. -Author: Julien Blache - -Index: swiftlang-5.6.3/swift/utils/swift_build_support/swift_build_support/cmake.py -=================================================================== ---- swiftlang-5.6.3.orig/swift/utils/swift_build_support/swift_build_support/cmake.py -+++ swiftlang-5.6.3/swift/utils/swift_build_support/swift_build_support/cmake.py -@@ -267,8 +267,10 @@ class CMake(object): - - cwd = os.getcwd() - os.chdir(cmake_build_dir) -- shell.call_without_sleeping([cmake_bootstrap, '--no-qt-gui', '--', -- '-DCMAKE_USE_OPENSSL=OFF'], echo=True) -+ shell.call_without_sleeping([cmake_bootstrap, '--no-qt-gui', -+ '--parallel=%s' % self.args.build_jobs, -+ '--', '-DCMAKE_USE_OPENSSL=OFF'], -+ echo=True) - shell.call_without_sleeping(['make', '-j%s' % self.args.build_jobs], - echo=True) - os.chdir(cwd) diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/patches/cmake_parallel_bootstrap b/platforms/Linux/DEB/Ubuntu/focal/debian/patches/cmake_parallel_bootstrap new file mode 120000 index 00000000..535af1dc --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/focal/debian/patches/cmake_parallel_bootstrap @@ -0,0 +1 @@ +../../../shared/debian/patches/cmake_parallel_bootstrap \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/patches/fix-integration-tests-package-path b/platforms/Linux/DEB/Ubuntu/focal/debian/patches/fix-integration-tests-package-path deleted file mode 100644 index 254fbf1d..00000000 --- a/platforms/Linux/DEB/Ubuntu/focal/debian/patches/fix-integration-tests-package-path +++ /dev/null @@ -1,110 +0,0 @@ -Description: Fix integration tests to use correct package path - Remove hardcoded usr paths and pass the correct package path to - the tests. -Author: Julien Blache - -Index: swiftlang-5.6.3/swift-integration-tests/lit.cfg -=================================================================== ---- swiftlang-5.6.3.orig/swift-integration-tests/lit.cfg -+++ swiftlang-5.6.3/swift-integration-tests/lit.cfg -@@ -175,31 +175,31 @@ else: - - swift_path = lit_config.params.get( - "swift", -- os.path.join(package_path, "usr", "bin", "swift")) -+ os.path.join(package_path, "bin", "swift")) - lit_config.note("testing using 'swift': %r" % (swift_path,)) - - swiftc_path = lit_config.params.get( - "swiftc", -- os.path.join(package_path, "usr", "bin", "swiftc")) -+ os.path.join(package_path, "bin", "swiftc")) - lit_config.note("testing using 'swiftc': %r" % (swiftc_path,)) - - lldb_path = lit_config.params.get( - "lldb", -- os.path.join(package_path, "usr", "bin", "lldb")) -+ os.path.join(package_path, "bin", "lldb")) - lit_config.note("testing using 'lldb': {}".format(lldb_path)) - - repl_swift_dummy_path = lit_config.params.get( - "repl_swift", -- os.path.join(package_path, "usr", "bin", "repl_swift")) -+ os.path.join(package_path, "bin", "repl_swift")) - lit_config.note("testing using 'repl_swift': {}".format(repl_swift_dummy_path)) - - sourcekit_lsp_path = lit_config.params.get( - "sourcekit-lsp", -- os.path.join(package_path, "usr", "bin", "sourcekit-lsp")) -+ os.path.join(package_path, "bin", "sourcekit-lsp")) - - docc_path = lit_config.params.get( - "docc", -- os.path.join(package_path, "usr", "bin", "docc")) -+ os.path.join(package_path, "bin", "docc")) - lit_config.note("testing using 'docc': {}".format(docc_path)) - - # Verify they exist. -Index: swiftlang-5.6.3/swift-integration-tests/test-snapshot-binaries/test-rpath-linux.py -=================================================================== ---- swiftlang-5.6.3.orig/swift-integration-tests/test-snapshot-binaries/test-rpath-linux.py -+++ swiftlang-5.6.3/swift-integration-tests/test-snapshot-binaries/test-rpath-linux.py -@@ -4,26 +4,26 @@ - # CHECK: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}$ORIGIN/../lib/swift/linux - # - # Tests that DT_RUNPATH is correct for the Swift stdlib and other libraries on Linux. --# RUN: %{readelf} -d %{package_path}/usr/lib/swift/linux/libswiftCore.so | %{FileCheck} --check-prefix CHECK-CORE %s -+# RUN: %{readelf} -d %{package_path}/lib/swift/linux/libswiftCore.so | %{FileCheck} --check-prefix CHECK-CORE %s - # CHECK-CORE-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux - # --# RUN: %{readelf} -d %{package_path}/usr/lib/libsourcekitdInProc.so | %{FileCheck} --check-prefix CHECK-SK %s -+# RUN: %{readelf} -d %{package_path}/lib/libsourcekitdInProc.so | %{FileCheck} --check-prefix CHECK-SK %s - # CHECK-SK-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux - # --# RUN: %{readelf} -d %{package_path}/usr/lib/swift/linux/libswiftRemoteMirror.so | %{FileCheck} --check-prefix CHECK-RM %s -+# RUN: %{readelf} -d %{package_path}/lib/swift/linux/libswiftRemoteMirror.so | %{FileCheck} --check-prefix CHECK-RM %s - # CHECK-RM-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux - # --# RUN: %{readelf} -d %{package_path}/usr/lib/swift/linux/libswift_Differentiation.so | %{FileCheck} --check-prefix CHECK-SD %s -+# RUN: %{readelf} -d %{package_path}/lib/swift/linux/libswift_Differentiation.so | %{FileCheck} --check-prefix CHECK-SD %s - # CHECK-SD-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux - # --# RUN: %{readelf} -d %{package_path}/usr/lib/swift/linux/lib_InternalSwiftSyntaxParser.so | %{FileCheck} --check-prefix CHECK-SP %s -+# RUN: %{readelf} -d %{package_path}/lib/swift/linux/lib_InternalSwiftSyntaxParser.so | %{FileCheck} --check-prefix CHECK-SP %s - # CHECK-SP-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux - # --# RUN: %{readelf} -d %{package_path}/usr/lib/swift/linux/libswiftGlibc.so | %{FileCheck} --check-prefix CHECK-SG %s -+# RUN: %{readelf} -d %{package_path}/lib/swift/linux/libswiftGlibc.so | %{FileCheck} --check-prefix CHECK-SG %s - # CHECK-SG-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux - # --# RUN: %{readelf} -d %{package_path}/usr/lib/swift/linux/libswiftSwiftOnoneSupport.so | %{FileCheck} --check-prefix CHECK-SON %s -+# RUN: %{readelf} -d %{package_path}/lib/swift/linux/libswiftSwiftOnoneSupport.so | %{FileCheck} --check-prefix CHECK-SON %s - # CHECK-SON-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux - # --# RUN: %{readelf} -d %{package_path}/usr/lib/libswiftDemangle.so | %{FileCheck} --check-prefix CHECK-SDE %s -+# RUN: %{readelf} -d %{package_path}/lib/libswiftDemangle.so | %{FileCheck} --check-prefix CHECK-SDE %s - # CHECK-SDE-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux -Index: swiftlang-5.6.3/swift/utils/build-script-impl -=================================================================== ---- swiftlang-5.6.3.orig/swift/utils/build-script-impl -+++ swiftlang-5.6.3/swift/utils/build-script-impl -@@ -3463,8 +3463,10 @@ function build_and_test_installable_pack - - if [[ "${host}" == "macosx-"* ]] || [[ "${host}" == "merged-hosts" ]]; then - PKG_TESTS_SANDBOX="${PKG_TESTS_SANDBOX_PARENT}"/"${TOOLCHAIN_PREFIX}" -+ PKG_TESTS_PKG_DIR="${PKG_TESTS_SANDBOX}" - else # Linux - PKG_TESTS_SANDBOX="${PKG_TESTS_SANDBOX_PARENT}" -+ PKG_TESTS_PKG_DIR="${PKG_TESTS_SANDBOX}/${host_install_prefix}" - fi - - LIT_EXECUTABLE_PATH="${LLVM_SOURCE_DIR}/utils/lit/lit.py" -@@ -3479,7 +3481,7 @@ function build_and_test_installable_pack - TIMEOUT_ARGS=--timeout=1200 # 20 minutes - fi - with_pushd "${PKG_TESTS_SOURCE_DIR}" \ -- call python3 "${LIT_EXECUTABLE_PATH}" . -sv --param package-path="${PKG_TESTS_SANDBOX}" --param test-exec-root="${PKG_TESTS_TEMPS}" --param llvm-bin-dir="${LLVM_BIN_DIR}" ${TIMEOUT_ARGS} -+ call python3 "${LIT_EXECUTABLE_PATH}" . -sv --param package-path="${PKG_TESTS_PKG_DIR}" --param test-exec-root="${PKG_TESTS_TEMPS}" --param llvm-bin-dir="${LLVM_BIN_DIR}" ${TIMEOUT_ARGS} - fi - fi - } diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/patches/fix-integration-tests-package-path b/platforms/Linux/DEB/Ubuntu/focal/debian/patches/fix-integration-tests-package-path new file mode 120000 index 00000000..5d29cd33 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/focal/debian/patches/fix-integration-tests-package-path @@ -0,0 +1 @@ +../../../shared/debian/patches/fix-integration-tests-package-path \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/patches/fix-toolchain-path b/platforms/Linux/DEB/Ubuntu/focal/debian/patches/fix-toolchain-path deleted file mode 100644 index b66289ea..00000000 --- a/platforms/Linux/DEB/Ubuntu/focal/debian/patches/fix-toolchain-path +++ /dev/null @@ -1,42 +0,0 @@ -Description: Fix toolchain path for build-script-helper.py - Make sure the correct path is passed to the script, and remove - assumption that /usr is used. -Author: Julien Blache - -Index: swiftlang-5.7.2/swift/benchmark/scripts/build_script_helper.py -=================================================================== ---- swiftlang-5.7.2.orig/swift/benchmark/scripts/build_script_helper.py -+++ swiftlang-5.7.2/swift/benchmark/scripts/build_script_helper.py -@@ -51,7 +51,7 @@ def main(): - if not os.path.isdir(bin_dir): - os.makedirs(bin_dir) - -- swiftbuild_path = os.path.join(args.toolchain, "usr", "bin", "swift-build") -+ swiftbuild_path = os.path.join(args.toolchain, "bin", "swift-build") - perform_build(args, swiftbuild_path, "debug", "Benchmark_Onone", "-Onone") - perform_build(args, swiftbuild_path, "release", "Benchmark_Osize", "-Osize") - perform_build(args, swiftbuild_path, "release", "Benchmark_O", "-O") -Index: swiftlang-5.7.2/swift/utils/swift_build_support/swift_build_support/products/benchmarks.py -=================================================================== ---- swiftlang-5.7.2.orig/swift/utils/swift_build_support/swift_build_support/products/benchmarks.py -+++ swiftlang-5.7.2/swift/utils/swift_build_support/swift_build_support/products/benchmarks.py -@@ -100,11 +100,17 @@ class Benchmarks(product.Product): - - - def _get_toolchain_path(host_target, product, args): -- # TODO check if we should prefer using product.install_toolchain_path - # this logic initially was inside run_build_script_helper - # and was factored out so it can be used in testing as well - -- toolchain_path = product.host_install_destdir(host_target) -+ install_destdir = args.install_destdir -+ if swiftpm.SwiftPM.has_cross_compile_hosts(args): -+ install_destdir = swiftpm.SwiftPM.get_install_destdir(args, -+ host_target, -+ product.build_dir) -+ toolchain_path = targets.toolchain_path(install_destdir, -+ args.install_prefix) -+ - if platform.system() == 'Darwin': - # The prefix is an absolute path, so concatenate without os.path. - toolchain_path += \ diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/patches/fix-toolchain-path b/platforms/Linux/DEB/Ubuntu/focal/debian/patches/fix-toolchain-path new file mode 120000 index 00000000..596321a9 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/focal/debian/patches/fix-toolchain-path @@ -0,0 +1 @@ +../../../shared/debian/patches/fix-toolchain-path \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/patches/python3_hwasan_symbolize b/platforms/Linux/DEB/Ubuntu/focal/debian/patches/python3_hwasan_symbolize deleted file mode 100644 index e9b44283..00000000 --- a/platforms/Linux/DEB/Ubuntu/focal/debian/patches/python3_hwasan_symbolize +++ /dev/null @@ -1,14 +0,0 @@ -Description: Fix hwasan_symbolize to call python3 - On Ubuntu, /usr/bin/python is still python 2.x. -Author: Julien Blache - -Index: swiftlang-5.6.3/llvm-project/compiler-rt/lib/hwasan/scripts/hwasan_symbolize -=================================================================== ---- swiftlang-5.6.3.orig/llvm-project/compiler-rt/lib/hwasan/scripts/hwasan_symbolize -+++ swiftlang-5.6.3/llvm-project/compiler-rt/lib/hwasan/scripts/hwasan_symbolize -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - #===- lib/hwasan/scripts/hwasan_symbolize ----------------------------------===# - # - # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/patches/python3_hwasan_symbolize b/platforms/Linux/DEB/Ubuntu/focal/debian/patches/python3_hwasan_symbolize new file mode 120000 index 00000000..5736d8f4 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/focal/debian/patches/python3_hwasan_symbolize @@ -0,0 +1 @@ +../../../shared/debian/patches/python3_hwasan_symbolize \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/patches/series b/platforms/Linux/DEB/Ubuntu/focal/debian/patches/series deleted file mode 100644 index 33cab02d..00000000 --- a/platforms/Linux/DEB/Ubuntu/focal/debian/patches/series +++ /dev/null @@ -1,5 +0,0 @@ -python3_hwasan_symbolize -cmake_parallel_bootstrap -build-preset-install-dir -fix-toolchain-path -fix-integration-tests-package-path diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/patches/series b/platforms/Linux/DEB/Ubuntu/focal/debian/patches/series new file mode 120000 index 00000000..9cbc1df3 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/focal/debian/patches/series @@ -0,0 +1 @@ +../../../shared/debian/patches/series \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/rules b/platforms/Linux/DEB/Ubuntu/focal/debian/rules deleted file mode 100755 index ffaeffa7..00000000 --- a/platforms/Linux/DEB/Ubuntu/focal/debian/rules +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/make -f -# See debhelper(7) (uncomment to enable) -# output every command that modifies files on the build system. -#export DH_VERBOSE = 1 - -BUILD_SCRIPT_ARGS = -ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) - NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) - BUILD_SCRIPT_ARGS += -j $(NUMJOBS) -endif - -# Verbose Swift build -export VERBOSE=1 - -SWIFTLANG_PKG_VER=$(shell dpkg-parsechangelog -S Version | sed -e 's/-[^-]*$$//') -SWIFT_BUILDDIR=$(CURDIR)/build - -%: - dh $@ - -clean:: - dh_testdir - - # Generate debian/control and others - sed -e 's/x.y.z/$(SWIFTLANG_PKG_VER)/g' < debian/control.in > debian/control - - rm -f debian/swiftlang-*.install debian/swiftlang.links - sed -e 's/X.Y.Z/$(SWIFTLANG_PKG_VER)/g' < debian/swiftlang.install.in > debian/swiftlang.install - sed -e 's/X.Y.Z/$(SWIFTLANG_PKG_VER)/g' < debian/swiftlang.links.in > debian/swiftlang.links - - rm -rf $(SWIFT_BUILDDIR) - - # Modified during the build - rm -f swift-corelibs-libdispatch/dispatch/module.modulemap - rm -f swift-corelibs-libdispatch/private/module.modulemap - - # Python byte-compiled files - find swift/utils -name '*.pyc' -delete - find llvm-project -name '*.pyc' -delete - find cmark/test -name '*.pyc' -delete - find swiftpm -name '*.pyc' -delete - - dh_clean - -override_dh_auto_clean: - # Disabled; we have a non-standard build system that the tool - # doesn't support, so be on the safe side and avoid any potential - # false-triggering. - -override_dh_update_autotools_config: - # Don't go and update config.guess/config.sub, it causes LLVM to - # pick up the x86_64-pc-linux-gnu triplet instead of the expected - # x86_64-unknown-linux-gnu. This causes Swift modules to break. - -override_dh_autoreconf: - # We'd rather not do that either, see above. - -override_dh_makeshlibs: - # Do not provide shlibs for the all-in-one package; shlibs will be - # provided where pertinent as we move toward the end state of the - # packaging, or a different dependency mechanism will be instituted. - -override_dh_shlibdeps: - dh_shlibdeps -l/usr/lib/swiftlang/$(SWIFTLANG_PKG_VER)/lib/swift/linux/ - -override_dh_dwz: - # Disable DWARF debug info compression; it is failing, so we'll - # need to investigate whether or not it is suitable for us. - -override_dh_auto_build: - swift/utils/build-script $(BUILD_SCRIPT_ARGS) --preset=buildbot_linux,no_assertions,no_test \ - install_prefix=/usr/lib/swiftlang/$(SWIFTLANG_PKG_VER) \ - install_destdir=$(SWIFT_BUILDDIR)/discard \ - installable_package=$(SWIFT_BUILDDIR)/swiftdeb-$(SWIFTLANG_PKG_VER).tar.gz - -override_dh_auto_install: - # The build script preset used above will build, install, package, - # and test the resulting tarball. We could split all this into 2 - # or more presets and run them in sequence as expected here, but - # for now we'll just unpack the (tested) tarball and go from there. - mkdir -p $(CURDIR)/debian/tmp - tar -C $(CURDIR)/debian/tmp -xzf $(SWIFT_BUILDDIR)/swiftdeb-$(SWIFTLANG_PKG_VER).tar.gz - - # Manually compress manpages, since they are in a non-standard location - find $(CURDIR)/debian/tmp/usr/lib/swiftlang/$(SWIFTLANG_PKG_VER)/share/man -type f -exec gzip \{\} \; diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/rules b/platforms/Linux/DEB/Ubuntu/focal/debian/rules new file mode 120000 index 00000000..5f635612 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/focal/debian/rules @@ -0,0 +1 @@ +../../shared/debian/rules \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.alternatives.in b/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.alternatives.in new file mode 120000 index 00000000..efe172cd --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.alternatives.in @@ -0,0 +1 @@ +../../shared/debian/swiftlang.alternatives.in \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.install.in b/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.install.in deleted file mode 100644 index 002f07ee..00000000 --- a/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.install.in +++ /dev/null @@ -1 +0,0 @@ -usr/lib/swiftlang/X.Y.Z/* diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.install.in b/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.install.in new file mode 120000 index 00000000..d6d1248d --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.install.in @@ -0,0 +1 @@ +../../shared/debian/swiftlang.install.in \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.links.in b/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.links.in deleted file mode 100644 index 4b0e27ff..00000000 --- a/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.links.in +++ /dev/null @@ -1,5 +0,0 @@ -usr/lib/swiftlang/X.Y.Z/bin/swift usr/bin/swift -usr/lib/swiftlang/X.Y.Z/bin/swiftc usr/bin/swiftc -usr/lib/swiftlang/X.Y.Z/bin/lldb usr/bin/swift-lldb -usr/lib/swiftlang/X.Y.Z/bin/sourcekit-lsp usr/bin/sourcekit-lsp -usr/lib/swiftlang/X.Y.Z/share/man/man1/swift.1.gz usr/share/man/man1/swift.1.gz diff --git a/platforms/Linux/DEB/Ubuntu/focal/docker-compose.yaml b/platforms/Linux/DEB/Ubuntu/focal/docker-compose.yaml index 05eff3c8..c796d5d7 100644 --- a/platforms/Linux/DEB/Ubuntu/focal/docker-compose.yaml +++ b/platforms/Linux/DEB/Ubuntu/focal/docker-compose.yaml @@ -30,7 +30,7 @@ services: image: ubuntu-focal-deb-builder depends_on: [docker-setup] volumes: - - ../../Ubuntu/focal:/code/Ubuntu/focal:z + - ../../Ubuntu:/code/Ubuntu:z - ../../Shared:/code/Shared:z - ./.output:/output:z working_dir: /code/Ubuntu/focal diff --git a/platforms/Linux/DEB/Ubuntu/hirsute/README.md b/platforms/Linux/DEB/Ubuntu/hirsute/README.md deleted file mode 100644 index a1b0350d..00000000 --- a/platforms/Linux/DEB/Ubuntu/hirsute/README.md +++ /dev/null @@ -1 +0,0 @@ -## hirsute diff --git a/platforms/Linux/DEB/Ubuntu/jammy/.dockerignore b/platforms/Linux/DEB/Ubuntu/jammy/.dockerignore new file mode 100644 index 00000000..16ff3c79 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/jammy/.dockerignore @@ -0,0 +1 @@ +.output diff --git a/platforms/Linux/DEB/Ubuntu/jammy/Dockerfile b/platforms/Linux/DEB/Ubuntu/jammy/Dockerfile new file mode 100644 index 00000000..631c861b --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/jammy/Dockerfile @@ -0,0 +1,21 @@ +# This source file is part of the Swift.org open source project +# +# Copyright (c) 2022 Apple Inc. and the Swift project authors +# Licensed under Apache License v2.0 with Runtime Library Exception +# +# See http://swift.org/LICENSE.txt for license information +# See http://swift.org/CONTRIBUTORS.txt for Swift project authors + +FROM ubuntu:jammy +LABEL PURPOSE="This image is configured to build Swift for the version of Ubuntu listed above" + +ARG DEBIAN_FRONTEND=noninteractive + +RUN apt-get update + +# Required deb packaging tools +RUN apt-get install -y curl devscripts equivs quilt tar + +# Optimization: Install Swift build requirements listed in the control file +ADD debian/control.in /tmp/control.in +RUN mk-build-deps --install /tmp/control.in --tool 'apt-get -y -o Debug::pkgProblemResolver=yes --no-install-recommends' diff --git a/platforms/Linux/DEB/Ubuntu/jammy/build_deb.sh b/platforms/Linux/DEB/Ubuntu/jammy/build_deb.sh new file mode 120000 index 00000000..376962a2 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/jammy/build_deb.sh @@ -0,0 +1 @@ +../../Shared/build_deb.sh \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/jammy/build_source_package.sh b/platforms/Linux/DEB/Ubuntu/jammy/build_source_package.sh new file mode 120000 index 00000000..2c947fb1 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/jammy/build_source_package.sh @@ -0,0 +1 @@ +../../Shared/build_source_package.sh \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/jammy/debian/README.source b/platforms/Linux/DEB/Ubuntu/jammy/debian/README.source new file mode 100644 index 00000000..284273c9 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/jammy/debian/README.source @@ -0,0 +1,16 @@ +swift for Debian +--------------- + +The source package for Swift is composed of several different source components +from different projects. + +The shell fragment debian/source-versions.sh contains the version information +for all source components, and the Debian package upstream version (debversion). + +Fill in debian/source-versions.sh with the correct versions for all components, +then run debian/getsource.sh to fetch the archives to the current directory. +Source archives will be downloaded, renamed, and repacked if needed using +mk-origtargz from devscripts, and any Debian patches will be refreshed; ensure +devscripts and quilt are installed beforehand. + + -- Swift Maintainers Tue, 01 Mar 2022 15:04:23 -0800 diff --git a/platforms/Linux/DEB/Ubuntu/jammy/debian/changelog b/platforms/Linux/DEB/Ubuntu/jammy/debian/changelog new file mode 100644 index 00000000..132c3df4 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/jammy/debian/changelog @@ -0,0 +1,6 @@ +swiftlang (5.7.2-0~jammy3) jammy; urgency=medium + + * Replaces `swiftlang` + `swiftlang-X.Y.Z` packages with `libswiftlang-X.Y.Z`, `libswiftlang-X.Y.Z-dev`, `swiftlang-X.Y.Z-bin` and meta-package `swiftlang`. + + -- Matias Piipari Tue, 6 Dec 2022 15:53:00 +0200 + diff --git a/platforms/Linux/DEB/Ubuntu/jammy/debian/control.in b/platforms/Linux/DEB/Ubuntu/jammy/debian/control.in new file mode 100644 index 00000000..1843e445 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/jammy/debian/control.in @@ -0,0 +1,51 @@ +Source: swiftlang +Section: devel +Priority: optional +Maintainer: Swift Maintainers +Homepage: https://www.swift.org +Build-Depends: debhelper-compat (= 12), devscripts, + build-essential, clang, cmake, git, icu-devtools, libcurl4-openssl-dev, + libedit-dev, libicu-dev, libncurses5-dev, libpython3-dev, libsqlite3-dev, libxml2-dev, + ninja-build, pkg-config, + python2, python-six, python2-dev, + python3-six, python3-distutils, + rsync, swig, systemtap-sdt-dev, tzdata, + unzip, uuid-dev +Standards-Version: 4.6.1 + +Package: libswiftlang-x.y.z +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Runtime libraries for the Swift programming language + +Package: libswiftlang-x.y.z-dev +Architecture: any +Depends: + libc6-dev, libcurl4-openssl-dev, libgcc-9-dev, libstdc++-9-dev, libxml2-dev, + libz3-dev, uuid-dev, zlib1g-dev, ${shlibs:Depends}, ${misc:Depends} +Description: Headers, static libraries for the Swift programming language + +Package: swiftlang-x.y.z-bin +Architecture: any +Depends: + libswiftlang-x.y.z, libswiftlang-x.y.z-dev, + binutils, git, pkg-config, tzdata, unzip, + python3, ${shlibs:Depends}, ${misc:Depends} +Recommends: python3-lldb-13 +Description: Compiler toolchain for the Swift programming language + Swift is a general-purpose programming language built using + a modern approach to safety, performance, and software design + patterns. + The goal of the Swift project is to create the best available + language for uses ranging from systems programming, to mobile + and desktop apps, scaling up to cloud services. Most + importantly, Swift is designed to make writing and maintaining + correct programs easier for the developer. + This package contains the convenience symlinks for the latest + version of Swift. + +Package: swiftlang +Architecture: any +Depends: + libswiftlang-x.y.z, libswiftlang-x.y.z-dev, swiftlang-x.y.z-bin +Description: Meta-package that provides the most recent version of the Swift programming language diff --git a/platforms/Linux/DEB/Ubuntu/jammy/debian/copyright b/platforms/Linux/DEB/Ubuntu/jammy/debian/copyright new file mode 120000 index 00000000..c5d4e92d --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/jammy/debian/copyright @@ -0,0 +1 @@ +../../../Shared/copyright \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/jammy/debian/libswiftlang-dev.install.in b/platforms/Linux/DEB/Ubuntu/jammy/debian/libswiftlang-dev.install.in new file mode 120000 index 00000000..9ec6117d --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/jammy/debian/libswiftlang-dev.install.in @@ -0,0 +1 @@ +../../shared/debian/libswiftlang-dev.install.in \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/jammy/debian/libswiftlang.install.in b/platforms/Linux/DEB/Ubuntu/jammy/debian/libswiftlang.install.in new file mode 120000 index 00000000..c2076ad2 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/jammy/debian/libswiftlang.install.in @@ -0,0 +1 @@ +../../shared/debian/libswiftlang.install.in \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/jammy/debian/patches/build-preset-install-dir b/platforms/Linux/DEB/Ubuntu/jammy/debian/patches/build-preset-install-dir new file mode 120000 index 00000000..386f0a36 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/jammy/debian/patches/build-preset-install-dir @@ -0,0 +1 @@ +../../../shared/debian/patches/build-preset-install-dir \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/jammy/debian/patches/cmake_parallel_bootstrap b/platforms/Linux/DEB/Ubuntu/jammy/debian/patches/cmake_parallel_bootstrap new file mode 120000 index 00000000..535af1dc --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/jammy/debian/patches/cmake_parallel_bootstrap @@ -0,0 +1 @@ +../../../shared/debian/patches/cmake_parallel_bootstrap \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/jammy/debian/patches/fix-integration-tests-package-path b/platforms/Linux/DEB/Ubuntu/jammy/debian/patches/fix-integration-tests-package-path new file mode 120000 index 00000000..5d29cd33 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/jammy/debian/patches/fix-integration-tests-package-path @@ -0,0 +1 @@ +../../../shared/debian/patches/fix-integration-tests-package-path \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/jammy/debian/patches/fix-toolchain-path b/platforms/Linux/DEB/Ubuntu/jammy/debian/patches/fix-toolchain-path new file mode 120000 index 00000000..596321a9 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/jammy/debian/patches/fix-toolchain-path @@ -0,0 +1 @@ +../../../shared/debian/patches/fix-toolchain-path \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/jammy/debian/patches/python3_hwasan_symbolize b/platforms/Linux/DEB/Ubuntu/jammy/debian/patches/python3_hwasan_symbolize new file mode 120000 index 00000000..5736d8f4 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/jammy/debian/patches/python3_hwasan_symbolize @@ -0,0 +1 @@ +../../../shared/debian/patches/python3_hwasan_symbolize \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/jammy/debian/patches/series b/platforms/Linux/DEB/Ubuntu/jammy/debian/patches/series new file mode 120000 index 00000000..9cbc1df3 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/jammy/debian/patches/series @@ -0,0 +1 @@ +../../../shared/debian/patches/series \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/jammy/debian/rules b/platforms/Linux/DEB/Ubuntu/jammy/debian/rules new file mode 120000 index 00000000..5f635612 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/jammy/debian/rules @@ -0,0 +1 @@ +../../shared/debian/rules \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/jammy/debian/source/format b/platforms/Linux/DEB/Ubuntu/jammy/debian/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/jammy/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/platforms/Linux/DEB/Ubuntu/jammy/debian/swiftlang.alternatives.in b/platforms/Linux/DEB/Ubuntu/jammy/debian/swiftlang.alternatives.in new file mode 120000 index 00000000..efe172cd --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/jammy/debian/swiftlang.alternatives.in @@ -0,0 +1 @@ +../../shared/debian/swiftlang.alternatives.in \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/jammy/debian/swiftlang.install.in b/platforms/Linux/DEB/Ubuntu/jammy/debian/swiftlang.install.in new file mode 120000 index 00000000..d6d1248d --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/jammy/debian/swiftlang.install.in @@ -0,0 +1 @@ +../../shared/debian/swiftlang.install.in \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/jammy/docker-compose.yaml b/platforms/Linux/DEB/Ubuntu/jammy/docker-compose.yaml new file mode 100644 index 00000000..e476758c --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/jammy/docker-compose.yaml @@ -0,0 +1,47 @@ +# This source file is part of the Swift.org open source project +# +# Copyright (c) 2022 Apple Inc. and the Swift project authors +# Licensed under Apache License v2.0 with Runtime Library Exception +# +# See http://swift.org/LICENSE.txt for license information +# See http://swift.org/CONTRIBUTORS.txt for Swift project authors + +# this setup is designed to build the Deb with docker +# usage: +# docker-compose -f platforms/Linux/DEB/ubuntu/jammy/docker-compose.yaml run build + +# to rebuild the base image +# docker-compose -f platforms/Linux/DEB/ubuntu/jammy/docker-compose.yaml build + +# to shell into the container for debugging purposes: +# docker-compose -f platforms/Linux/DEB/ubuntu/jammy/docker-compose.yaml run shell + +version: "2" + +services: + + docker-setup: + image: ubuntu-jammy-deb-builder + build: + context: . + dockerfile: Dockerfile + + common: &common + image: ubuntu-jammy-deb-builder + depends_on: [docker-setup] + volumes: + - ../../Ubuntu:/code/Ubuntu:z + - ../../Shared:/code/Shared:z + - ./.output:/output:z + working_dir: /code/Ubuntu/jammy + cap_drop: + - CAP_NET_RAW + - CAP_NET_BIND_SERVICE + + build: + <<: *common + command: /bin/bash -cl "./build_deb.sh" + + shell: + <<: *common + entrypoint: /bin/bash -l diff --git a/platforms/Linux/DEB/Ubuntu/jammy/versions.sh b/platforms/Linux/DEB/Ubuntu/jammy/versions.sh new file mode 120000 index 00000000..1edc8848 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/jammy/versions.sh @@ -0,0 +1 @@ +../../Shared/versions.sh \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/shared/debian/libswiftlang-dev.install.in b/platforms/Linux/DEB/Ubuntu/shared/debian/libswiftlang-dev.install.in new file mode 100644 index 00000000..99c93e9a --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/shared/debian/libswiftlang-dev.install.in @@ -0,0 +1,29 @@ +usr/lib/swiftlang/X.Y.Z/include/* +usr/lib/swiftlang/X.Y.Z/lib/clang/*/include/* +usr/lib/swiftlang/X.Y.Z/lib/clang/*/lib/linux/*.o +usr/lib/swiftlang/X.Y.Z/lib/clang/*/lib/linux/*.a +usr/lib/swiftlang/X.Y.Z/lib/clang/*/lib/linux/*.a.syms +usr/lib/swiftlang/X.Y.Z/lib/swift/*/*.h +usr/lib/swiftlang/X.Y.Z/lib/swift/*/module.map +usr/lib/swiftlang/X.Y.Z/lib/swift/*/module.modulemap +usr/lib/swiftlang/X.Y.Z/lib/swift/pm/*/*.swiftdoc +usr/lib/swiftlang/X.Y.Z/lib/swift/pm/*/*.swiftmodule +usr/lib/swiftlang/X.Y.Z/lib/swift/FrameworkABIBaseline/* +usr/lib/swiftlang/X.Y.Z/lib/swift/linux/*/*.h +usr/lib/swiftlang/X.Y.Z/lib/swift/linux/*/*.o +usr/lib/swiftlang/X.Y.Z/lib/swift/linux/*.swiftmodule +usr/lib/swiftlang/X.Y.Z/lib/swift/linux/*/*.swiftmodule +usr/lib/swiftlang/X.Y.Z/lib/swift/linux/*/*.swiftdoc +usr/lib/swiftlang/X.Y.Z/lib/swift_static/*/*.h +usr/lib/swiftlang/X.Y.Z/lib/swift_static/linux/*/*.h +usr/lib/swiftlang/X.Y.Z/lib/swift_static/linux/*/*.o +usr/lib/swiftlang/X.Y.Z/lib/swift_static/linux/*.a +usr/lib/swiftlang/X.Y.Z/lib/swift_static/linux/*.swiftmodule +usr/lib/swiftlang/X.Y.Z/lib/swift_static/linux/*/*.swiftdoc +usr/lib/swiftlang/X.Y.Z/lib/swift_static/linux/*/*.swiftmodule +usr/lib/swiftlang/X.Y.Z/lib/swift_static/*/module.map +usr/lib/swiftlang/X.Y.Z/lib/swift_static/*/module.modulemap +usr/lib/swiftlang/X.Y.Z/lib/swift_static/linux/*/*.modulemap +usr/lib/swiftlang/X.Y.Z/lib/swift_static/linux/*.lnk +usr/lib/swiftlang/X.Y.Z/local/include/indexstore/*.h +usr/lib/swiftlang/X.Y.Z/lib/swift/migrator/*.json \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/shared/debian/libswiftlang.install.in b/platforms/Linux/DEB/Ubuntu/shared/debian/libswiftlang.install.in new file mode 100644 index 00000000..193d920c --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/shared/debian/libswiftlang.install.in @@ -0,0 +1 @@ +usr/lib/swiftlang/X.Y.Z/lib/swift/linux/*.so* diff --git a/platforms/Linux/DEB/Ubuntu/shared/debian/patches/build-preset-install-dir b/platforms/Linux/DEB/Ubuntu/shared/debian/patches/build-preset-install-dir new file mode 100644 index 00000000..ea6ffe52 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/shared/debian/patches/build-preset-install-dir @@ -0,0 +1,18 @@ +Description: Make target installation directory a command line option +Use a variable for the install prefix, so we can specify it at build +time on the command line. +Author: Julien Blache + +# Index: swiftlang-5.7.2/swift/utils/build-presets.ini + +--- swiftlang-5.7.2.orig/swift/utils/build-presets.ini ++++ swiftlang-5.7.2/swift/utils/build-presets.ini +@@ -827 +827,5 @@ install-libicu +-install-prefix=/usr ++install-prefix=%(install_prefix)s ++skip-early-swift-driver ++skip-build-benchmarks ++skip-test-toolchain-benchmarks ++skip-test-cmark +@@ -840 +842,0 @@ test-installable-package +-toolchain-benchmarks diff --git a/platforms/Linux/DEB/Ubuntu/shared/debian/patches/cmake_parallel_bootstrap b/platforms/Linux/DEB/Ubuntu/shared/debian/patches/cmake_parallel_bootstrap new file mode 100644 index 00000000..e1848460 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/shared/debian/patches/cmake_parallel_bootstrap @@ -0,0 +1,21 @@ +Description: Enable parallel boostrap for CMake + CMake's bootstrap can be parallelized, but wasn't. +Author: Julien Blache + +Index: swiftlang-5.7.2/swift/utils/swift_build_support/swift_build_support/cmake.py +=================================================================== +--- swiftlang-5.7.2.orig/swift/utils/swift_build_support/swift_build_support/cmake.py ++++ swiftlang-5.7.2/swift/utils/swift_build_support/swift_build_support/cmake.py +@@ -263,8 +263,10 @@ class CMake(object): + + cwd = os.getcwd() + os.chdir(cmake_build_dir) +- shell.call_without_sleeping([cmake_bootstrap, '--no-qt-gui', '--', +- '-DCMAKE_USE_OPENSSL=OFF'], echo=True) ++ shell.call_without_sleeping([cmake_bootstrap, '--no-qt-gui', ++ '--parallel=%s' % self.args.build_jobs, ++ '--', '-DCMAKE_USE_OPENSSL=OFF'], ++ echo=True) + shell.call_without_sleeping(['make', '-j%s' % self.args.build_jobs], + echo=True) + os.chdir(cwd) diff --git a/platforms/Linux/DEB/Ubuntu/shared/debian/patches/fix-integration-tests-package-path b/platforms/Linux/DEB/Ubuntu/shared/debian/patches/fix-integration-tests-package-path new file mode 100644 index 00000000..03118126 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/shared/debian/patches/fix-integration-tests-package-path @@ -0,0 +1,110 @@ +Description: Fix integration tests to use correct package path + Remove hardcoded usr paths and pass the correct package path to + the tests. +Author: Julien Blache + +Index: swiftlang-5.7.2/swift-integration-tests/lit.cfg +=================================================================== +--- swiftlang-5.7.2.orig/swift-integration-tests/lit.cfg ++++ swiftlang-5.7.2/swift-integration-tests/lit.cfg +@@ -175,31 +175,31 @@ else: + + swift_path = lit_config.params.get( + "swift", +- os.path.join(package_path, "usr", "bin", "swift")) ++ os.path.join(package_path, "bin", "swift")) + lit_config.note("testing using 'swift': %r" % (swift_path,)) + + swiftc_path = lit_config.params.get( + "swiftc", +- os.path.join(package_path, "usr", "bin", "swiftc")) ++ os.path.join(package_path, "bin", "swiftc")) + lit_config.note("testing using 'swiftc': %r" % (swiftc_path,)) + + lldb_path = lit_config.params.get( + "lldb", +- os.path.join(package_path, "usr", "bin", "lldb")) ++ os.path.join(package_path, "bin", "lldb")) + lit_config.note("testing using 'lldb': {}".format(lldb_path)) + + repl_swift_dummy_path = lit_config.params.get( + "repl_swift", +- os.path.join(package_path, "usr", "bin", "repl_swift")) ++ os.path.join(package_path, "bin", "repl_swift")) + lit_config.note("testing using 'repl_swift': {}".format(repl_swift_dummy_path)) + + sourcekit_lsp_path = lit_config.params.get( + "sourcekit-lsp", +- os.path.join(package_path, "usr", "bin", "sourcekit-lsp")) ++ os.path.join(package_path, "bin", "sourcekit-lsp")) + + docc_path = lit_config.params.get( + "docc", +- os.path.join(package_path, "usr", "bin", "docc")) ++ os.path.join(package_path, "bin", "docc")) + lit_config.note("testing using 'docc': {}".format(docc_path)) + + # Verify they exist. +Index: swiftlang-5.7.2/swift-integration-tests/test-snapshot-binaries/test-rpath-linux.py +=================================================================== +--- swiftlang-5.7.2.orig/swift-integration-tests/test-snapshot-binaries/test-rpath-linux.py ++++ swiftlang-5.7.2/swift-integration-tests/test-snapshot-binaries/test-rpath-linux.py +@@ -4,26 +4,26 @@ + # CHECK: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}$ORIGIN/../lib/swift/linux + # + # Tests that DT_RUNPATH is correct for the Swift stdlib and other libraries on Linux. +-# RUN: %{readelf} -d %{package_path}/usr/lib/swift/linux/libswiftCore.so | %{FileCheck} --check-prefix CHECK-CORE %s ++# RUN: %{readelf} -d %{package_path}/lib/swift/linux/libswiftCore.so | %{FileCheck} --check-prefix CHECK-CORE %s + # CHECK-CORE-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux + # +-# RUN: %{readelf} -d %{package_path}/usr/lib/libsourcekitdInProc.so | %{FileCheck} --check-prefix CHECK-SK %s ++# RUN: %{readelf} -d %{package_path}/lib/libsourcekitdInProc.so | %{FileCheck} --check-prefix CHECK-SK %s + # CHECK-SK-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux + # +-# RUN: %{readelf} -d %{package_path}/usr/lib/swift/linux/libswiftRemoteMirror.so | %{FileCheck} --check-prefix CHECK-RM %s ++# RUN: %{readelf} -d %{package_path}/lib/swift/linux/libswiftRemoteMirror.so | %{FileCheck} --check-prefix CHECK-RM %s + # CHECK-RM-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux + # +-# RUN: %{readelf} -d %{package_path}/usr/lib/swift/linux/libswift_Differentiation.so | %{FileCheck} --check-prefix CHECK-SD %s ++# RUN: %{readelf} -d %{package_path}/lib/swift/linux/libswift_Differentiation.so | %{FileCheck} --check-prefix CHECK-SD %s + # CHECK-SD-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux + # +-# RUN: %{readelf} -d %{package_path}/usr/lib/swift/linux/lib_InternalSwiftSyntaxParser.so | %{FileCheck} --check-prefix CHECK-SP %s ++# RUN: %{readelf} -d %{package_path}/lib/swift/linux/lib_InternalSwiftSyntaxParser.so | %{FileCheck} --check-prefix CHECK-SP %s + # CHECK-SP-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux + # +-# RUN: %{readelf} -d %{package_path}/usr/lib/swift/linux/libswiftGlibc.so | %{FileCheck} --check-prefix CHECK-SG %s ++# RUN: %{readelf} -d %{package_path}/lib/swift/linux/libswiftGlibc.so | %{FileCheck} --check-prefix CHECK-SG %s + # CHECK-SG-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux + # +-# RUN: %{readelf} -d %{package_path}/usr/lib/swift/linux/libswiftSwiftOnoneSupport.so | %{FileCheck} --check-prefix CHECK-SON %s ++# RUN: %{readelf} -d %{package_path}/lib/swift/linux/libswiftSwiftOnoneSupport.so | %{FileCheck} --check-prefix CHECK-SON %s + # CHECK-SON-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux + # +-# RUN: %{readelf} -d %{package_path}/usr/lib/libswiftDemangle.so | %{FileCheck} --check-prefix CHECK-SDE %s ++# RUN: %{readelf} -d %{package_path}/lib/libswiftDemangle.so | %{FileCheck} --check-prefix CHECK-SDE %s + # CHECK-SDE-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux +Index: swiftlang-5.7.2/swift/utils/build-script-impl +=================================================================== +--- swiftlang-5.7.2.orig/swift/utils/build-script-impl ++++ swiftlang-5.7.2/swift/utils/build-script-impl +@@ -3463,8 +3463,10 @@ function build_and_test_installable_pack + + if [[ "${host}" == "macosx-"* ]] || [[ "${host}" == "merged-hosts" ]]; then + PKG_TESTS_SANDBOX="${PKG_TESTS_SANDBOX_PARENT}"/"${TOOLCHAIN_PREFIX}" ++ PKG_TESTS_PKG_DIR="${PKG_TESTS_SANDBOX}" + else # Linux + PKG_TESTS_SANDBOX="${PKG_TESTS_SANDBOX_PARENT}" ++ PKG_TESTS_PKG_DIR="${PKG_TESTS_SANDBOX}/${host_install_prefix}" + fi + + LIT_EXECUTABLE_PATH="${LLVM_SOURCE_DIR}/utils/lit/lit.py" +@@ -3479,7 +3481,7 @@ function build_and_test_installable_pack + TIMEOUT_ARGS=--timeout=1200 # 20 minutes + fi + with_pushd "${PKG_TESTS_SOURCE_DIR}" \ +- call python3 "${LIT_EXECUTABLE_PATH}" . -sv --param package-path="${PKG_TESTS_SANDBOX}" --param test-exec-root="${PKG_TESTS_TEMPS}" --param llvm-bin-dir="${LLVM_BIN_DIR}" ${TIMEOUT_ARGS} ++ call python3 "${LIT_EXECUTABLE_PATH}" . -sv --param package-path="${PKG_TESTS_PKG_DIR}" --param test-exec-root="${PKG_TESTS_TEMPS}" --param llvm-bin-dir="${LLVM_BIN_DIR}" ${TIMEOUT_ARGS} + fi + fi + } diff --git a/platforms/Linux/DEB/Ubuntu/shared/debian/patches/fix-toolchain-path b/platforms/Linux/DEB/Ubuntu/shared/debian/patches/fix-toolchain-path new file mode 100644 index 00000000..b66289ea --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/shared/debian/patches/fix-toolchain-path @@ -0,0 +1,42 @@ +Description: Fix toolchain path for build-script-helper.py + Make sure the correct path is passed to the script, and remove + assumption that /usr is used. +Author: Julien Blache + +Index: swiftlang-5.7.2/swift/benchmark/scripts/build_script_helper.py +=================================================================== +--- swiftlang-5.7.2.orig/swift/benchmark/scripts/build_script_helper.py ++++ swiftlang-5.7.2/swift/benchmark/scripts/build_script_helper.py +@@ -51,7 +51,7 @@ def main(): + if not os.path.isdir(bin_dir): + os.makedirs(bin_dir) + +- swiftbuild_path = os.path.join(args.toolchain, "usr", "bin", "swift-build") ++ swiftbuild_path = os.path.join(args.toolchain, "bin", "swift-build") + perform_build(args, swiftbuild_path, "debug", "Benchmark_Onone", "-Onone") + perform_build(args, swiftbuild_path, "release", "Benchmark_Osize", "-Osize") + perform_build(args, swiftbuild_path, "release", "Benchmark_O", "-O") +Index: swiftlang-5.7.2/swift/utils/swift_build_support/swift_build_support/products/benchmarks.py +=================================================================== +--- swiftlang-5.7.2.orig/swift/utils/swift_build_support/swift_build_support/products/benchmarks.py ++++ swiftlang-5.7.2/swift/utils/swift_build_support/swift_build_support/products/benchmarks.py +@@ -100,11 +100,17 @@ class Benchmarks(product.Product): + + + def _get_toolchain_path(host_target, product, args): +- # TODO check if we should prefer using product.install_toolchain_path + # this logic initially was inside run_build_script_helper + # and was factored out so it can be used in testing as well + +- toolchain_path = product.host_install_destdir(host_target) ++ install_destdir = args.install_destdir ++ if swiftpm.SwiftPM.has_cross_compile_hosts(args): ++ install_destdir = swiftpm.SwiftPM.get_install_destdir(args, ++ host_target, ++ product.build_dir) ++ toolchain_path = targets.toolchain_path(install_destdir, ++ args.install_prefix) ++ + if platform.system() == 'Darwin': + # The prefix is an absolute path, so concatenate without os.path. + toolchain_path += \ diff --git a/platforms/Linux/DEB/Ubuntu/shared/debian/patches/python3_hwasan_symbolize b/platforms/Linux/DEB/Ubuntu/shared/debian/patches/python3_hwasan_symbolize new file mode 100644 index 00000000..04c59eef --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/shared/debian/patches/python3_hwasan_symbolize @@ -0,0 +1,14 @@ +Description: Fix hwasan_symbolize to call python3 + On Ubuntu, /usr/bin/python is still python 2.x. +Author: Julien Blache + +Index: swiftlang-5.7.2/llvm-project/compiler-rt/lib/hwasan/scripts/hwasan_symbolize +=================================================================== +--- swiftlang-5.7.2.orig/llvm-project/compiler-rt/lib/hwasan/scripts/hwasan_symbolize ++++ swiftlang-5.7.2/llvm-project/compiler-rt/lib/hwasan/scripts/hwasan_symbolize +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + #===- lib/hwasan/scripts/hwasan_symbolize ----------------------------------===# + # + # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. diff --git a/platforms/Linux/DEB/Ubuntu/shared/debian/patches/series b/platforms/Linux/DEB/Ubuntu/shared/debian/patches/series new file mode 100644 index 00000000..33cab02d --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/shared/debian/patches/series @@ -0,0 +1,5 @@ +python3_hwasan_symbolize +cmake_parallel_bootstrap +build-preset-install-dir +fix-toolchain-path +fix-integration-tests-package-path diff --git a/platforms/Linux/DEB/Ubuntu/shared/debian/rules b/platforms/Linux/DEB/Ubuntu/shared/debian/rules new file mode 100755 index 00000000..ae9d2106 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/shared/debian/rules @@ -0,0 +1,96 @@ +#!/usr/bin/make -f +# See debhelper(7) (uncomment to enable) +# output every command that modifies files on the build system. +#export DH_VERBOSE = 1 + +BUILD_SCRIPT_ARGS = +ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) + NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) + BUILD_SCRIPT_ARGS += -j $(NUMJOBS) +endif + +# Verbose Swift build +export VERBOSE=1 + +SWIFTLANG_PKG_VER=$(shell dpkg-parsechangelog -S Version | sed -e 's/-[^-]*$$//') +SWIFT_BUILDDIR=$(CURDIR)/build + + +export DEB_BUILD_MAINT_OPTIONS=hardening=+format,+fortify,+stackprotectorstrong,+relro,optimize=-lto +export MOD_CXXFLAGS=$(DEB_CXXFLAGS_STRIP="-ffat-lto-objects -flto=auto -flto=auto" dpkg-buildflags --get CXXFLAGS) +export MOD_CFLAGS=$(DEB_CFLAGS_STRIP="-ffat-lto-objects -flto=auto -flto=auto" dpkg-buildflags --get CFLAGS) +export MOD_LDFLAGS=$(DEB_LDFLAGS_STRIP="-ffat-lto-objects -flto=auto -flto=auto" dpkg-buildflags --get LDFLAGS) + +%: + dh $@ + +clean:: + dh_testdir + + # Generate debian/control and others + sed -e 's/x.y.z/$(SWIFTLANG_PKG_VER)/g' < debian/control.in > debian/control + sed -e 's/X.Y.Z/$(SWIFTLANG_PKG_VER)/g' < debian/swiftlang.install.in > debian/swiftlang-$(SWIFTLANG_PKG_VER).install + sed -e 's/X.Y.Z/$(SWIFTLANG_PKG_VER)/g' < debian/libswiftlang.install.in > debian/libswiftlang-$(SWIFTLANG_PKG_VER).install + sed -e 's/X.Y.Z/$(SWIFTLANG_PKG_VER)/g' < debian/libswiftlang-dev.install.in > debian/libswiftlang-$(SWIFTLANG_PKG_VER)-dev.install + sed -e 's/X.Y.Z/$(SWIFTLANG_PKG_VER)/g' < debian/swiftlang.alternatives.in > debian/swiftlang-$(SWIFTLANG_PKG_VER)-bin.alternatives + rm -rf $(SWIFT_BUILDDIR) + + # Modified during the build + rm -f swift-corelibs-libdispatch/dispatch/module.modulemap + rm -f swift-corelibs-libdispatch/private/module.modulemap + + # Python byte-compiled files + find swift/utils -name '*.pyc' -delete + find llvm-project -name '*.pyc' -delete + find cmark/test -name '*.pyc' -delete + find swiftpm -name '*.pyc' -delete + + dh_clean + +override_dh_auto_clean: + # Disabled; we have a non-standard build system that the tool + # doesn't support, so be on the safe side and avoid any potential + # false-triggering. + +override_dh_update_autotools_config: + # Don't go and update config.guess/config.sub, it causes LLVM to + # pick up the x86_64-pc-linux-gnu triplet instead of the expected + # x86_64-unknown-linux-gnu. This causes Swift modules to break. + +override_dh_autoreconf: + # We'd rather not do that either, see above. + +override_dh_shlibdeps: + dh_shlibdeps -- -xlibswiftlang-$(SWIFTLANG_PKG_VER) + +override_dh_dwz: + # Disable DWARF debug info compression; it is failing, so we'll + # need to investigate whether or not it is suitable for us. + +override_dh_auto_build: + echo "Build flags:" + echo $MOD_CXXFLAGS: {MOD_CXXFLAGS} + echo $MOD_CFLAGS: {MOD_CFLAGS} + echo $MOD_LDFLAGS: {MOD_LDFLAGS} + # on Jammy, default compiler & linker flags include -ffat-lto-objects and -flto=auto, which clang 13 does not appreciate. + # TODO: Replace the below fixed flags with ${MOD_CXXFLAGS}, ${MOD_CFLAGS}, ${MOD_LDFLAGS} ... above + # (the fixed flags are used because dpkg-buildflags mysteriously outputs empty strings specifically when called from debuild) + CFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security" \ + CXXFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security" \ + LDFLAGS="-Wl,-Bsymbolic-functions -Wl,-z,relro" \ + swift/utils/build-script $(BUILD_SCRIPT_ARGS) --preset=buildbot_linux,no_assertions,no_test \ + install_prefix=/usr/lib/swiftlang/$(SWIFTLANG_PKG_VER) \ + install_destdir=$(SWIFT_BUILDDIR)/discard \ + installable_package=$(SWIFT_BUILDDIR)/swiftdeb-$(SWIFTLANG_PKG_VER).tar.gz + +override_dh_auto_install: + # The build script preset used above will build, install, package, + # and test the resulting tarball. We could split all this into 2 + # or more presets and run them in sequence as expected here, but + # for now we'll just unpack the (tested) tarball and go from there. + + mkdir -p $(CURDIR)/debian/tmp + tar -C $(CURDIR)/debian/tmp -xzf $(SWIFT_BUILDDIR)/swiftdeb-$(SWIFTLANG_PKG_VER).tar.gz + + # Manually compress manpages, since they are in a non-standard location + find $(CURDIR)/debian/tmp/usr/lib/swiftlang/$(SWIFTLANG_PKG_VER)/share/man -type f -exec gzip \{\} \; diff --git a/platforms/Linux/DEB/Ubuntu/shared/debian/swiftlang.alternatives.in b/platforms/Linux/DEB/Ubuntu/shared/debian/swiftlang.alternatives.in new file mode 100644 index 00000000..71fcd3b1 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/shared/debian/swiftlang.alternatives.in @@ -0,0 +1,9 @@ +Name: swiftlang +Link: /usr/bin/swift +Alternative: /usr/lib/swiftlang/X.Y.Z/bin/swift-frontend +Dependents: + /usr/bin/swiftc swiftc /usr/lib/swiftlang/X.Y.Z/bin/swift-frontend + /usr/bin/swift-lldb swift-lldb /usr/lib/swiftlang/X.Y.Z/bin/lldb + /usr/bin/sourcekit-lsp swift-sourcekit-lsp /usr/lib/swiftlang/X.Y.Z/bin/sourcekit-lsp + /usr/share/man/man1/swift.1.gz swift-man.1.gz /usr/lib/swiftlang/X.Y.Z/share/man/man1/swift.1.gz +Priority: 50 diff --git a/platforms/Linux/DEB/Ubuntu/shared/debian/swiftlang.install.in b/platforms/Linux/DEB/Ubuntu/shared/debian/swiftlang.install.in new file mode 100644 index 00000000..268f09a2 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/shared/debian/swiftlang.install.in @@ -0,0 +1,9 @@ +usr/lib/swiftlang/X.Y.Z/bin/* +usr/lib/swiftlang/X.Y.Z/lib/*.so* +usr/lib/swiftlang/X.Y.Z/lib/swift/pm/ManifestAPI/*.so* +usr/lib/swiftlang/X.Y.Z/lib/swift/pm/PluginAPI/*.so* +usr/lib/swiftlang/X.Y.Z/lib/swift/pm/llbuild/*.so* +usr/lib/swiftlang/X.Y.Z/lib/clang/*/bin/* +usr/lib/swiftlang/X.Y.Z/lib/clang/*/share/* +usr/lib/swiftlang/X.Y.Z/lib/clang/*/lib/linux/*.so* +usr/lib/swiftlang/X.Y.Z/share/* From e300a236a409cb16cb737d982aac178a1396d61a Mon Sep 17 00:00:00 2001 From: Matias Piipari Date: Mon, 2 Jan 2023 14:17:50 +0200 Subject: [PATCH 05/13] Fix to installing files to swiftlang-X.Y.X-bin --- platforms/Linux/DEB/Ubuntu/focal/debian/changelog | 2 +- .../DEB/Ubuntu/focal/debian/swiftlang.alternatives.in | 1 - .../Linux/DEB/Ubuntu/focal/debian/swiftlang.postinst.in | 1 + .../Linux/DEB/Ubuntu/focal/debian/swiftlang.prerm.in | 1 + platforms/Linux/DEB/Ubuntu/jammy/debian/changelog | 2 +- .../DEB/Ubuntu/jammy/debian/swiftlang.alternatives.in | 1 - .../Linux/DEB/Ubuntu/jammy/debian/swiftlang.postinst.in | 1 + .../Linux/DEB/Ubuntu/jammy/debian/swiftlang.prerm.in | 1 + platforms/Linux/DEB/Ubuntu/shared/debian/rules | 9 +++++++-- .../Linux/DEB/Ubuntu/shared/debian/swiftlang.postinst.in | 7 +++++++ .../Linux/DEB/Ubuntu/shared/debian/swiftlang.prerm.in | 5 +++++ 11 files changed, 25 insertions(+), 6 deletions(-) delete mode 120000 platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.alternatives.in create mode 120000 platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.postinst.in create mode 120000 platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.prerm.in delete mode 120000 platforms/Linux/DEB/Ubuntu/jammy/debian/swiftlang.alternatives.in create mode 120000 platforms/Linux/DEB/Ubuntu/jammy/debian/swiftlang.postinst.in create mode 120000 platforms/Linux/DEB/Ubuntu/jammy/debian/swiftlang.prerm.in create mode 100644 platforms/Linux/DEB/Ubuntu/shared/debian/swiftlang.postinst.in create mode 100644 platforms/Linux/DEB/Ubuntu/shared/debian/swiftlang.prerm.in diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/changelog b/platforms/Linux/DEB/Ubuntu/focal/debian/changelog index 2591bf95..cbcf99da 100644 --- a/platforms/Linux/DEB/Ubuntu/focal/debian/changelog +++ b/platforms/Linux/DEB/Ubuntu/focal/debian/changelog @@ -1,4 +1,4 @@ -swiftlang (5.7.2-0~focal3) focal; urgency=medium +swiftlang (5.7.2-0~focal4) focal; urgency=medium * Replaces `swiftlang` + `swiftlang-X.Y.Z` packages with `libswiftlang-X.Y.Z`, `libswiftlang-X.Y.Z-dev`, `swiftlang-X.Y.Z-bin` and meta-package `swiftlang`. diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.alternatives.in b/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.alternatives.in deleted file mode 120000 index efe172cd..00000000 --- a/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.alternatives.in +++ /dev/null @@ -1 +0,0 @@ -../../shared/debian/swiftlang.alternatives.in \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.postinst.in b/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.postinst.in new file mode 120000 index 00000000..2555961a --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.postinst.in @@ -0,0 +1 @@ +../../shared/debian/swiftlang.postinst.in \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.prerm.in b/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.prerm.in new file mode 120000 index 00000000..d7b66f22 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/focal/debian/swiftlang.prerm.in @@ -0,0 +1 @@ +../../shared/debian/swiftlang.prerm.in \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/jammy/debian/changelog b/platforms/Linux/DEB/Ubuntu/jammy/debian/changelog index 132c3df4..b3795fe4 100644 --- a/platforms/Linux/DEB/Ubuntu/jammy/debian/changelog +++ b/platforms/Linux/DEB/Ubuntu/jammy/debian/changelog @@ -1,4 +1,4 @@ -swiftlang (5.7.2-0~jammy3) jammy; urgency=medium +swiftlang (5.7.2-0~jammy4) jammy; urgency=medium * Replaces `swiftlang` + `swiftlang-X.Y.Z` packages with `libswiftlang-X.Y.Z`, `libswiftlang-X.Y.Z-dev`, `swiftlang-X.Y.Z-bin` and meta-package `swiftlang`. diff --git a/platforms/Linux/DEB/Ubuntu/jammy/debian/swiftlang.alternatives.in b/platforms/Linux/DEB/Ubuntu/jammy/debian/swiftlang.alternatives.in deleted file mode 120000 index efe172cd..00000000 --- a/platforms/Linux/DEB/Ubuntu/jammy/debian/swiftlang.alternatives.in +++ /dev/null @@ -1 +0,0 @@ -../../shared/debian/swiftlang.alternatives.in \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/jammy/debian/swiftlang.postinst.in b/platforms/Linux/DEB/Ubuntu/jammy/debian/swiftlang.postinst.in new file mode 120000 index 00000000..2555961a --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/jammy/debian/swiftlang.postinst.in @@ -0,0 +1 @@ +../../shared/debian/swiftlang.postinst.in \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/jammy/debian/swiftlang.prerm.in b/platforms/Linux/DEB/Ubuntu/jammy/debian/swiftlang.prerm.in new file mode 120000 index 00000000..d7b66f22 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/jammy/debian/swiftlang.prerm.in @@ -0,0 +1 @@ +../../shared/debian/swiftlang.prerm.in \ No newline at end of file diff --git a/platforms/Linux/DEB/Ubuntu/shared/debian/rules b/platforms/Linux/DEB/Ubuntu/shared/debian/rules index ae9d2106..2b1f73d7 100755 --- a/platforms/Linux/DEB/Ubuntu/shared/debian/rules +++ b/platforms/Linux/DEB/Ubuntu/shared/debian/rules @@ -29,10 +29,15 @@ clean:: # Generate debian/control and others sed -e 's/x.y.z/$(SWIFTLANG_PKG_VER)/g' < debian/control.in > debian/control - sed -e 's/X.Y.Z/$(SWIFTLANG_PKG_VER)/g' < debian/swiftlang.install.in > debian/swiftlang-$(SWIFTLANG_PKG_VER).install + sed -e 's/X.Y.Z/$(SWIFTLANG_PKG_VER)/g' < debian/swiftlang.install.in > debian/swiftlang-$(SWIFTLANG_PKG_VER)-bin.install sed -e 's/X.Y.Z/$(SWIFTLANG_PKG_VER)/g' < debian/libswiftlang.install.in > debian/libswiftlang-$(SWIFTLANG_PKG_VER).install sed -e 's/X.Y.Z/$(SWIFTLANG_PKG_VER)/g' < debian/libswiftlang-dev.install.in > debian/libswiftlang-$(SWIFTLANG_PKG_VER)-dev.install - sed -e 's/X.Y.Z/$(SWIFTLANG_PKG_VER)/g' < debian/swiftlang.alternatives.in > debian/swiftlang-$(SWIFTLANG_PKG_VER)-bin.alternatives + sed -e 's/X.Y.Z/$(SWIFTLANG_PKG_VER)/g' < debian/swiftlang.postinst.in > debian/swiftlang-$(SWIFTLANG_PKG_VER)-bin.postinst + sed -e 's/X.Y.Z/$(SWIFTLANG_PKG_VER)/g' < debian/swiftlang.prerm.in > debian/swiftlang-$(SWIFTLANG_PKG_VER)-bin.prerm + + chmod ugo+x debian/swiftlang-$(SWIFTLANG_PKG_VER)-bin.postinst + chmod ugo+x debian/swiftlang-$(SWIFTLANG_PKG_VER)-bin.prerm + rm -rf $(SWIFT_BUILDDIR) # Modified during the build diff --git a/platforms/Linux/DEB/Ubuntu/shared/debian/swiftlang.postinst.in b/platforms/Linux/DEB/Ubuntu/shared/debian/swiftlang.postinst.in new file mode 100644 index 00000000..64dfd819 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/shared/debian/swiftlang.postinst.in @@ -0,0 +1,7 @@ +#!/bin/sh -e + +update-alternatives --install /usr/bin/swift swiftlang /usr/lib/swiftlang/X.Y.Z/bin/swift-frontend 50 \ + --slave /usr/bin/swiftc swiftc /usr/lib/swiftlang/X.Y.Z/bin/swift-frontend \ + --slave /usr/bin/swift-lldb swift-lldb /usr/lib/swiftlang/X.Y.Z/bin/lldb \ + --slave /usr/bin/sourcekit-lsp swift-sourcekit-lsp /usr/lib/swiftlang/X.Y.Z/bin/sourcekit-lsp \ + --slave /usr/share/man/man1/swift.1.gz swift-man.1.gz /usr/lib/swiftlang/X.Y.Z/share/man/man1/swift.1.gz diff --git a/platforms/Linux/DEB/Ubuntu/shared/debian/swiftlang.prerm.in b/platforms/Linux/DEB/Ubuntu/shared/debian/swiftlang.prerm.in new file mode 100644 index 00000000..bed41129 --- /dev/null +++ b/platforms/Linux/DEB/Ubuntu/shared/debian/swiftlang.prerm.in @@ -0,0 +1,5 @@ +#!/bin/sh -e + +if [ "$1" = remove ] || [ "$1" = deconfigure ]; then + update-alternatives --remove swiftlang /usr/bin/swift +fi From 7dd1572b877dde8eb2c127f77f38eaafce00d3c8 Mon Sep 17 00:00:00 2001 From: Matias Piipari Date: Mon, 2 Jan 2023 15:54:51 +0200 Subject: [PATCH 06/13] Exclude swiftlang-X.Y.Z-bin from shared library dependencies to avoid a self-reference --- platforms/Linux/DEB/Ubuntu/focal/debian/changelog | 2 +- platforms/Linux/DEB/Ubuntu/jammy/debian/changelog | 2 +- platforms/Linux/DEB/Ubuntu/shared/debian/rules | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/platforms/Linux/DEB/Ubuntu/focal/debian/changelog b/platforms/Linux/DEB/Ubuntu/focal/debian/changelog index cbcf99da..69aa8af1 100644 --- a/platforms/Linux/DEB/Ubuntu/focal/debian/changelog +++ b/platforms/Linux/DEB/Ubuntu/focal/debian/changelog @@ -1,4 +1,4 @@ -swiftlang (5.7.2-0~focal4) focal; urgency=medium +swiftlang (5.7.2-0~focal5) focal; urgency=medium * Replaces `swiftlang` + `swiftlang-X.Y.Z` packages with `libswiftlang-X.Y.Z`, `libswiftlang-X.Y.Z-dev`, `swiftlang-X.Y.Z-bin` and meta-package `swiftlang`. diff --git a/platforms/Linux/DEB/Ubuntu/jammy/debian/changelog b/platforms/Linux/DEB/Ubuntu/jammy/debian/changelog index b3795fe4..e5c2f5f9 100644 --- a/platforms/Linux/DEB/Ubuntu/jammy/debian/changelog +++ b/platforms/Linux/DEB/Ubuntu/jammy/debian/changelog @@ -1,4 +1,4 @@ -swiftlang (5.7.2-0~jammy4) jammy; urgency=medium +swiftlang (5.7.2-0~jammy5) jammy; urgency=medium * Replaces `swiftlang` + `swiftlang-X.Y.Z` packages with `libswiftlang-X.Y.Z`, `libswiftlang-X.Y.Z-dev`, `swiftlang-X.Y.Z-bin` and meta-package `swiftlang`. diff --git a/platforms/Linux/DEB/Ubuntu/shared/debian/rules b/platforms/Linux/DEB/Ubuntu/shared/debian/rules index 2b1f73d7..09477713 100755 --- a/platforms/Linux/DEB/Ubuntu/shared/debian/rules +++ b/platforms/Linux/DEB/Ubuntu/shared/debian/rules @@ -66,7 +66,7 @@ override_dh_autoreconf: # We'd rather not do that either, see above. override_dh_shlibdeps: - dh_shlibdeps -- -xlibswiftlang-$(SWIFTLANG_PKG_VER) + dh_shlibdeps -- -xlibswiftlang-$(SWIFTLANG_PKG_VER) -xswiftlang-$(SWIFTLANG_PKG_VER)-bin override_dh_dwz: # Disable DWARF debug info compression; it is failing, so we'll From febb450fbcd26d0f32cb865a83b215b7b7eaadcf Mon Sep 17 00:00:00 2001 From: Matias Piipari Date: Mon, 2 Jan 2023 17:07:48 +0200 Subject: [PATCH 07/13] Change from a branch to a tag based trigger --- .github/workflows/build-ubuntu-debs.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-ubuntu-debs.yaml b/.github/workflows/build-ubuntu-debs.yaml index 49673e31..d3d65233 100644 --- a/.github/workflows/build-ubuntu-debs.yaml +++ b/.github/workflows/build-ubuntu-debs.yaml @@ -1,8 +1,8 @@ name: Build signed src package for Launchpad binary build & PPA distrib - on: push: - branches: [main, ubuntu-for-5.7.2] + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' jobs: build-ubuntu-packages: From c367a8cf5d54ac47493a29448276b7487d4c6315 Mon Sep 17 00:00:00 2001 From: Matias Piipari Date: Mon, 2 Jan 2023 17:10:57 +0200 Subject: [PATCH 08/13] Remove some redundant env vars from the GH workflow --- .github/workflows/build-ubuntu-debs.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build-ubuntu-debs.yaml b/.github/workflows/build-ubuntu-debs.yaml index d3d65233..d056abf6 100644 --- a/.github/workflows/build-ubuntu-debs.yaml +++ b/.github/workflows/build-ubuntu-debs.yaml @@ -47,7 +47,4 @@ jobs: - name: Upload to Launchpad for binary build working-directory: /output run: dput ppa:swiftlang/swiftlang swiftlang_*_source.changes - env: - DEBEMAIL: ${{ secrets.DEBEMAIL }} - DEBFULLNAME: ${{ secrets.DEBFULLNAME }} - DEBSIGN_KEYID: ${{secrets.DEBSIGN_KEYID }} + From 579af9663cfbd5abebf400848181eb3f3cd030bb Mon Sep 17 00:00:00 2001 From: Matias Piipari Date: Mon, 2 Jan 2023 17:19:07 +0200 Subject: [PATCH 09/13] Add back --no-install-recommends --- platforms/Linux/DEB/Shared/build_deb.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platforms/Linux/DEB/Shared/build_deb.sh b/platforms/Linux/DEB/Shared/build_deb.sh index 6aaf28cd..129270e2 100755 --- a/platforms/Linux/DEB/Shared/build_deb.sh +++ b/platforms/Linux/DEB/Shared/build_deb.sh @@ -48,7 +48,7 @@ else root_cmd="--root-cmd=sudo" fi -mk-build-deps --install ${package_dir}/debian/control ${root_cmd} --remove --tool 'apt-get -y -o Debug::pkgProblemResolver=yes' +mk-build-deps --install ${package_dir}/debian/control ${root_cmd} --remove --tool 'apt-get -y -o Debug::pkgProblemResolver=yes --no-install-recommends' # build the installable package From a30222a771489532adce4187961c75ecaf261df0 Mon Sep 17 00:00:00 2001 From: Matias Piipari Date: Mon, 2 Jan 2023 17:19:49 +0200 Subject: [PATCH 10/13] Remove --no-lintian from the source package build case --- platforms/Linux/DEB/Shared/build_deb.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platforms/Linux/DEB/Shared/build_deb.sh b/platforms/Linux/DEB/Shared/build_deb.sh index 129270e2..a4a13585 100755 --- a/platforms/Linux/DEB/Shared/build_deb.sh +++ b/platforms/Linux/DEB/Shared/build_deb.sh @@ -56,7 +56,7 @@ mk-build-deps --install ${package_dir}/debian/control ${root_cmd} --remove --too cd ${package_dir} if [ "$source_only_pkg" == "TRUE" ]; then - DEB_BUILD_OPTIONS=parallel=64 debuild --no-lintian -uc -us -sa -S + DEB_BUILD_OPTIONS=parallel=64 debuild -uc -us -sa -S else DEB_BUILD_OPTIONS=parallel=64 debuild fi From d4a372f292b047264986fa588d3d65a5f6e3dc97 Mon Sep 17 00:00:00 2001 From: Matias Piipari Date: Mon, 2 Jan 2023 17:40:29 +0200 Subject: [PATCH 11/13] Remove optimize=-lto which lintian warns about (I think on focal only?) --- platforms/Linux/DEB/Ubuntu/shared/debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platforms/Linux/DEB/Ubuntu/shared/debian/rules b/platforms/Linux/DEB/Ubuntu/shared/debian/rules index 09477713..728cfaf2 100755 --- a/platforms/Linux/DEB/Ubuntu/shared/debian/rules +++ b/platforms/Linux/DEB/Ubuntu/shared/debian/rules @@ -16,7 +16,7 @@ SWIFTLANG_PKG_VER=$(shell dpkg-parsechangelog -S Version | sed -e 's/-[^-]*$$//' SWIFT_BUILDDIR=$(CURDIR)/build -export DEB_BUILD_MAINT_OPTIONS=hardening=+format,+fortify,+stackprotectorstrong,+relro,optimize=-lto +export DEB_BUILD_MAINT_OPTIONS=hardening=+format,+fortify,+stackprotectorstrong,+relro export MOD_CXXFLAGS=$(DEB_CXXFLAGS_STRIP="-ffat-lto-objects -flto=auto -flto=auto" dpkg-buildflags --get CXXFLAGS) export MOD_CFLAGS=$(DEB_CFLAGS_STRIP="-ffat-lto-objects -flto=auto -flto=auto" dpkg-buildflags --get CFLAGS) export MOD_LDFLAGS=$(DEB_LDFLAGS_STRIP="-ffat-lto-objects -flto=auto -flto=auto" dpkg-buildflags --get LDFLAGS) From ccfce2e8731f277ec561fc330b806674d67d7c82 Mon Sep 17 00:00:00 2001 From: Matias Piipari Date: Mon, 2 Jan 2023 17:47:46 +0200 Subject: [PATCH 12/13] Fixes to some debug logging in debian/rules --- platforms/Linux/DEB/Ubuntu/shared/debian/rules | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platforms/Linux/DEB/Ubuntu/shared/debian/rules b/platforms/Linux/DEB/Ubuntu/shared/debian/rules index 728cfaf2..e8ced2e6 100755 --- a/platforms/Linux/DEB/Ubuntu/shared/debian/rules +++ b/platforms/Linux/DEB/Ubuntu/shared/debian/rules @@ -74,9 +74,9 @@ override_dh_dwz: override_dh_auto_build: echo "Build flags:" - echo $MOD_CXXFLAGS: {MOD_CXXFLAGS} - echo $MOD_CFLAGS: {MOD_CFLAGS} - echo $MOD_LDFLAGS: {MOD_LDFLAGS} + echo "MOD_CXXFLAGS: ${MOD_CXXFLAGS}" + echo "MOD_CFLAGS: ${MOD_CFLAGS}" + echo "MOD_LDFLAGS: ${MOD_LDFLAGS}" # on Jammy, default compiler & linker flags include -ffat-lto-objects and -flto=auto, which clang 13 does not appreciate. # TODO: Replace the below fixed flags with ${MOD_CXXFLAGS}, ${MOD_CFLAGS}, ${MOD_LDFLAGS} ... above # (the fixed flags are used because dpkg-buildflags mysteriously outputs empty strings specifically when called from debuild) From 9e25fbd64b2bdd6e3917bb0cb79a48c08b0089d8 Mon Sep 17 00:00:00 2001 From: Matias Piipari Date: Mon, 2 Jan 2023 18:10:38 +0200 Subject: [PATCH 13/13] Remove swiftlang.alternatives.in since alternatives are managed by pre-install and post-removal actions instead. --- .../DEB/Ubuntu/shared/debian/swiftlang.alternatives.in | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 platforms/Linux/DEB/Ubuntu/shared/debian/swiftlang.alternatives.in diff --git a/platforms/Linux/DEB/Ubuntu/shared/debian/swiftlang.alternatives.in b/platforms/Linux/DEB/Ubuntu/shared/debian/swiftlang.alternatives.in deleted file mode 100644 index 71fcd3b1..00000000 --- a/platforms/Linux/DEB/Ubuntu/shared/debian/swiftlang.alternatives.in +++ /dev/null @@ -1,9 +0,0 @@ -Name: swiftlang -Link: /usr/bin/swift -Alternative: /usr/lib/swiftlang/X.Y.Z/bin/swift-frontend -Dependents: - /usr/bin/swiftc swiftc /usr/lib/swiftlang/X.Y.Z/bin/swift-frontend - /usr/bin/swift-lldb swift-lldb /usr/lib/swiftlang/X.Y.Z/bin/lldb - /usr/bin/sourcekit-lsp swift-sourcekit-lsp /usr/lib/swiftlang/X.Y.Z/bin/sourcekit-lsp - /usr/share/man/man1/swift.1.gz swift-man.1.gz /usr/lib/swiftlang/X.Y.Z/share/man/man1/swift.1.gz -Priority: 50