Skip to content

Refactor scripts #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 7, 2021
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
6 changes: 6 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ jobs:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain') }}

- name: Build
run: |
./prepare_build.sh
./build.sh
./clean_all.sh

- name: Prepare dependencies
run: |
git config --global user.email "[email protected]"
Expand Down
7 changes: 7 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ You can also use my [fork of gcc](https://github.com/antoyo/gcc) which already i
```bash
$ git clone https://github.com/antoyo/rustc_codegen_gcc.git
$ cd rustc_codegen_gcc
$ ./prepare_build.sh # download and patch sysroot src
$ ./build.sh --release
```

To run the tests:

```bash
$ ./prepare.sh # download and patch sysroot src and install hyperfine for benchmarking
$ ./test.sh --release
```
Expand Down
26 changes: 26 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

#set -x
set -e

export GCC_PATH=$(cat gcc_path)

export LD_LIBRARY_PATH="$GCC_PATH"
export LIBRARY_PATH="$GCC_PATH"

if [[ "$1" == "--release" ]]; then
export CHANNEL='release'
CARGO_INCREMENTAL=1 cargo rustc --release
else
echo $LD_LIBRARY_PATH
export CHANNEL='debug'
cargo rustc
fi

source config.sh

rm -r target/out || true
mkdir -p target/out/gccjit

echo "[BUILD] sysroot"
time ./build_sysroot/build_sysroot.sh $CHANNEL
4 changes: 2 additions & 2 deletions prepare.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash --verbose
set -e

rustup component add rust-src rustc-dev llvm-tools-preview
./build_sysroot/prepare_sysroot_src.sh
source prepare_build.sh

cargo install hyperfine || echo "Skipping hyperfine install"

git clone https://github.com/rust-lang/regex.git || echo "rust-lang/regex has already been cloned"
Expand Down
5 changes: 5 additions & 0 deletions prepare_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash --verbose
set -e

rustup component add rust-src rustc-dev llvm-tools-preview
./build_sysroot/prepare_sysroot_src.sh