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

Nix test failure (test_extract_strings) #27

Closed
Titaniumtown opened this issue Sep 13, 2024 · 4 comments · Fixed by #30
Closed

Nix test failure (test_extract_strings) #27

Titaniumtown opened this issue Sep 13, 2024 · 4 comments · Fixed by #30
Assignees
Labels
bug Something isn't working

Comments

@Titaniumtown
Copy link

Describe the bug

The test_extract_strings test fails when building from nix.

To reproduce

  1. Have nix installed
  2. run nix run "github:orhun/binsider"

Expected behavior

It should build and pass all tests

Screenshots / Logs

running 2 tests
test test_init ... ok
test test_extract_strings ... FAILED

failures:

---- test_extract_strings stdout ----
thread 'test_extract_strings' panicked at tests/app.rs:41:9:
assertion failed: strings?.iter().map(|(s, _)| s).any(|v| v == ".debug_str")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    test_extract_strings

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

Software information

  • Operating system: NixOS
  • Rust version: 1.77.2 & 1.80.1
  • Project version: main
@Titaniumtown Titaniumtown added the bug Something isn't working label Sep 13, 2024
@Titaniumtown
Copy link
Author

Initial inspection, it works if I clone the repo manually and run cargo test (on 1.83.0-nightly (adaff5368 2024-09-12))

@orhun
Copy link
Owner

orhun commented Sep 14, 2024

Hello, thanks for the report! 👋🏼

First of all I really hate that test - we need a better test suite (#5)

Secondly, is there a chance that you are running tests in --release mode and that's why .debug_str does not exist in the binary?

@ch4og
Copy link
Contributor

ch4og commented Sep 14, 2024

I had the same issue.
Nix by default runs test in release mode, but after switching to debug mode it still didn't pass checks.

I don't know how cargo and rust work but doing #30 fixed building for me.

@Titaniumtown
Copy link
Author

Titaniumtown commented Sep 14, 2024

Hello, thanks for the report! 👋🏼

First of all I really hate that test - we need a better test suite (#5)

Secondly, is there a chance that you are running tests in --release mode and that's why .debug_str does not exist in the binary?

Thank you for your response. I believe nix runs it in release mode. I'll test @ch4og's PR and report back :)

@orhun orhun closed this as completed in #30 Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants