Skip to content

Commit

Permalink
Do complete installation using rustup
Browse files Browse the repository at this point in the history
  • Loading branch information
dcvz committed Aug 10, 2023
1 parent 3415ba3 commit 7ab9045
Showing 1 changed file with 2 additions and 52 deletions.
54 changes: 2 additions & 52 deletions projects/rust-lang.org/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,71 +29,21 @@ options:
- analysis
- { name: rust-demangler, default: false }

dependencies:
tea.xyz/gx/cc: c99
#FIXME ^^ strictly rustc only needs a linker
zlib.net: 1

runtime:
env:
RUST_SRC_PATH: ${{prefix}}/lib/rustlib/src/rust/src

build:
dependencies:
tea.xyz/gx/make: '*' #FIXME surely we don’t need make AND ninja
cmake.org: ^3.20
ninja-build.org: ^1.10
python.org: 3
openssl.org: '*' # needed to build openssl-sys
freedesktop.org/pkg-config: ^0.29
crates.io/semverator: 0
rust-lang.org/rustup: '*'
script: |-
# --enable-optimize not available as of 1.63.0
if semverator satisfies '<1.63' {{ version }}; then
export ARGS="$ARGS --enable-optimize"
fi
# 1.68.0 introduced a regression w.r.t. CI builds
# https://github.com/rust-lang/rust/issues/108959
if semverator satisfies '>=1.68<1.70' {{ version }}; then
sed -i.bak -e 's/CiEnv::is_ci()/CiEnv::is_ci() \&\& config.rust_info.is_managed_git_subrepository()/' src/bootstrap/native.rs
rm src/bootstrap/native.rs.bak
fi
./configure $ARGS
make install
for tool in $tools; do
./x.py install $tool
done
# # place source for IDEs to use (normally installed via rustup)
# # FIXME: this is fragile because directories can change, is there a better way?
# mkdir -p {{prefix}}/lib/rustlib/src/rust
# mv Cargo.lock {{prefix}}/lib/rustlib/src/rust
# mv library {{prefix}}/lib/rustlib/src/rust
# mkdir -p {{prefix}}/lib/rustlib/src/rust/src/llvm-project
# mv src/llvm-project/libunwind {{prefix}}/lib/rustlib/src/rust/src/llvm-project

# install src via rustup and copy component for IDEs to use
rustup default {{ version }}
# used for type checking in IDEs
rustup component add rust-src
rp -r ~/.rustup/toolchains/*/lib/rustlib/src {{prefix}}/lib/rustlib
cp -r ~/.rustup/toolchains/*/* {{prefix}}
# do cleanup
rm -rf {{prefix}}/share/doc
env:
ARGS:
- --enable-vendor
- --prefix={{ prefix }}
- --enable-ninja
- --disable-docs # docs are online
- --tools=clippy,rustfmt,analysis
tools:
- clippy
- rustfmt
- rust-analyzer
test:
script: |
Expand Down

0 comments on commit 7ab9045

Please sign in to comment.