- 
                Notifications
    
You must be signed in to change notification settings  - Fork 87
 
Set runfiles attribute in haskell_doc #1300
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
Conversation
| # Fails in profiling mode due to missing haddocks for Deep. | ||
| "requires_dynamic", | 
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.
This is not a regression introduced with this PR but already the case on master. I.e. the following fails on master:
$ nix-shell --pure --run 'bazel test //tests/haddock/... -c dbg'
...
ERROR: /.../rules_haskell/tests/haddock/BUILD.bazel:18:1: HaskellHaddock //tests/haddock:haddock-lib-a failed (Exit 1) haddock_wrapper-haddock-lib-a failed: error executing command bazel-out/k8-dbg/bin/tests/haddock/haddock_wrapper-haddock-lib-a '--package-name=testsZShaddockZShaddock-lib-a' '--package-version=0' -D ... (remaining 96 argument(s) skipped)
...
tests/haddock/LibA.hs:10:1: error:
    Could not find module ‘Deep’
    There are files missing in the ‘haddock-lib-deep’ package,
    try running 'ghc-pkg check'.
    Use -v to see a list of the files searched for.
   |
10 | import Deep (deep_lib)
   | ^^^^^^^^^^^^^^^^^^^^^^
INFO: Elapsed time: 1.354s, Critical Path: 0.57s
INFO: 0 processes.
FAILED: Build did NOT complete successfully
This does not cause a CI failure on master, because we pass the flag --build_tests_only in profiling mode. This PR introduces a test case that depends on the haddock targets, which means they are now included despite --build_tests_only. We set the tag to disable the test on profiling builds.
        
          
                haskell/haddock.bzl
              
                Outdated
          
        
      | 
               | 
          ||
| return [DefaultInfo( | ||
| files = depset(html_dict_copied.values() + [index_root]), | ||
| runfiles = ctx.runfiles(html_dict_copied.values() + [index_root]), | 
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.
The html_dict is huge and here we are building two temporaries copies of it.
I do wonder what can be the impact on performance. Something such as:
    l = html_dict_copied.values() + [index_root]
    return [DefaultInfo(
        files = depset(l),
        runfiles = ctx.runfiles(l),
may be better.
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.
Good catch. It's tracking directories, not individual files, so one entry per target, but you're right, better not copy it unnecessarily.
This is to make generated Haddocks avaible in the runfiles tree of targets that have a `data` dependency on a `haskell_doc` target.
This is to make generated Haddocks available in the runfiles tree of targets that have a
datadependency on ahaskell_doctarget.Adds a regression test to
//tests/haddock.