Skip to content

Commit d6fcd40

Browse files
authored
Show config messages from install-wild, install-mold (#38979)
Follows on from #37717 (comment) @dvdsk suggested this but I didn't get to it in the previous PR. # Tested ``` ; sudo rm /usr/local/bin/wild ; ./script/install-wild Downloading from https://github.com/davidlattimore/wild/releases/download/0.6.0/wild-linker-0.6.0-x86_64-unknown-linux-gnu.tar.gz Wild is installed to /usr/local/bin/wild To make it your default, add or merge these lines into your ~/.cargo/config.toml: [target.x86_64-unknown-linux-gnu] linker = "clang" rustflags = ["-C", "link-arg=--ld-path=wild"] [target.aarch64-unknown-linux-gnu] linker = "clang" rustflags = ["-C", "link-arg=--ld-path=wild"] ``` ``` ; sudo rm /usr/local/bin/mold ; ./script/install-mold 2.34.0 Downloading from https://github.com/rui314/mold/releases/download/v2.34.0/mold-2.34.0-x86_64-linux.tar.gz Mold is installed to /usr/local/bin/mold To make it your default, add or merge these lines into your ~/.cargo/config.toml: [target.'cfg(target_os = "linux")'] linker = "clang" rustflags = ["-C", "link-arg=-fuse-ld=mold"] ``` Release Notes: - N/A
1 parent 7ad9ca9 commit d6fcd40

File tree

3 files changed

+26
-12
lines changed

3 files changed

+26
-12
lines changed

script/install-mold

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,13 @@ curl -fsSL --output - "$MOLD_URL" \
3535

3636
# Note this binary depends on the system libatomic.so.1 which is usually
3737
# provided as a dependency of gcc so it should be available on most systems.
38+
39+
cat <<EOF
40+
Mold is installed to /usr/local/bin/mold
41+
42+
To make it your default, add or merge these lines into your ~/.cargo/config.toml:
43+
44+
[target.'cfg(target_os = "linux")']
45+
linker = "clang"
46+
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
47+
EOF

script/install-wild

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,23 @@ ARCH="$(uname -m)"
2222
WILD_REPO="${WILD_REPO:-https://github.com/davidlattimore/wild}"
2323
WILD_PACKAGE="wild-linker-${WILD_VERSION}-${ARCH}-unknown-linux-gnu"
2424
WILD_URL="${WILD_URL:-$WILD_REPO}/releases/download/$WILD_VERSION/${WILD_PACKAGE}.tar.gz"
25+
DEST_DIR=/usr/local/bin
2526

2627
echo "Downloading from $WILD_URL"
2728
curl -fsSL --output - "$WILD_URL" \
28-
| $SUDO tar -C /usr/local/bin --strip-components=1 --no-overwrite-dir -xzf - \
29+
| $SUDO tar -C ${DEST_DIR} --strip-components=1 --no-overwrite-dir -xzf - \
2930
"${WILD_PACKAGE}/wild"
31+
32+
cat <<EOF
33+
Wild is installed to ${DEST_DIR}/wild
34+
35+
To make it your default, add or merge these lines into your ~/.cargo/config.toml:
36+
37+
[target.x86_64-unknown-linux-gnu]
38+
linker = "clang"
39+
rustflags = ["-C", "link-arg=--ld-path=wild"]
40+
41+
[target.aarch64-unknown-linux-gnu]
42+
linker = "clang"
43+
rustflags = ["-C", "link-arg=--ld-path=wild"]
44+
EOF

script/linux

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,6 @@ function finalize {
1414
cat <<EOF
1515
Note: It's recommended to install and configure Wild or Mold for faster builds.
1616
Run script/install-wild or script/install-mold.
17-
Then add these lines to your ~/.cargo/config.toml:
18-
19-
[target.x86_64-unknown-linux-gnu]
20-
linker = "clang"
21-
rustflags = ["-C", "link-arg=--ld-path=wild"]
22-
23-
[target.aarch64-unknown-linux-gnu]
24-
linker = "clang"
25-
rustflags = ["-C", "link-arg=--ld-path=wild"]
26-
27-
2817
2918
Finished installing Linux dependencies with script/linux
3019
EOF

0 commit comments

Comments
 (0)