Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
[submodule "third_party/lowRISC/opentitan"]
path = third_party/lowRISC/opentitan
url = https://github.com/lowRISC/opentitan.git
[submodule "third_party/rust-lang/rustup"]
path = third_party/rust-lang/rustup
url = https://github.com/rust-lang/rustup.git
[submodule "third_party/wasm3/wasm-coremark"]
path = third_party/wasm3/wasm-coremark
url = https://github.com/wasm3/wasm-coremark.git
6 changes: 4 additions & 2 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ ensure bin curl
ensure bin pkg-config

if ! has bin rustup; then
x git submodule update --init third_party/rust-lang/rustup
RUSTUP_ARGS=
if [ -n "$WASEFIRE_YES" ]; then
RUSTUP_ARGS='-s -- -y --default-toolchain=none --profile=minimal --no-modify-path'
RUSTUP_ARGS='-y --default-toolchain=none --profile=minimal --no-modify-path'
fi
x curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | x sh $RUSTUP_ARGS
x ./third_party/rust-lang/rustup/rustup-init.sh $RUSTUP_ARGS
Comment thread
ia0 marked this conversation as resolved.
fi

# Transitive dependencies of xtask.
Expand Down
15 changes: 15 additions & 0 deletions scripts/sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ GIT_MODULES='
SchemaStore/schemastore
WebAssembly/spec
lowRISC/opentitan
rust-lang/rustup
wasm3/wasm-coremark
'
[ "$(echo "$GIT_MODULES" | sort | tail -n+2)" = "$(echo "$GIT_MODULES")" ] \
Expand All @@ -104,3 +105,17 @@ for m in $GIT_MODULES; do
printf "\tpath = third_party/$m\n"
printf "\turl = https://github.com/$m.git\n"
done > .gitmodules

# This is done here instead of upgrade.sh for 2 reasons:
# 1. This runs more often so users would install with the latest script.
# 2. The upgrade.sh would need a way to know the latest version.
RUSTUP_CURL="curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs"
RUSTUP_SCRIPT="$(curl -s https://rustup.rs \
| sed -n '/^<div id="platform-instructions-unix"/,/^<\/div>$/'\
'{s#^ *<pre class="rustup-command">\(.*\)</pre>$#\1#p;T;q}'
)"
Comment thread
ia0 marked this conversation as resolved.
[ "$RUSTUP_SCRIPT" = "$RUSTUP_CURL | sh" ] || e "RUSTUP_CURL is out of sync"
git submodule update --init third_party/rust-lang/rustup
eval "$RUSTUP_CURL" \
| diff - third_party/rust-lang/rustup/rustup-init.sh >/dev/null \
|| e 'rustup submodule is out of sync'
Comment thread
ia0 marked this conversation as resolved.
2 changes: 2 additions & 0 deletions scripts/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ case "$(git branch --show-current)" in
esac

for submodule in $(git submodule status | cut -d' ' -f3); do
# The rustup script is checked in the sync.sh script.
[ $submodule = third_party/rust-lang/rustup ] && continue
i "Upgrade $submodule"
( cd $submodule
git fetch -p origin
Expand Down
1 change: 1 addition & 0 deletions third_party/rust-lang/rustup
Submodule rustup added at 28d135
Loading