Skip to content

Commit acc5e9e

Browse files
committed
Revert "Move to /t for Linux builds to try to avoid length problems when ct-ng invokes bash."
This reverts commit 26857b3.
1 parent 26857b3 commit acc5e9e

17 files changed

+23
-36
lines changed

.devcontainer/devcontainer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Ubuntu",
33
"image": "mcr.microsoft.com/devcontainers/base:jammy",
4-
"postCreateCommand": "./ubuntu-prereqs.sh && ./setup-crosstool-ng.sh",
5-
"workspaceFolder": "/t", // matches GHA runner location
6-
"workspaceMount": "source=${localWorkspaceFolder},target=/t,type=bind"
4+
"postCreateCommand": "./ubuntu-prereqs.sh && ./setup-crosstool-ng.sh && sudo ln -sf /home/runner/work/qmk_toolchains/qmk_toolchains /t",
5+
"workspaceFolder": "/home/runner/work/qmk_toolchains/qmk_toolchains", // matches GHA runner location
6+
"workspaceMount": "source=${localWorkspaceFolder},target=/home/runner/work/qmk_toolchains/qmk_toolchains,type=bind"
77
}

.github/workflows/invoke_crosstool.yaml

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ jobs:
2727
- name: Setup workdir on Linux
2828
if: ${{ runner.os == 'Linux' }}
2929
run: |
30-
sudo mkdir /t \
31-
&& sudo chown $(id -u):$(id -g) /t
30+
sudo ln -sf $GITHUB_WORKSPACE /t
3231
echo "TC_WORKDIR=/t" >> $GITHUB_ENV
3332
3433
- name: Setup workdir everywhere else
@@ -86,8 +85,6 @@ jobs:
8685
8786
- name: Clone toolchains repo
8887
uses: actions/checkout@v4
89-
with:
90-
path: ${{ env.TC_WORKDIR }}
9188

9289
- name: Prerequisites (Linux)
9390
if: ${{ runner.os == 'Linux' }}
@@ -114,24 +111,20 @@ jobs:
114111
uses: actions/download-artifact@v4
115112
with:
116113
name: tarballs.tar
117-
path: ${{ env.TC_WORKDIR }}
118114

119115
- name: Extract source tarballs
120116
run: |
121-
cd $TC_WORKDIR
122117
tar xf tarballs.tar
123118
124119
- name: Download bootstrap toolchain
125120
if: ${{ inputs.fetch_bootstrap && runner.os == 'Linux' }}
126121
uses: actions/download-artifact@v4
127122
with:
128123
name: toolchain-host_${{ inputs.crosstool_host_os }}-target_${{ inputs.crosstool_host_os }}_qmk_bootstrap
129-
path: ${{ env.TC_WORKDIR }}
130124

131125
- name: Extract bootstrap toolchain
132126
if: ${{ inputs.fetch_bootstrap && runner.os == 'Linux' }}
133127
run: |
134-
cd $TC_WORKDIR
135128
mkdir -p toolchains
136129
tar xf qmk_toolchain*host_${{ inputs.crosstool_host_os }}-target_${{ inputs.crosstool_host_os }}_qmk_bootstrap.tar.xz -C toolchains
137130
rm qmk_toolchain*host_${{ inputs.crosstool_host_os }}-target_${{ inputs.crosstool_host_os }}_qmk_bootstrap.tar.xz
@@ -141,12 +134,10 @@ jobs:
141134
uses: actions/download-artifact@v4
142135
with:
143136
name: toolchain-host_${{ inputs.crosstool_host_os }}-target_${{ inputs.build_host }}
144-
path: ${{ env.TC_WORKDIR }}
145137

146138
- name: Extract canadian host toolchain
147139
if: ${{ inputs.canadian_build }}
148140
run: |
149-
cd $TC_WORKDIR
150141
mkdir -p toolchains
151142
tar xf qmk_toolchain*host_${{ inputs.crosstool_host_os }}-target_${{ inputs.build_host }}.tar.xz -C toolchains
152143
rm qmk_toolchain*host_${{ inputs.crosstool_host_os }}-target_${{ inputs.build_host }}.tar.xz
@@ -156,20 +147,17 @@ jobs:
156147
uses: actions/download-artifact@v4
157148
with:
158149
name: state-host_${{ inputs.build_host }}-target_${{ inputs.target_host }}${{ inputs.toolchain_suffix }}
159-
path: ${{ env.TC_WORKDIR }}
160150

161151
- name: Extract build state
162152
if: ${{ inputs.restore_state }}
163153
run: |
164-
cd $TC_WORKDIR
165154
# Ensure tarballs are extracted before we restore state as we've deleted $CT_COMMON_SRC_DIR before saving the state tarball
166155
./${{ inputs.build_script }} +companion_tools_for_build
167156
# Extract the state tarball
168157
tar xf state-host_${{ inputs.build_host }}-target_${{ inputs.target_host }}${{ inputs.toolchain_suffix }}.tar
169158
170159
- name: Build toolchain
171160
run: |
172-
cd $TC_WORKDIR
173161
if [ "$RUNNER_OS" == "macOS" ]; then
174162
export PATH="$PATH:/usr/local/opt/binutils/bin:/usr/local/opt/coreutils/bin:/usr/local/opt/libtool/libexec/gnubin"
175163
export CPPFLAGS="-I/usr/local/opt/ncurses/include -I/usr/local/opt/gettext/include"
@@ -181,6 +169,7 @@ jobs:
181169
export MACOSX_DEPLOYMENT_TARGET=12.0
182170
fi
183171
# Kick off the requested build phase
172+
cd $TC_WORKDIR
184173
./${{ inputs.build_script }} ${{ inputs.crosstool_args }}
185174
186175
- name: Upload build logs
@@ -189,12 +178,11 @@ jobs:
189178
with:
190179
name: build.log-host_${{ inputs.build_host }}-target_${{ inputs.target_host }}${{ inputs.toolchain_suffix }}-phase${{ inputs.phase_number }}
191180
path: |
192-
${{ env.TC_WORKDIR }}/**/*.log
181+
**/*.log
193182
194183
- name: Make build state
195184
if: ${{ inputs.save_state }}
196185
run: |
197-
cd $TC_WORKDIR
198186
# We're saving state so we can resume at each step -- some of the internal build directories can be blown away as restarting from a step will recreate them.
199187
if [ "$RUNNER_OS" == "macOS" ]; then
200188
export PATH="$PATH:/usr/local/opt/coreutils/bin"
@@ -210,13 +198,12 @@ jobs:
210198
uses: actions/upload-artifact@v4
211199
with:
212200
name: state-host_${{ inputs.build_host }}-target_${{ inputs.target_host }}${{ inputs.toolchain_suffix }}
213-
path: ${{ env.TC_WORKDIR }}/state-host_${{ inputs.build_host }}-target_${{ inputs.target_host }}${{ inputs.toolchain_suffix }}.tar
201+
path: state-host_${{ inputs.build_host }}-target_${{ inputs.target_host }}${{ inputs.toolchain_suffix }}.tar
214202
overwrite: true
215203

216204
- name: Make toolchain tarball
217205
if: ${{ inputs.toolchain_tarball }}
218206
run: |
219-
cd $TC_WORKDIR
220207
if [ "$RUNNER_OS" == "macOS" ]; then
221208
export PATH="$PATH:/usr/local/opt/coreutils/bin"
222209
export STAT="gstat"
@@ -237,7 +224,7 @@ jobs:
237224
with:
238225
name: toolchain-host_${{ inputs.build_host }}-target_${{ inputs.target_host }}${{ inputs.toolchain_suffix }}
239226
path: |
240-
${{ env.TC_WORKDIR }}/qmk_toolchain-gcc*-host_${{ inputs.build_host }}-target_${{ inputs.target_host }}${{ inputs.toolchain_suffix }}.tar.xz
227+
qmk_toolchain-gcc*-host_${{ inputs.build_host }}-target_${{ inputs.target_host }}${{ inputs.toolchain_suffix }}.tar.xz
241228
242229
- name: Unmount case-sensitive workspace volume for macOS
243230
if: always()

aarch64linux-aarch64linux-canadian.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright 2024 Nick Brassel (@tzarc)
33
# SPDX-License-Identifier: GPL-2.0-or-later
44

5-
this_script=$(realpath "${BASH_SOURCE[0]}")
5+
this_script="$PWD/$(basename ${BASH_SOURCE[0]})"
66
script_dir=$(dirname "${this_script}")
77
source "${script_dir}/common.bashinc"
88

aarch64linux-native.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright 2024 Nick Brassel (@tzarc)
33
# SPDX-License-Identifier: GPL-2.0-or-later
44

5-
this_script=$(realpath "${BASH_SOURCE[0]}")
5+
this_script="$PWD/$(basename ${BASH_SOURCE[0]})"
66
script_dir=$(dirname "${this_script}")
77
source "${script_dir}/common.bashinc"
88

arm-aarch64linux-canadian.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright 2024 Nick Brassel (@tzarc)
33
# SPDX-License-Identifier: GPL-2.0-or-later
44

5-
this_script=$(realpath "${BASH_SOURCE[0]}")
5+
this_script="$PWD/$(basename ${BASH_SOURCE[0]})"
66
script_dir=$(dirname "${this_script}")
77
source "${script_dir}/common.bashinc"
88

arm-native.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright 2024 Nick Brassel (@tzarc)
33
# SPDX-License-Identifier: GPL-2.0-or-later
44

5-
this_script=$(realpath "${BASH_SOURCE[0]}")
5+
this_script="$PWD/$(basename ${BASH_SOURCE[0]})"
66
script_dir=$(dirname "${this_script}")
77
source "${script_dir}/common.bashinc"
88

arm-win64-canadian.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright 2024 Nick Brassel (@tzarc)
33
# SPDX-License-Identifier: GPL-2.0-or-later
44

5-
this_script=$(realpath "${BASH_SOURCE[0]}")
5+
this_script="$PWD/$(basename ${BASH_SOURCE[0]})"
66
script_dir=$(dirname "${this_script}")
77
source "${script_dir}/common.bashinc"
88

avr-aarch64linux-canadian.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright 2024 Nick Brassel (@tzarc)
33
# SPDX-License-Identifier: GPL-2.0-or-later
44

5-
this_script=$(realpath "${BASH_SOURCE[0]}")
5+
this_script="$PWD/$(basename ${BASH_SOURCE[0]})"
66
script_dir=$(dirname "${this_script}")
77
source "${script_dir}/common.bashinc"
88

avr-native.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright 2024 Nick Brassel (@tzarc)
33
# SPDX-License-Identifier: GPL-2.0-or-later
44

5-
this_script=$(realpath "${BASH_SOURCE[0]}")
5+
this_script="$PWD/$(basename ${BASH_SOURCE[0]})"
66
script_dir=$(dirname "${this_script}")
77
source "${script_dir}/common.bashinc"
88

avr-win64-canadian.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright 2024 Nick Brassel (@tzarc)
33
# SPDX-License-Identifier: GPL-2.0-or-later
44

5-
this_script=$(realpath "${BASH_SOURCE[0]}")
5+
this_script="$PWD/$(basename ${BASH_SOURCE[0]})"
66
script_dir=$(dirname "${this_script}")
77
source "${script_dir}/common.bashinc"
88

0 commit comments

Comments
 (0)