forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit '8f9ac9c22d6594cf059d8e6c71d414cc5ccd7975' into sync_cg_…
…clif-2023-08-09
- Loading branch information
Showing
20 changed files
with
194 additions
and
110 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Security audit | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 10 * * 1' # every monday at 10:00 UTC | ||
permissions: | ||
issues: write | ||
checks: write | ||
jobs: | ||
audit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: | | ||
sed -i 's/components.*/components = []/' rust-toolchain | ||
echo 'profile = "minimal"' >> rust-toolchain | ||
- uses: rustsec/audit-check@v1.4.1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} |
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
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
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,26 @@ | ||
// This file is used by both the build system as well as cargo-clif.rs | ||
|
||
// Adapted from /~https://github.com/rust-lang/cargo/blob/6dc1deaddf62c7748c9097c7ea88e9ec77ff1a1a/src/cargo/core/compiler/build_context/target_info.rs#L750-L77 | ||
pub(crate) fn rustflags_from_env(kind: &str) -> Vec<String> { | ||
// First try CARGO_ENCODED_RUSTFLAGS from the environment. | ||
// Prefer this over RUSTFLAGS since it's less prone to encoding errors. | ||
if let Ok(a) = std::env::var(format!("CARGO_ENCODED_{}", kind)) { | ||
if a.is_empty() { | ||
return Vec::new(); | ||
} | ||
return a.split('\x1f').map(str::to_string).collect(); | ||
} | ||
|
||
// Then try RUSTFLAGS from the environment | ||
if let Ok(a) = std::env::var(kind) { | ||
let args = a.split(' ').map(str::trim).filter(|s| !s.is_empty()).map(str::to_string); | ||
return args.collect(); | ||
} | ||
|
||
// No rustflags to be collected from the environment | ||
Vec::new() | ||
} | ||
|
||
pub(crate) fn rustflags_to_cmd_env(cmd: &mut std::process::Command, kind: &str, flags: &[String]) { | ||
cmd.env(format!("CARGO_ENCODED_{}", kind), flags.join("\x1f")); | ||
} |
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
Oops, something went wrong.