-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update krates to 0.2.0 * Add check script for external repos * Check external repos in CI * Update CHANGELOG
- Loading branch information
1 parent
e540885
commit 3b7efcf
Showing
7 changed files
with
121 additions
and
21 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
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
**/target | ||
**/*.rs.bk | ||
/examples/06_advisories/target | ||
/examples/06_advisories/target | ||
scripts/check |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
const REPOS: &[&str] = &[ | ||
"git://github.com/EmbarkStudios/ash-molten.git", | ||
"git://github.com/EmbarkStudios/cargo-about.git", | ||
//"git://github.com/EmbarkStudios/cargo-fetcher.git", | ||
"git://github.com/bitshifter/glam-rs.git", | ||
"git://github.com/EmbarkStudios/physx-rs.git", | ||
"git://github.com/gwihlidal/smush-rs.git", | ||
"git://github.com/EmbarkStudios/tame-gcs.git", | ||
"git://github.com/EmbarkStudios/tame-oauth.git", | ||
"git://github.com/EmbarkStudios/texture-synthesis.git", | ||
"git://github.com/hyperium/tonic.git", | ||
]; | ||
|
||
fn main() { | ||
use std::process::Command; | ||
|
||
let td = std::env::temp_dir().join("deny-repos"); | ||
// This kind of doesn't work on windows! | ||
if td.exists() { | ||
std::fs::remove_dir_all(&td).unwrap(); | ||
} | ||
std::fs::create_dir_all(&td).unwrap(); | ||
|
||
let (tx, rx) = std::sync::mpsc::channel(); | ||
|
||
for repo in REPOS { | ||
let tx = tx.clone(); | ||
let td = td.clone(); | ||
std::thread::spawn(move || { | ||
let repo_name = &repo[repo.rfind('/').unwrap() + 1..]; | ||
let repo_dir = td.join(repo_name); | ||
|
||
println!("cloning {}", repo); | ||
|
||
match Command::new("git") | ||
.arg("clone") | ||
.arg(repo) | ||
.arg(&repo_dir) | ||
.output() | ||
{ | ||
Ok(out) => { | ||
if !out.status.success() { | ||
let err_str = String::from_utf8(out.stderr) | ||
.unwrap_or_else(|e| format!("git err output has bad utf8: {}", e)); | ||
tx.send(Some((repo, err_str))).unwrap(); | ||
return; | ||
} | ||
} | ||
Err(e) => { | ||
tx.send(Some((repo, format!("failed to spawn git clone: {}", e)))) | ||
.unwrap(); | ||
return; | ||
} | ||
}; | ||
|
||
println!("checking {}", repo); | ||
|
||
match Command::new("cargo") | ||
.args(&["deny", "-L", "debug", "check"]) | ||
.current_dir(repo_dir) | ||
.output() | ||
{ | ||
Ok(out) => { | ||
if !out.status.success() { | ||
let err_str = String::from_utf8(out.stderr) | ||
.unwrap_or_else(|e| format!("deny err output has bad utf8: {}", e)); | ||
tx.send(Some((repo, err_str))).unwrap(); | ||
} | ||
} | ||
Err(e) => { | ||
tx.send(Some((repo, format!("failed to spawn cargo deny: {}", e)))) | ||
.unwrap(); | ||
} | ||
} | ||
}); | ||
} | ||
|
||
drop(tx); | ||
|
||
let mut code = 0; | ||
while let Ok(bad) = rx.recv() { | ||
if let Some((repo, output)) = bad { | ||
code = 1; | ||
|
||
eprintln!("failed {}:\n{}", repo, output); | ||
} | ||
} | ||
|
||
std::process::exit(code); | ||
} |
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,6 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
dir=$(dirname "${BASH_SOURCE[0]}") | ||
rustc -g -o "${dir}/check" "${dir}/check_external.rs" | ||
"${dir}/check" |