Comments (3)
Thanks for the report. Would if work we just changed rules_haskell (in info.bzl:compile_info_output_groups
) to remove any C libraries whose path doesn't end in ".so"? Does rules_haskell already make a similar distinction when figuring out the command-line for, say, linking a haskell_binary
with linkstatic=False
against libz? (I assume in that case it also only needs to only pass -lz
.)
from hrepl.
Would if work we just changed rules_haskell (in
info.bzl:compile_info_output_groups
) to remove any C libraries whose path doesn't end in ".so"?
That wouldn't work on other platforms, e.g. on Darwin, nixpkgs or system provided libraries would end on .dylib
. Also, if one wants to use the transitive_cc_libs
field to determine the required library files, then one will need all of them. Typically, libz.so.1.2.11
is the actual library file, libz.so
is a symlink and is what ld
finds when one passes -lz
, libz.so.1
is another symlink and matches the SONAME
of the library, so artifacts that dynamically link against libz
will look for that file.
Does rules_haskell already make a similar distinction when figuring out the command-line [...]?
rules_haskell
has logic to determine the library name based on a file name. It strips the lib
prefix and the file extension where it considers all of .so.1.2.11
as the extension. We don't currently deduplicate the resulting linker flags, so we'll have -lz -lz -lz
. AFAIK ld
handles this fine, but if it's an issue one could deduplicate with something like map head . groups
(to preserve linking order).
from hrepl.
@aherrmann I've just been bitten by this with rules_haskell on macOS trying to link against postgresql-libpq.
There it has a static library libpgcommon.a
that it's trying to load and it's giving me the same error.
User-specified static library could not be loaded (external/nixpkgs_postgresql/lib/libpgcommon.a)
Loading static libraries is not supported in this configuration.
Try using a dynamic library instead.
from hrepl.
Related Issues (13)
- Support targets with plugins
- .HaskellCompile.pb: openBinaryFile: does not exist HOT 6
- Feature request: Only print GHCi flags without opening the REPL HOT 3
- Support haskell_proto_library
- Linker errors building on macOS Catalina HOT 1
- Multiple tests fail on Mac with "Error: DEVELOPER_DIR not set"
- Tests are slow
- Dependencies aren't loaded by default
- hrepl depends on haskell-src-exts
- cc_library dependencies aren't loaded on MacOS
- Support statically-linked GHC
- Add CI
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hrepl.