Skip to content

[6.2] Cherry-pick several Android & FreeBSD fixes #707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/scripts/linux_pre_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/bin/bash
##===----------------------------------------------------------------------===##
##
## This source file is part of the Swift open source project
##
## Copyright (c) 2025 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 the list of Swift project authors
##
##===----------------------------------------------------------------------===##

set -e

if command -v apt-get >/dev/null 2>&1 ; then # bookworm, noble, jammy
export DEBIAN_FRONTEND=noninteractive

apt-get update -y

# Build dependencies
apt-get install -y libsqlite3-dev libncurses-dev

# Debug symbols
apt-get install -y libc6-dbg

if [[ "$INSTALL_CMAKE" == "1" ]] ; then
apt-get install -y cmake ninja-build
fi

# Android NDK
dpkg_architecture="$(dpkg --print-architecture)"
if [[ "$SKIP_ANDROID" != "1" ]] && [[ "$dpkg_architecture" == amd64 ]] ; then
eval "$(cat /etc/lsb-release)"
case "$DISTRIB_CODENAME" in
bookworm|jammy)
: # Not available
;;
noble)
apt-get install -y google-android-ndk-r26c-installer
;;
*)
echo "Unknown distribution: $DISTRIB_CODENAME" >&2
exit 1
esac
else
echo "Skipping Android NDK installation on $dpkg_architecture" >&2
fi
elif command -v dnf >/dev/null 2>&1 ; then # rhel-ubi9
dnf update -y

# Build dependencies
dnf install -y sqlite-devel ncurses-devel

# Debug symbols
dnf debuginfo-install -y glibc
elif command -v yum >/dev/null 2>&1 ; then # amazonlinux2
yum update -y

# Build dependencies
yum install -y sqlite-devel ncurses-devel

# Debug symbols
yum install -y yum-utils
debuginfo-install -y glibc
fi
36 changes: 2 additions & 34 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,7 @@ jobs:
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
with:
linux_os_versions: '["noble", "jammy", "rhel-ubi9"]'
linux_pre_build_command: |
if command -v apt-get >/dev/null 2>&1 ; then # bookworm, noble, jammy
apt-get update -y

# Build dependencies
apt-get install -y libsqlite3-dev libncurses-dev

# Debug symbols
apt-get install -y libc6-dbg
elif command -v dnf >/dev/null 2>&1 ; then # rhel-ubi9
dnf update -y

# Build dependencies
dnf install -y sqlite-devel ncurses-devel

# Debug symbols
dnf debuginfo-install -y glibc
elif command -v yum >/dev/null 2>&1 ; then # amazonlinux2
yum update -y

# Build dependencies
yum install -y sqlite-devel ncurses-devel

# Debug symbols
yum install -y yum-utils
debuginfo-install -y glibc
fi
linux_pre_build_command: ./.github/scripts/linux_pre_build.sh
linux_build_command: 'swift test --no-parallel'
linux_swift_versions: '["nightly-main", "nightly-6.2"]'
windows_swift_versions: '["nightly-main"]'
Expand All @@ -50,13 +24,7 @@ jobs:
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
with:
linux_os_versions: '["noble"]'
linux_pre_build_command: |
apt-get update -y

# Build dependencies
apt-get install -y libsqlite3-dev libncurses-dev

apt-get install -y cmake ninja-build
linux_pre_build_command: SKIP_ANDROID=1 INSTALL_CMAKE=1 ./.github/scripts/linux_pre_build.sh
linux_build_command: 'swift package -Xbuild-tools-swiftc -DUSE_PROCESS_SPAWNING_WORKAROUND cmake-smoke-test --disable-sandbox --cmake-path `which cmake` --ninja-path `which ninja` --extra-cmake-arg -DCMAKE_C_COMPILER=`which clang` --extra-cmake-arg -DCMAKE_CXX_COMPILER=`which clang++` --extra-cmake-arg -DCMAKE_Swift_COMPILER=`which swiftc`'
linux_swift_versions: '["nightly-main"]'
windows_swift_versions: '[]'
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ let package = Package(
"SWBBuildSystem",
"SWBServiceCore",
"SWBTaskExecution",
.product(name: "SystemPackage", package: "swift-system", condition: .when(platforms: [.linux, .android, .windows])),
.product(name: "SystemPackage", package: "swift-system", condition: .when(platforms: [.linux, .openbsd, .android, .windows, .custom("freebsd")])),
],
exclude: ["CMakeLists.txt"],
swiftSettings: swiftSettings(languageMode: .v5)),
Expand Down Expand Up @@ -201,7 +201,7 @@ let package = Package(
"SWBCSupport",
"SWBLibc",
.product(name: "ArgumentParser", package: "swift-argument-parser"),
.product(name: "SystemPackage", package: "swift-system", condition: .when(platforms: [.linux, .android, .windows])),
.product(name: "SystemPackage", package: "swift-system", condition: .when(platforms: [.linux, .openbsd, .android, .windows, .custom("freebsd")])),
],
exclude: ["CMakeLists.txt"],
swiftSettings: swiftSettings(languageMode: .v5)),
Expand Down
Loading
Loading