-
Notifications
You must be signed in to change notification settings - Fork 247
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
Conversation
rvl
commented
Oct 2, 2020
- Fix hpc for cross-compiled builds
- Add report entries to Hydra build products.
dcdeb64
to
8948fb8
Compare
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.
Assuming this works, looks legit to me.
lib/cover-project.nix
Outdated
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 | ||
|
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.
Would this work?
nativeBuildInputs = [(ghc.buildGHC or ghc)];
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 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. 🤔
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.
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.
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.
@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.
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.
OK thanks, I have changed it as @hamishmack suggested, and it seems to work.
* Add Hydra build products for test coverage reports (HTML links and zip files) * Fix hpc on cross builds