-
Notifications
You must be signed in to change notification settings - Fork 691
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
Wrong rpath for dynamically linked tests #2412
Comments
Looking at the code, I noticed that running the tests via cabal should set |
Confirmed, |
I'm confused about what the issue is here. Is the problem that |
@ttuegel yes, because |
@bennofs Got it. It was not clear to me if the problem was @christiaanb Is it possible to actually set the RPATH of tests to the in-place-installed library? |
I think adding an rpath to the inplace library directory is unwanted and ugly, see also: #2330 (comment) Also, this is exactly what
edit: ah, I see this is with regards to the testing executable. Indeed, then |
@christiaanb For tasty, the output is nicer if I don't use Also, I sometimes want to pass additional commands to a particular test-suite (for example, to reproduce a problem by specifying the QuickCheck initial seed). Is this possible with |
@bennofs The lack of colors/progress indicators is due to your test framework; |
Problem description
When using using
--enable-executable-dynamic
for a package where the tests depend on a library defined in the same file, the rpath for tests is set to the installation directory of the library, not to thedist/build
directory. This means that the tests cannot be run before the library is installed.An example project is here: https://github.com/bennofs/cabal-tests-rpath
That project defines a library foo and a test-suite dependent on that library. Running the tests with
--enable-executable-dynamic
gives:(It also happens with ghc 7.8, it's not related to 7.10, except that 7.10 ships 1.22 by default while 7.8 ships the working 1.18 version)
Cause
Inspecting the rpath shows:
Note that only the path of the library if it would be installed is placed in the rpath, not the build directory.
This happens with Cabal 1.22. At least with Cabal 1.18, this was not the case, the rpath was instead correctly set to
dist/build
. I have not tested Cabal 1.20.The text was updated successfully, but these errors were encountered: