Skip to content

Update how patches are applied #7

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
May 22, 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
8 changes: 4 additions & 4 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ jobs:
strategy:
fail-fast: false
matrix:
build-type: ['docker']
#build-type: ['docker', 'local']
#build-type: ['docker']
build-type: ['docker', 'local']
# blank arch builds all (aarch64,x86_64,armv7)
arch: ['']
#arch: ['']
# builds only x86_64 to speed up the validation
#arch: ['x86_64']
# build both the quick (x86_64) and complete (aarch64,x86_64,armv7) SDKs
#arch: ['x86_64', '']
arch: ['x86_64', '']
swift-version: ['release', 'swift-6.2-branch', 'development']
runs-on: ubuntu-24.04
steps:
Expand Down
2 changes: 1 addition & 1 deletion swift-ci/sdks/android/build-docker
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ source ./scripts/toolchain-vars.sh

# Check-out and patch the sources
./scripts/fetch-source.sh --source-dir ${WORKDIR}/source --swift-tag ${SWIFT_TAG}
./scripts/patch-sources.sh ${WORKDIR}/source
${WORKDIR}/source/swift-android-patches/apply-patches.sh ${WORKDIR}/source/swift-project

mkdir -p ${WORKDIR}/products
chmod ugo+rwx ${WORKDIR}/products
Expand Down
2 changes: 1 addition & 1 deletion swift-ci/sdks/android/build-local
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fi

# Check-out and patch the sources
./scripts/fetch-source.sh --source-dir ${WORKDIR}/source --swift-tag ${SWIFT_TAG}
./scripts/patch-sources.sh ${WORKDIR}/source
${WORKDIR}/source/swift-android-patches/apply-patches.sh ${WORKDIR}/source/swift-project

mkdir -p ${WORKDIR}/products

Expand Down
11 changes: 9 additions & 2 deletions swift-ci/sdks/android/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ function versionFromTag {
}

swift_version=$(describe ${source_dir}/swift-project/swift)
swift_tag_date=$(git -C ${source_dir}/swift-project/swift log -1 --format=%ct 2>/dev/null)

if [[ $swift_version == swift-* ]]; then
swift_version=${swift_version#swift-}
fi
Expand Down Expand Up @@ -631,8 +633,13 @@ header "Outputting compressed bundle"

quiet_pushd "${build_dir}"
mkdir -p "${products_dir}"
tar czf "${bundle}.tar.gz" "${bundle}"
mv "${bundle}.tar.gz" "${products_dir}"
# set the timestamps of every file in the artifact to the tag date for the swift repo for build reproducibility
touch_date=$(date -d "@$swift_tag_date" "+%Y%m%d%H%M.%S")
find "${bundle}" -exec touch -t "$touch_date" {} +

bundle_archive="${products_dir}/${bundle}.tar.gz"
tar czf "${bundle_archive}" "${bundle}"
shasum -a 256 "${bundle_archive}"
quiet_popd

groupend
79 changes: 0 additions & 79 deletions swift-ci/sdks/android/scripts/patch-sources.sh

This file was deleted.

15 changes: 6 additions & 9 deletions swift-ci/sdks/android/scripts/toolchain-vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,16 @@ OS=$(echo $HOST_OS | tr -d '.')
case "${BUILD_SCHEME}" in
release)
# e.g., "swift-6.1-RELEASE"
SWIFT_TAG=$(curl -fsSL https://www.swift.org/api/v1/install/releases.json | jq -r '.[-1].tag')
# there is no latest-build.yml for releases, so we need to get it from the API
export SWIFT_TAG=$(curl -fsSL https://www.swift.org/api/v1/install/releases.json | jq -r '.[-1].tag')
# e.g., "swift-6.1-release"
SWIFT_BRANCH=$(echo "${SWIFT_TAG}" | tr '[A-Z]' '[a-z]')
export SWIFT_BRANCH=$(echo "${SWIFT_TAG}" | tr '[A-Z]' '[a-z]')
;;
swift-*-branch)
development|swift-*-branch)
# e.g., swift-6.2-DEVELOPMENT-SNAPSHOT-2025-05-15-a
SWIFT_TAG=$(curl -fsSL https://download.swift.org/$BUILD_SCHEME/$OS/latest-build.yml | grep '^dir: ' | cut -f 2 -d ' ')
SWIFT_BRANCH=$BUILD_SCHEME
;;
development)
# e.g., swift-DEVELOPMENT-SNAPSHOT-2025-05-14-a
SWIFT_TAG=$(curl -fsSL https://download.swift.org/development/$OS/latest-build.yml | grep '^dir: ' | cut -f 2 -d ' ')
SWIFT_BRANCH="development"
export SWIFT_TAG=$(curl -fsSL https://download.swift.org/$BUILD_SCHEME/$OS/latest-build.yml | grep '^dir: ' | cut -f 2 -d ' ')
export SWIFT_BRANCH=$BUILD_SCHEME
;;
*)
echo "$0: invalid BUILD_SCHEME=${BUILD_SCHEME}"
Expand Down
Loading