Skip to content

Commit

Permalink
Merge commit 'dec0daa8f6d0a0e1c702f169abb6bf3eee198c67' into sync_cg_…
Browse files Browse the repository at this point in the history
…clif-2023-03-15
  • Loading branch information
bjorn3 committed Mar 15, 2023
1 parent 2c122a8 commit 7b3bd56
Show file tree
Hide file tree
Showing 52 changed files with 873 additions and 792 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/abi-cafe.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Abi-cafe

on:
- push

jobs:
abi_cafe:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.env.TARGET_TRIPLE }}
cancel-in-progress: true

defaults:
run:
shell: bash

strategy:
fail-fast: true
matrix:
include:
- os: ubuntu-latest
env:
TARGET_TRIPLE: x86_64-unknown-linux-gnu
- os: macos-latest
env:
TARGET_TRIPLE: x86_64-apple-darwin
- os: windows-latest
env:
TARGET_TRIPLE: x86_64-pc-windows-msvc
- os: windows-latest
env:
TARGET_TRIPLE: x86_64-pc-windows-gnu

steps:
- uses: actions/checkout@v3

- name: Cache cargo target dir
uses: actions/cache@v3
with:
path: build/cg_clif
key: ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}

- name: Set MinGW as the default toolchain
if: matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
run: rustup set default-host x86_64-pc-windows-gnu

- name: Use sparse cargo registry
run: |
cat >> ~/.cargo/config.toml <<EOF
[unstable]
sparse-registry = true
EOF
- name: Prepare dependencies
run: ./y.rs prepare

- name: Build
run: ./y.rs build --sysroot none

- name: Test abi-cafe
env:
TARGET_TRIPLE: ${{ matrix.env.TARGET_TRIPLE }}
run: ./y.rs abi-cafe
59 changes: 1 addition & 58 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
rustfmt --check build_system/mod.rs
build:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 60

Expand Down Expand Up @@ -114,63 +114,6 @@ jobs:
run: ./y.rs test


abi_cafe:
runs-on: ${{ matrix.os }}
timeout-minutes: 60

defaults:
run:
shell: bash

strategy:
fail-fast: true
matrix:
include:
- os: ubuntu-latest
env:
TARGET_TRIPLE: x86_64-unknown-linux-gnu
- os: macos-latest
env:
TARGET_TRIPLE: x86_64-apple-darwin
- os: windows-latest
env:
TARGET_TRIPLE: x86_64-pc-windows-msvc
- os: windows-latest
env:
TARGET_TRIPLE: x86_64-pc-windows-gnu

steps:
- uses: actions/checkout@v3

- name: Cache cargo target dir
uses: actions/cache@v3
with:
path: build/cg_clif
key: ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}

- name: Set MinGW as the default toolchain
if: matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
run: rustup set default-host x86_64-pc-windows-gnu

- name: Use sparse cargo registry
run: |
cat >> ~/.cargo/config.toml <<EOF
[unstable]
sparse-registry = true
EOF
- name: Prepare dependencies
run: ./y.rs prepare

- name: Build
run: ./y.rs build --sysroot none

- name: Test abi-cafe
env:
TARGET_TRIPLE: ${{ matrix.env.TARGET_TRIPLE }}
run: ./y.rs abi-cafe


bench:
runs-on: ubuntu-latest
timeout-minutes: 60
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ perf.data.old
/dist
/rust
/download
/git-fixed-subtree.sh
49 changes: 25 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 6 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@ crate-type = ["dylib"]

[dependencies]
# These have to be in sync with each other
cranelift-codegen = { version = "0.92", features = ["unwind", "all-arch"] }
cranelift-frontend = { version = "0.92" }
cranelift-module = { version = "0.92" }
# NOTE vendored as src/cranelift_native.rs
# FIXME revert back to the external crate with Cranelift 0.93
#cranelift-native = { version = "0.92" }
cranelift-jit = { version = "0.92", optional = true }
cranelift-object = { version = "0.92" }
cranelift-codegen = { version = "0.93", features = ["unwind", "all-arch"] }
cranelift-frontend = { version = "0.93" }
cranelift-module = { version = "0.93" }
cranelift-native = { version = "0.93" }
cranelift-jit = { version = "0.93", optional = true }
cranelift-object = { version = "0.93" }
target-lexicon = "0.12.0"
gimli = { version = "0.26.0", default-features = false, features = ["write"]}
object = { version = "0.29.0", default-features = false, features = ["std", "read_core", "write", "archive", "coff", "elf", "macho", "pe"] }
Expand Down
15 changes: 6 additions & 9 deletions build_sysroot/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build_sysroot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ alloc = { path = "./sysroot_src/library/alloc" }
std = { path = "./sysroot_src/library/std", features = ["panic_unwind", "backtrace"] }
test = { path = "./sysroot_src/library/test" }

compiler_builtins = { version = "0.1.39", default-features = false, features = ["no-asm"] }
compiler_builtins = { version = "0.1.87", default-features = false, features = ["no-asm"] }

[patch.crates-io]
rustc-std-workspace-core = { path = "./sysroot_src/library/rustc-std-workspace-core" }
Expand Down
5 changes: 4 additions & 1 deletion build_system/build_sysroot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,15 @@ pub(crate) fn build_sysroot(
let wrapper_name = wrapper_base_name.replace("____", wrapper);

let mut build_cargo_wrapper_cmd = Command::new(&bootstrap_host_compiler.rustc);
let wrapper_path = DIST_DIR.to_path(dirs).join(&wrapper_name);
build_cargo_wrapper_cmd
.env("TOOLCHAIN_NAME", toolchain_name.clone())
.arg(RelPath::SCRIPTS.to_path(dirs).join(&format!("{wrapper}.rs")))
.arg("-o")
.arg(DIST_DIR.to_path(dirs).join(wrapper_name))
.arg(&wrapper_path)
.arg("-Cstrip=debuginfo");
spawn_and_wait(build_cargo_wrapper_cmd);
try_hard_link(wrapper_path, BIN_DIR.to_path(dirs).join(wrapper_name));
}

let host = build_sysroot_for_triple(
Expand Down Expand Up @@ -247,6 +249,7 @@ fn build_clif_sysroot_for_triple(
if channel == "release" {
build_cmd.arg("--release");
}
build_cmd.arg("--locked");
build_cmd.env("__CARGO_DEFAULT_LIB_METADATA", "cg_clif");
if compiler.triple.contains("apple") {
build_cmd.env("CARGO_PROFILE_RELEASE_SPLIT_DEBUGINFO", "packed");
Expand Down
Loading

0 comments on commit 7b3bd56

Please sign in to comment.