Comments (5)
@nomeata Thanks for the updates. I haven't had the chance of looking into this but I just want to say it didn't go unnoticed.
from haskell.nix.
Ok, I spent some times on this and I haven't got the bottom of it unfortunately. There must be something wrong with which pkgs
is being used for the evaluating plan.
If I reproduced this correctly:
❯ nix-build -A windows-exe --arg checkMaterialization true
...
> Calculated hash for haskell-project-plan-to-nix-pkgs was not 0674c017qxng0xil4yi4wsf2kr7yb9dyzpzxq7jd50dflzvm3qzz. New hash is :
> plan-sha256 = "0jmcpd8l6smj0zqkx4cx6ma2v3cvxmwws0s92ssrc6ginpis3gkb";
For full logs, run 'nix log /nix/store/swa7qajzskxhad4pvbng24aamkls5v9b-haskell-project-plan-to-nix-pkgs.drv'.
❯ nix log /nix/store/swa7qajzskxhad4pvbng24aamkls5v9b-haskell-project-plan-to-nix-pkgs.drv
Changes to haskell-project-plan-to-nix-pkgs not reflected in plan-sha256
diff -ru /nix/store/giba13w486j458p7l3jwg0rqc2zvw4fd-haskell-project-plan-to-nix-pkgs/default.nix /nix/store/6c8mdm4a5a151nxn8yjm04mc1a2hq7zz-haskell-project-plan-to-nix-pkgs/default.nix
...
Calculated hash for haskell-project-plan-to-nix-pkgs was not 0674c017qxng0xil4yi4wsf2kr7yb9dyzpzxq7jd50dflzvm3qzz. New hash is :
plan-sha256 = "0jmcpd8l6smj0zqkx4cx6ma2v3cvxmwws0s92ssrc6ginpis3gkb";
The script calculateMaterializedSha
computes the hash of calculateNoHash
, but if I call it
❯ nix-build -A windows-exe.project.plan-nix.passthru.calculateMaterializedSha
/nix/store/9wazjkh39l2bi8pwgrx6d9sq5j24v9fk-calculateSha
❯ /nix/store/9wazjkh39l2bi8pwgrx6d9sq5j24v9fk-calculateSha
0674c017qxng0xil4yi4wsf2kr7yb9dyzpzxq7jd50dflzvm3qzz
which is the hash we have passed! Let's see how the check is done:
❯ nix derivation show /nix/store/swa7qajzskxhad4pvbng24aamkls5v9b-haskell-project-plan-to-nix-pkgs.drv^* | jq -r '.[].env.buildCommand'
ERR=$(mktemp -d)/errors.txt
NEW_HASH=$(/nix/store/g3bd66c23mzspxdqik6hr4ppgal3k08x-calculateSha)
if [[ 0674c017qxng0xil4yi4wsf2kr7yb9dyzpzxq7jd50dflzvm3qzz != $NEW_HASH ]]; then
echo Changes to haskell-project-plan-to-nix-pkgs not reflected in plan-sha256
diff -ru /nix/store/giba13w486j458p7l3jwg0rqc2zvw4fd-haskell-project-plan-to-nix-pkgs /nix/store/6c8mdm4a5a151nxn8yjm04mc1a2hq7zz-haskell-project-plan-to-nix-pkgs || true
echo "Calculated hash for haskell-project-plan-to-nix-pkgs was not 0674c017qxng0xil4yi4wsf2kr7yb9dyzpzxq7jd50dflzvm3qzz. New hash is :" >> $ERR
echo " plan-sha256 = \"$NEW_HASH\";" >> $ERR
else
echo plan-sha256 used for haskell-project-plan-to-nix-pkgs is correct
fi
if [[ -e $ERR ]]; then
cat $ERR
false
else
cp -Lr /nix/store/giba13w486j458p7l3jwg0rqc2zvw4fd-haskell-project-plan-to-nix-pkgs $out
# Make sure output files can be removed from the sandbox
chmod -R +w $out
fi
where NEW_HASH
is
❯ /nix/store/g3bd66c23mzspxdqik6hr4ppgal3k08x-calculateSha
0jmcpd8l6smj0zqkx4cx6ma2v3cvxmwws0s92ssrc6ginpis3gkb
which is the other hash.
Surely we should not say Calculated hash for haskell-project-plan-to-nix-pkgs was not 0674c017qxng0xil4yi4wsf2kr7yb9dyzpzxq7jd50dflzvm3qzz
if project.plan-nix.passthru.calculateMaterializedSha
returns that exact hash.
One thing I don't understand is that looking at
diff -ru /nix/store/giba13w486j458p7l3jwg0rqc2zvw4fd-haskell-project-plan-to-nix-pkgs /nix/store/6c8mdm4a5a151nxn8yjm04mc1a2hq7zz-haskell-project-plan-to-nix-pkgs
one can identify
haskell.nix/lib/materialize.nix
Line 78 in 1ad94ae
calculateUseHash
->/nix/store/giba13w486j458p7l3jwg0rqc2zvw4fd-haskell-project-plan-to-nix-pkgs
calculateNoHash
->/nix/store/6c8mdm4a5a151nxn8yjm04mc1a2hq7zz-haskell-project-plan-to-nix-pkgs
Whose definition is
haskell.nix/lib/materialize.nix
Lines 131 to 139 in 1ad94ae
One would expect calculateUseHash
to be a wrapper around calculateNoHash
but
❯ nix derivation show /nix/store/giba13w486j458p7l3jwg0rqc2zvw4fd-haskell-project-plan-to-nix-pkgs | jq -r '.[].env.buildCommand'
cp -Lr /nix/store/20s0023rxwcik9qj5yww8avz156i821h-haskell-project-plan-to-nix-pkgs $out
# Make sure output files can be removed from the sandbox
chmod -R +w $out
which is "the other" plan.
Maybe @hamishmack has better insight.
from haskell.nix.
Adding --show-trace
shows that somehow c2hs is involved:
… while evaluating the attribute 'buildPackages.c2hs.components.exes.c2hs'
So here is a theory: It tries to build c2hs
as a build tool in the non-cross way, and in order to do so it checks the build plan of that tool?
from haskell.nix.
I found this work-around; not sure how idiomatic that is:
diff --git a/default.nix b/default.nix
index 6f06728..487dfc3 100644
--- a/default.nix
+++ b/default.nix
@@ -53,6 +53,9 @@ let
modules = [{
# smaller files
packages.tttool.dontStrip = false;
+ packages.proteaaudio.components.library.build-tools = pkgs.lib.mkForce [
+ pkgs.buildPackages.haskellPackages.c2hs
+ ];
}] ++
pkgs.lib.optional pkgs.hostPlatform.isMusl {
packages.tttool.configureFlags = [ "--ghc-option=-static" ];
~
from haskell.nix.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from haskell.nix.
Related Issues (20)
- Cabal patches fail to apply to 3.10.3 HOT 1
- Help using extraPkgconfigMappings HOT 2
- HLS 2.7.0.0 HOT 2
- Package builds with stack, doesn't build with haskell.nix HOT 2
- Non-existent ghc-boot-9.8.2 package referenced in stackage nightly nix file HOT 3
- OS-specific conditional dependencies are excluded from the package set during cross-compilation
- Typo in `nix-tools/nix-tools/cabal2nix/Main.hs` error
- Unexpected WARNING(s) when `compiler-nix-name = ghc96*`. HOT 1
- Can't create shell with cabal-fmt and GHC 9.10 HOT 3
- Set arch-native: False for hashable >= 1.4.5.0 HOT 2
- New git config safe.directory's default breaks support for source-repository-package HOT 4
- Cabal patches fail to apply to 3.10.3 HOT 2
- can't build ghc because recent nixpkgs lacks ghc962 HOT 6
- GHC 9.6.6 HOT 1
- Regression: Mingw-w64 runtime failure: 32 bit pseudo relocation
- Is cache.zw3rk.com down?
- Can't update boot packages with haskell.nix that can be updated fine with stack HOT 2
- warning: postgresql: argument enableSystemd is deprecated, please use systemdSupport instead.
- Binary cache not getting hit and GHC keeps building?
- `hackageNix` update results in missing hsc2hs tool dependency for `network` HOT 1
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 haskell.nix.