Skip to content

Commit d1400a7

Browse files
authored
fix: workaround for snapcraft needing a user runtime directory (#660)
This comes from discussion with Michael Croft-White on Matrix: https://matrix.to/#/!GGqzbFAUQprdPgYYCM:ubuntu.com/$6hguIiRWB8jEq-J7JgZDamYOaFIph9mZpK-Nz8uWoRY While this isn't a long-term fix, this should provide a workaround to allow the snap to build. Also includes an unrelated change to the Azure Linux builds, which was needed to pass the PR checks because another build failure made its way into the codebase while the builds were broken.
1 parent 833381a commit d1400a7

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

.github/workflows/packages.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ jobs:
108108
with:
109109
submodules: 'recursive'
110110

111+
- name: 'Configure runner for snapcraft'
112+
run: |
113+
# Create a runtime directory for this user.
114+
sudo mkdir -p /run/user/$(id -u)
115+
sudo chown $(id -u):$(id -g) /run/user/$(id -u)
116+
111117
- name: 'Run'
112118
uses: 'snapcore/action-build@v1'
113119
id: 'snapcraft'

ci/install-build-deps.sh

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -211,19 +211,17 @@ if [ -z "${DISABLE_FOR_CODEQL:-}" ]; then
211211
apt-get update
212212
apt-get upgrade -y
213213

214-
if [ "$OS" = 'mariner:2' ]; then
215-
apt-get install -y software-properties-common
216-
add-apt-repository -y ppa:longsleep/golang-backports
217-
apt-get update
218-
fi
219-
220214
apt-get install -y \
221-
acl cmake cpio curl g++ gcc genisoimage git golang-1.21-go jq libclang1 libssl-dev \
222-
llvm-dev make pigz pkg-config python3-distutils python3-pip qemu-utils rpm tar \
223-
wget zstd
224-
215+
acl cmake cpio curl g++ gcc genisoimage git jq libclang1 libssl-dev llvm-dev make \
216+
pigz pkg-config python3-distutils python3-pip qemu-utils rpm tar wget zstd
217+
218+
# Install Go 1.23
219+
GO_VERSION=1.23.0
220+
[ "$ARCH" == 'aarch64' ] && GO_ARCH='arm64' || GO_ARCH='amd64'
221+
mkdir -p /usr/local/go
222+
curl -sSL "https://go.dev/dl/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz" | tar -C /usr/local -xzf -
225223
rm -f /usr/bin/go
226-
ln -vs /usr/lib/go-1.21/bin/go /usr/bin/go
224+
ln -vs /usr/local/go/bin/go /usr/local/bin/go
227225

228226
touch /.mariner-toolkit-ignore-dockerenv
229227

0 commit comments

Comments
 (0)