Skip to content

Fix hpc for cross-compiled builds #862

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

Merged
merged 5 commits into from
Oct 6, 2020
Merged

Fix hpc for cross-compiled builds #862

merged 5 commits into from
Oct 6, 2020

Conversation

rvl
Copy link
Contributor

@rvl rvl commented Oct 2, 2020

  1. Fix hpc for cross-compiled builds
  2. Add report entries to Hydra build products.

@rvl rvl requested review from angerman and sevanspowell October 2, 2020 02:08
@rvl rvl self-assigned this Oct 2, 2020
rvl added a commit to cardano-foundation/cardano-wallet that referenced this pull request Oct 2, 2020
@rvl rvl force-pushed the rvl/SRE-125/fix-hpc-cross branch from dcdeb64 to 8948fb8 Compare October 2, 2020 02:52
rvl added a commit to cardano-foundation/cardano-wallet that referenced this pull request Oct 2, 2020
Copy link
Collaborator

@angerman angerman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming this works, looks legit to me.

LC_ALL = "en_US.UTF-8";
} // lib.optionalAttrs (stdenv.buildPlatform.libc == "glibc") {
LOCALE_ARCHIVE = "${pkgs.buildPackages.glibcLocales}/lib/locale/locale-archive";
})
''
local hpc=${pkgs.buildPackages.haskellPackages.ghc}/bin/hpc

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this work?

nativeBuildInputs = [(ghc.buildGHC or ghc)];

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fundamental issue I believe is that our cross compilers (and musl is considered on) do not ship hpc, thus while you'd get a valid expression for ghc, you have no guarantee it has hpc?

On the other, hand your suggesting is to always use the buildGHC, which can never realistically be a cross compiler by default. 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really sure what's the best way to do it.
This way works for me at the moment.
But one issue is that the ghc version could be different to what's used by the project.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rvl right, that's what @hamishmack's change would address. We mostly use the same ghc version to bootstrap the cross compilers. But it might not for regular compiers. Ahh this is frustrating.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK thanks, I have changed it as @hamishmack suggested, and it seems to work.

rvl added a commit to cardano-foundation/cardano-wallet that referenced this pull request Oct 2, 2020
@rvl rvl marked this pull request as draft October 2, 2020 08:21
rvl added a commit to cardano-foundation/cardano-wallet that referenced this pull request Oct 4, 2020
@rvl rvl marked this pull request as ready for review October 6, 2020 03:29
@rvl rvl merged commit b129059 into master Oct 6, 2020
@iohk-bors iohk-bors bot deleted the rvl/SRE-125/fix-hpc-cross branch October 6, 2020 03:30
booniepepper pushed a commit to booniepepper/haskell.nix that referenced this pull request Feb 4, 2022
* Add Hydra build products for test coverage reports (HTML links and zip files)

* Fix hpc on cross builds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants