Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests fail with Rust 1.77 #137

Closed
alyssais opened this issue Mar 22, 2024 · 3 comments · Fixed by #138
Closed

Tests fail with Rust 1.77 #137

alyssais opened this issue Mar 22, 2024 · 3 comments · Fixed by #138

Comments

@alyssais
Copy link

With rustc 1.76.0, cargo auditable reports package IDs like this:

lib_and_bin_crate 0.1.0 (path+file:///home/qyliss/src/cargo-auditable/cargo-auditable/tests/fixtures/lib_and_bin_crate)                      

With rustc 1.77.0, they're like this:

path+file:///home/qyliss/src/cargo-auditable/cargo-auditable/tests/fixtures/lib_and_bin_crate#0.1.0

This causes the tests to fail:

failures:

---- test_build_then_runtime_dep stdout ----
Test fixture binary map: {"path+file:///home/qyliss/src/cargo-auditable/cargo-auditable/tests/fixtures/build_then_runtime_dep/top_level_crate#0.1.0": ["/home/qyliss/src/cargo-auditable/cargo-auditable/tests/fixtures/build_then_runtime_dep/target/debug/top_level_crate"]}
thread 'test_build_then_runtime_dep' panicked at cargo-auditable/tests/it.rs:327:59:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- test_platform_specific_deps stdout ----
Test fixture binary map: {"path+file:///home/qyliss/src/cargo-auditable/cargo-auditable/tests/fixtures/platform_specific_deps/with_platform_dep#0.1.0": ["/home/qyliss/src/cargo-auditable/cargo-auditable/tests/fixtures/platform_specific_deps/target/debug/with_platform_dep"]}
thread 'test_platform_specific_deps' panicked at cargo-auditable/tests/it.rs:306:50:
called `Option::unwrap()` on a `None` value

---- test_runtime_then_build_dep stdout ----
Test fixture binary map: {"path+file:///home/qyliss/src/cargo-auditable/cargo-auditable/tests/fixtures/runtime_then_build_dep/top_level_crate#0.1.0": ["/home/qyliss/src/cargo-auditable/cargo-auditable/tests/fixtures/runtime_then_build_dep/target/debug/top_level_crate"]}
thread 'test_runtime_then_build_dep' panicked at cargo-auditable/tests/it.rs:351:59:
called `Option::unwrap()` on a `None` value

---- test_custom_rustc_path stdout ----
Test fixture binary map: {"path+file:///home/qyliss/src/cargo-auditable/cargo-auditable/tests/fixtures/custom_rustc_path/top_level_crate#0.1.0": ["/home/qyliss/src/cargo-auditable/cargo-auditable/tests/fixtures/custom_rustc_path/target/debug/top_level_crate"]}
thread 'test_custom_rustc_path' panicked at cargo-auditable/tests/it.rs:377:59:
called `Option::unwrap()` on a `None` value

---- test_bin_and_lib_in_one_crate stdout ----
Test fixture binary map: {"path+file:///home/qyliss/src/cargo-auditable/cargo-auditable/tests/fixtures/lib_and_bin_crate#0.1.0": ["/home/qyliss/src/cargo-auditable/cargo-auditable/tests/fixtures/lib_and_bin_crate/target/debug/some_binary"]}
thread 'test_bin_and_lib_in_one_crate' panicked at cargo-auditable/tests/it.rs:261:64:
called `Option::unwrap()` on a `None` value

---- test_cargo_auditable_workspaces stdout ----
Test fixture binary map: {"path+file:///home/qyliss/src/cargo-auditable/cargo-auditable/tests/fixtures/workspace/binary_and_cdylib_crate#0.1.0": ["/home/qyliss/src/cargo-auditable/cargo-auditable/tests/fixtures/workspace/target/debug/libbinary_and_cdylib_crate.so", "/home/qyliss/src/cargo-auditable/cargo-auditable/tests/fixtures/workspace/target/debug/binary_and_cdylib_crate"], "path+file:///home/qyliss/src/cargo-auditable/cargo-auditable/tests/fixtures/workspace/crate_with_features#0.1.0": ["/home/qyliss/src/cargo-auditable/cargo-auditable/tests/fixtures/workspace/target/debug/crate_with_features_bin"]}
thread 'test_cargo_auditable_workspaces' panicked at cargo-auditable/tests/it.rs:145:76:
called `Option::unwrap()` on a `None` value

---- test_build_script stdout ----
Test fixture binary map: {"path+file:///home/qyliss/src/cargo-auditable/cargo-auditable/tests/fixtures/crate_with_build_script#0.1.0": ["/home/qyliss/src/cargo-auditable/cargo-auditable/tests/fixtures/crate_with_build_script/target/debug/crate_with_build_script"]}
thread 'test_build_script' panicked at cargo-auditable/tests/it.rs:283:76:
called `Option::unwrap()` on a `None` value

---- test_self_hosting stdout ----
Self-hosting binary map: {"path+file:///home/qyliss/src/cargo-auditable/rust-audit-info#0.5.2": ["/home/qyliss/src/cargo-auditable/rust-audit-info/target/debug/rust-audit-info"]}
thread 'test_self_hosting' panicked at cargo-auditable/tests/it.rs:221:44:
called `Option::unwrap()` on a `None` value

---- test_lto stdout ----
LTO binary map: {"path+file:///home/qyliss/src/cargo-auditable/cargo-auditable/tests/fixtures/lto_binary_crate#0.1.0": ["/home/qyliss/src/cargo-auditable/cargo-auditable/tests/fixtures/lto_binary_crate/target/release/lto_binary_crate"]}
thread 'test_lto' panicked at cargo-auditable/tests/it.rs:241:62:
called `Option::unwrap()` on a `None` value


failures:
    test_bin_and_lib_in_one_crate
    test_build_script
    test_build_then_runtime_dep
    test_cargo_auditable_workspaces
    test_custom_rustc_path
    test_lto
    test_platform_specific_deps
    test_runtime_then_build_dep
    test_self_hosting

test result: FAILED. 1 passed; 9 failed; 0 ignored; 0 measured; 0 filtered out; finished in 5.94s

error: test failed, to rerun pass `-p cargo-auditable --test it`
@Shnatsel
Copy link
Member

Interesting. I believe I've tested that it still works with 1.77 but I probably did that manually instead of running the tests. I'll take a look, thanks for the report!

@Shnatsel
Copy link
Member

I've re-checked and the issue it seems to be isolated to tests; the actual builds still encode correct audit data.

@omnivagant
Copy link

rust-lang/cargo#12914

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants