-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## What Changed and Why? - Renames the `cargo make` rule run in CI to `ci-tests`. Under the hood this now runs a general `cargo test` so that all tests are run. The only way `cargo` tests are now excluded from CI is via `ignore` instead of having a second filter via the CI script. This ensures all tests are actually exercised in CI. - Converts the `consts` module into local structs `Markers` and `Symbols` that are initialized per-session. This fixes an issue with stale data that can cause test cases to fail. This is caused by `Symbol`s. A `Symbol` is an interned string, with the interner stored in a thread-local `SESSION_GLOBALS` variable. The "costants" we allocate in `consts` however are `lazy_static`, which means they are shared across threads. If two compiler sessions run in parallel, then one would initialize the values in `consts`, interning `Symbol`s in its interner. However the indices in those symbols would refer to different strings in the other session, which breaks the annotation extractor. A similar scenario would also occur if the two sessions are sequential, as the `lazy_static` would preserve the symbols. This is why the fresh, per-session intialization is needed, and simply changing `lazy_static` to `thread_local` would be insufficient. - Switches the name generation for test crates in the integration tests to using random names. This fixes issues where the crates already existed or tests wold race for the same name if the test code was the same. - It disables incremental compilation in CI. This substantially reduces the disk space needed and stays within the limits of disk space available in [GitHub hosted runners](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories). ## Checklist - [x] Above description has been filled out so that upon quash merge we have a good record of what changed. - [x] New functions, methods, types are documented. Old documentation is updated if necessary - [x] Documentation in Notion has been updated - [x] Tests for new behaviors are provided - [ ] New test suites (if any) ave been added to the CI tests (in `.github/workflows/rust.yml`) either as compiler test or integration test. *Or* justification for their omission from CI has been provided in this PR description.
- Loading branch information
1 parent
f7c6562
commit 2d832e1
Showing
17 changed files
with
339 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use std::env; | ||
use std::path::PathBuf; | ||
|
||
fn rustup_toolchain_path() -> PathBuf { | ||
let rustup_home = env::var("RUSTUP_HOME").unwrap(); | ||
let rustup_tc = env::var("RUSTUP_TOOLCHAIN").unwrap(); | ||
[&rustup_home, "toolchains", &rustup_tc] | ||
.into_iter() | ||
.collect() | ||
} | ||
|
||
fn get_rustup_lib_path() -> PathBuf { | ||
let mut rustup_lib = rustup_toolchain_path(); | ||
rustup_lib.push("lib"); | ||
rustup_lib | ||
} | ||
|
||
fn main() { | ||
if cfg!(target_os = "linux") { | ||
let rustup_lib = get_rustup_lib_path(); | ||
println!("cargo:rustc-link-search=native={}", rustup_lib.display()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use std::env; | ||
use std::path::PathBuf; | ||
|
||
fn rustup_toolchain_path() -> PathBuf { | ||
let rustup_home = env::var("RUSTUP_HOME").unwrap(); | ||
let rustup_tc = env::var("RUSTUP_TOOLCHAIN").unwrap(); | ||
[&rustup_home, "toolchains", &rustup_tc] | ||
.into_iter() | ||
.collect() | ||
} | ||
|
||
fn get_rustup_lib_path() -> PathBuf { | ||
let mut rustup_lib = rustup_toolchain_path(); | ||
rustup_lib.push("lib"); | ||
rustup_lib | ||
} | ||
|
||
fn main() { | ||
if cfg!(target_os = "linux") { | ||
let rustup_lib = get_rustup_lib_path(); | ||
println!("cargo:rustc-link-search=native={}", rustup_lib.display()); | ||
} | ||
} |
Oops, something went wrong.