-
Notifications
You must be signed in to change notification settings - Fork 81
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
Linkstatic shell tests #488
Conversation
Adds a `provides` field to haskell_library and haskell_binary to tell users about our custom providers (and possibly throw better error messages). As a related change, the `load` targets for `providers.bzl` are made absolute to work around bazelbuild/bazel#3115
Like sh_test, but takes a (multiline) string to specify the shell script inline instead of a different file.
Adds two shell tests that use readelf to check that the `linkstatic` option has the expected behavior: - When it’s set to True it only produces static libraries (.a) - When it’s set to False it produces both .a and .so - .a is a static ELF (no interpreter) and .so is a dynamic ELF (interpreter appears in the ELF header INTERP field)
1a53ecf
to
bc1ce90
Compare
Meh, I can just revert that part of the change, it’s not crucial. |
Similar to bazelbuild/skydoc#59 it also doesn’t support `provides`. Since `provides` is just nice-to-have, we drop it for now.
@@ -8,7 +8,7 @@ load( | |||
"target_unique_name", | |||
) | |||
load( | |||
":private/providers.bzl", | |||
"@io_tweag_rules_haskell//haskell:private/providers.bzl", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly yes, to navigate around bazelbuild/bazel#3115
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a note inline about this at the top of providers.bzl
about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Minor nit.
Building upon #487 this adds two tests to check whether the generated ELF binaries are actually linked as we expect them to be.
Adds a primitive to read a Skylark string into a single-file target (candidate for some bazel-focused library, akin to
build-support
in nixpkgs?) and ashell_inline_test
wrapper aroundshell_test
to make small test scripts less cluttered to write and read.