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

The library contains absolute paths to the build directory #62

Closed
tocic opened this issue Jan 25, 2023 · 1 comment · Fixed by #73
Closed

The library contains absolute paths to the build directory #62

tocic opened this issue Jan 25, 2023 · 1 comment · Fixed by #73
Assignees
Labels
bug:confirmed Something isn't working (confirmed)
Milestone

Comments

@tocic
Copy link
Member

tocic commented Jan 25, 2023

git clone https://github.com/cschreib/snitch.git
cd "snitch/"
mkdir "build/"
cmake -B "build/" -S .
cmake --build "build/"
strings "build/libsnitch.a" | grep "tocic"

results in

/home/tocic/snitch/src/snitch.cpp

, i.e. the library contains references to its build directory. It should not contain them for reproducibility.

These strings come from the __FILE__ macro expansions in

https://github.com/cschreib/snitch/blob/eaa322ce9e7bbfbd0b39aa529ea59de4acbd9c42/src/snitch.cpp#L924-L926

and

https://github.com/cschreib/snitch/blob/eaa322ce9e7bbfbd0b39aa529ea59de4acbd9c42/src/snitch.cpp#L944

, which also means that the following program

#include <snitch/snitch.hpp>

TEST_CASE("Test location") {
  throw 42;
}

will report

starting tests with snitch v
==========================================
failed: running test case "Test location"
          at /home/tocic/snitch/src/snitch.cpp:926
          unhandled unknown exception caught
==========================================
error: some tests failed (1 out of 1 test cases, 0 assertions, 0.000029 seconds)

, though the path to the test file was expected to be printed.

@cschreib cschreib added the bug:unconfirmed Something isn't working (to be confirmed) label Jan 25, 2023
@cschreib cschreib added this to the v1.x milestone Jan 25, 2023
@cschreib
Copy link
Member

Thanks for reporting this! I will address it in the next version.

archlinux-github pushed a commit to archlinux/aur that referenced this issue Feb 10, 2023
The warning "Package contains reference to $srcdir" is expected.
See snitch-org/snitch#62.
cschreib added a commit that referenced this issue Mar 13, 2023
@cschreib cschreib self-assigned this Mar 13, 2023
@cschreib cschreib added bug:confirmed Something isn't working (confirmed) and removed bug:unconfirmed Something isn't working (to be confirmed) labels May 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:confirmed Something isn't working (confirmed)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants