Skip to content

Commit 19edc68

Browse files
committed
Create script to link build artifacts
A new script has been created to link the build artifacts. The script is called from the init script that sets up Rust, and from the script that initializes a new worktree.
1 parent 98b197c commit 19edc68

File tree

4 files changed

+28
-11
lines changed

4 files changed

+28
-11
lines changed

ansible/roles/dev-desktop/files/scripts/help.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ echo "new_worktree.sh | creates a worktree (shallow copy of the main git ch
77
echo "detach_merged_prs.sh | invokes \"git pull --fast-forward-only\" on all worktrees and detaches those that are equal to the \"master\" branch"
88
echo ""
99
echo "# Rarer commands:"
10-
echo "set_defaults.sh | connects the global config.toml with all worktrees. Use this when your setup is broken"
11-
10+
echo "set_defaults.sh | connects the global config.toml with all worktrees. Use this when your setup is broken"
11+
echo "setup_rust.sh | Clone your fork of rust-lang/rust, compile, and then link it"
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
3+
# Enable strict mode for Bash
4+
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
5+
set -euo pipefail
6+
IFS=$'\n\t'
7+
8+
for D in rust*; do
9+
if [ -d "${D}" ]; then
10+
pushd "${D}"
11+
12+
./x.py build
13+
14+
if [[ -d "$D/build/aarch64-unknown-linux-gnu/stage1" ]]; then
15+
rustup toolchain link "$D"_stage1 "$D/build/aarch64-unknown-linux-gnu/stage1"
16+
fi
17+
18+
if [[ -d "$D/build/aarch64-unknown-linux-gnu/stage2" ]]; then
19+
rustup toolchain link "$D"_stage2 "$D/build/aarch64-unknown-linux-gnu/stage2"
20+
fi
21+
22+
popd
23+
fi
24+
done

ansible/roles/dev-desktop/files/scripts/new_worktree.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ git checkout upstream/master
1313
ln -s ../config.toml
1414
popd
1515

16-
setup_rustup.sh
16+
link_rust.sh

ansible/roles/dev-desktop/files/scripts/setup_rust.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,4 @@ git checkout upstream/master
2626
popd
2727

2828
set_defaults.sh
29-
30-
for D in rust*; do
31-
if [ -d "${D}" ]; then
32-
cd "${D}" && ./x.py build
33-
rustup toolchain link "$D"_stage1 "$D/build/x86_64-unknown-linux-gnu/stage1"
34-
rustup toolchain link "$D"_stage2 "$D/build/x86_64-unknown-linux-gnu/stage2"
35-
fi
36-
done
29+
link_rust.sh

0 commit comments

Comments
 (0)