Skip to content

Commit 3f1f16a

Browse files
authored
Work around swiftly install behaviors (#85)
* Install swiftly to home folder to avoid caching-related issues * Avoid initial toolchain installation and errors on manual install In the current version, `swiftly install --use` exits with non-zero if it decides that there are post-install commands to execute (falsely, even). Telling it to write its worries to a local files avoids this and lets the build proceed.
1 parent 69fbba3 commit 3f1f16a

2 files changed

Lines changed: 8 additions & 19 deletions

File tree

bin/compile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
set -e
88
set -o pipefail
99

10-
1110
BIN_DIR=$(
1211
cd $(dirname $0)
1312
pwd
@@ -35,7 +34,6 @@ SWIFT_VERSION="latest"
3534
SWIFT_BUILD_CONFIGURATION="release"
3635
SWIFT_BUILD_FLAGS=""
3736

38-
3937
if [ -f "$BUILD_DIR/.swift-version" ]; then
4038
SWIFT_VERSION=$(cat "$BUILD_DIR/.swift-version" | tr -d '[[:space:]]')
4139
puts-step "Using Swift $SWIFT_VERSION (from package .swift-version file)"
@@ -64,7 +62,7 @@ else
6462
SWIFT_BACKTRACE_EXECUTABLE="swift-backtrace-static"
6563
fi
6664

67-
mkdir -p "$CACHE_DIR/$STACK"
65+
mkdir -p "$CACHE_DIR"
6866
source "$BIN_DIR/steps/swiftly"
6967

7068
cd "$BUILD_DIR"

bin/steps/swiftly

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
1-
export SWIFTLY_HOME_DIR="$CACHE_DIR/$STACK/share/swiftly"
2-
export SWIFTLY_BIN_DIR="$CACHE_DIR/$STACK/bin"
3-
export PATH="$SWIFTLY_BIN_DIR:$PATH"
1+
puts-step Installing swiftly...
42

5-
if [ -d "$SWIFTLY_HOME_DIR" ]; then
6-
puts-step "Swiftly already installed, updating..."
7-
swiftly self-update
8-
else
9-
puts-step Installing swiftly...
10-
11-
curl -O https://download.swift.org/swiftly/linux/swiftly-$(uname -m).tar.gz && \
12-
tar zxf swiftly-$(uname -m).tar.gz && \
13-
./swiftly init --quiet-shell-followup && \
14-
. ~/.local/share/swiftly/env.sh && \
15-
hash -r
16-
fi
3+
curl -O https://download.swift.org/swiftly/linux/swiftly-$(uname -m).tar.gz && \
4+
tar zxf swiftly-$(uname -m).tar.gz && \
5+
./swiftly init --quiet-shell-followup --skip-install -y && \
6+
. ~/.local/share/swiftly/env.sh && \
7+
hash -r
178

189
puts-step Installing Swift...
19-
swiftly install --use $SWIFT_VERSION
10+
swiftly install --use $SWIFT_VERSION --post-install-file __fake_post_install.sh --verbose

0 commit comments

Comments
 (0)