Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

cabal should alert the user about modules missing from other-modules #1700

Closed
leonbaum opened this Issue · 6 comments

5 participants

@leonbaum

If a required module is missing from "other-modules", cabal will produce a broken library that results in a non-obvious error, e.g.:

/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../x86_64-pc-linux-gnu/bin/ld: dist/build/A.dyn_o: warning: relocation against `testzm0zi1zi0zi0_B_zdfShowY2_closure' in readonly section `.text'.
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../x86_64-pc-linux-gnu/bin/ld: dist/build/A.dyn_o: relocation R_X86_64_PC32 against undefined symbol `testzm0zi1zi0zi0_B_zdfShowY2_closure' can not be use\
d when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Bad value

See https://gist.github.com/leonbaum/9164940 for full example.

@fmaste

+1 for this. When I switched to ghc 7.8-rc2, because of a missing "other-modules" I got this error

ld: illegal text reloc in '_enablezmlibraryzmcoveragezm0zi0zi1_Library_sendMsg2_info' to '__hpc_tickboxes_enablezmlibraryzmcoveragezm0zi0zi1_Util_hpc' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

with library-coverage enabled on a package that builds OK on 7.6.3. I spent a lot of time figuring out why, thought it was a problem with the rc2.

If parsing the source files for this check is beyond the boundaries of cabal, at least it could be possible to make the error only surface when testing the distribution file and ensuring that if the hs-source-dirs are the correct ones the linker and compiler won't complain.

@23Skidoo
Collaborator

Previous discussion: #1455. Our current plan is to write a patch for ghc --make to output the module dependency graph.

@kini

I can't reproduce the gist in the OP using GHC 7.8.2, cabal 1.20.0.0, and cabal-install 1.20.0.2, fwiw.

@23Skidoo 23Skidoo added the duplicate label
@23Skidoo
Collaborator

Closing as a duplicate of #1746.

@nh2
nh2 commented

@23Skidoo You didn't close.

@23Skidoo
Collaborator

Oops.

@23Skidoo 23Skidoo closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.