Skip to content

Commit

Permalink
Tweak build metadata, error paths, and valgrind targets
Browse files Browse the repository at this point in the history
  • Loading branch information
lilith committed Apr 8, 2022
1 parent c06931e commit d24a4e0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
8 changes: 4 additions & 4 deletions imageflow_core/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,17 +512,17 @@ impl fmt::Debug for FlowError {
// And we assume that any recorded stack frames are from within the `imageflow` repository.
// Click-to-source is handy

let url = if::imageflow_types::build_env_info::BUILT_ON_CI{
let repo = ::imageflow_types::build_env_info::BUILD_ENV_INFO.get("CI_REPO").unwrap_or(&Some("imazen/imageflow")).unwrap_or("imazen/imageflow");
let commit = ::imageflow_types::build_env_info::GIT_COMMIT;
let url = if::imageflow_types::version::built_on_ci(){
let repo = ::imageflow_types::version::git_username_and_repo();
let commit = ::imageflow_types::version::git_commit();
Some(format!("https://github.com/{}/blob/{}/", repo, commit))
}else { None };

for recorded_frame in &self.at{
write!(f, "{}:{}:{}\n", recorded_frame.file(), recorded_frame.line(), recorded_frame.col())?;

if let Some(ref url) = url{
write!(f, "{}{}#L{}\n",url, recorded_frame.file(), recorded_frame.line())?;
write!(f, "{}{}#L{}\n",url, recorded_frame.file().replace("\\", "/"), recorded_frame.line())?;
}
}
if let Some(ref n) = self.node{
Expand Down
2 changes: 1 addition & 1 deletion imageflow_types/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ fn what_to_collect() -> Vec<EnvTidbit>{
c.push(EnvTidbit::Env(name));
}
c.push(EnvTidbit::EnvReq("CARGO_MANIFEST_DIR"));
c.push(EnvTidbit::Cmd{key: "GIT_STATUS", cmd: "git checkout ../c_components/tests/visuals/weights.txt && git status"});
c.push(EnvTidbit::Cmd{key: "GIT_STATUS", cmd: "git status"});
c.push(EnvTidbit::Cmd{key: "GLIBC_VERSION", cmd: "ldd --version"});
c.push(EnvTidbit::Cmd{key: "UNAME", cmd: "uname -av"});
c.push(EnvTidbit::Cmd{key: "WIN_SYSTEMINFO", cmd: "systeminfo.exe"});
Expand Down
14 changes: 13 additions & 1 deletion imageflow_types/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub fn one_line_version() -> String {
let profile_release = get_build_env_value("PROFILE") == &Some("release");
let ci_job_title = get_build_env_value("CI_JOB_TITLE").unwrap_or("Local ");
let profile = get_build_env_value("PROFILE").unwrap_or("[profile missing]");
let ci = benv::BUILT_ON_CI;
let ci = built_on_ci();

let target_cpu = match get_build_env_value("TARGET_CPU").unwrap_or(get_build_env_value("RUSTFLAGS").unwrap_or("?")){
"x86-64" | "x86"=> "",
Expand Down Expand Up @@ -155,3 +155,15 @@ pub fn all_build_info_pairs() -> String {
}
s
}

pub fn built_on_ci() -> bool {
benv::BUILT_ON_CI
}

pub fn git_username_and_repo() -> &'static str {
benv::BUILD_ENV_INFO.get("CI_REPO").unwrap_or(&Some("imazen/imageflow")).unwrap_or("imazen/imageflow")
}

pub fn git_commit() -> &'static str {
benv::GIT_COMMIT
}
2 changes: 1 addition & 1 deletion valgrind_existing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ "$#" -lt 1 ]; then
find . -type d -name 'grind_*' -exec rm -rf {} +
)
shopt -s nullglob
TEST_BINARIES=(./${TEST_BINARIES_TARGET}release/*-[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9])
TEST_BINARIES=(./${TEST_BINARIES_TARGET}release/deps/imageflow*-[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9])
shopt -u nullglob
printf "discovered binaries:\n"
else
Expand Down

0 comments on commit d24a4e0

Please sign in to comment.