Skip to content
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

[ADP-3226] Update indexState in haskell.nix #4843

Merged
merged 7 commits into from
Dec 17, 2024

Conversation

HeinrichApfelmus
Copy link
Contributor

@HeinrichApfelmus HeinrichApfelmus commented Nov 16, 2024

This pull request updates the indexState in our haskell.nix configuration, with the intent to populate the Hoogle index for the cardano-wallet-agda repository again.

This pull request also removes some cruft from our nix files.

Issue Number

ADP-3226

@HeinrichApfelmus HeinrichApfelmus self-assigned this Nov 16, 2024
@HeinrichApfelmus HeinrichApfelmus force-pushed the HeinrichApfelmus/ADP-3226/fix-hoogle branch 2 times, most recently from 272eac4 to b343873 Compare November 19, 2024 13:45
@HeinrichApfelmus HeinrichApfelmus force-pushed the HeinrichApfelmus/ADP-3226/fix-hoogle branch 2 times, most recently from 78508b0 to 9e619ec Compare December 17, 2024 11:21
Comment on lines -7 to -8
# Regenerate --sha256 hashes in cabal.project
nix build .#checkCabalProject -o check-cabal-project.sh && ./check-cabal-project.sh
Copy link
Member

Choose a reason for hiding this comment

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

🤔 Don't we want/need this?

Copy link
Member

Choose a reason for hiding this comment

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

If we mistype a hash in the cabal.project and direnv reload we get

direnv: loading ~/IOHK/cardano-wallet/.envrc
direnv: using flake
warning: Git tree '/Users/anviking/IOHK/cardano-wallet' is dirty
warning: ignoring the client-specified setting 'system', because it is a restricted setting and you are not a trusted user
warning: ignoring the client-specified setting 'system', because it is a restricted setting and you are not a trusted user
copying '/nix/store/lnwcc18q3mhx7saikwp1v93cib179w91-source' to the storedirenv: ([/opt/homebrew/bin/direnv export fish]) is taking a while to execute. Use CTRL-C to give up.
error: hash mismatch in fixed-output derivation '/nix/store/514wdhm14ymi53aayd85qbqfzys4bsd1-cardano-wallet-agda-f3479b5.drv':
         specified: sha256-fx5hsiOJZYuo37YIMTXUWcjqtigLNvT/3Yn/wOuZpgE=
            got:    sha256-fx5hsiOJZYuo37YIMTXUWcjqtigLNvT/3Yn/wOuZpoE=
error: 1 dependencies of derivation '/nix/store/xpg5g53xkjxx3snl3zvrgbi9l9q2ky2p-source-repository-package.drv' failed to build
error:
       … while evaluating the attribute 'shell'
         at /nix/store/wzhjzixv6w1x664vhsajrckalkhgr588-source/overlays/haskell.nix:849:13:
          848|             # Default shell
          849|             shell = shellFor rawProject.args.shell;
             |             ^
          850|while evaluating the attribute 'hsPkgs.shellFor'
         at /nix/store/wzhjzixv6w1x664vhsajrckalkhgr588-source/overlays/haskell.nix:693:44:
          692|               project = addProjectAndPackageAttrs rec {
          693|                   inherit (pkg-set.config) hsPkgs;
             |                                            ^
          694|                   inherit pkg-set;

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: 1 dependencies of derivation '/nix/store/r4rw99sfibcayr3318mfhv74ijmw8y0d-cardano-wallet-plan-to-nix-pkgs.drv' failed to build

Copy link
Contributor Author

@HeinrichApfelmus HeinrichApfelmus Dec 17, 2024

Choose a reason for hiding this comment

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

Don't we want/need this?

Automatically fetching the --sha256 hashes was a more pressing issue at a time when CHaP did not yet exist, and we imported all Cardano dependencies via source-repository-package stanzas. Today, I think the cost of maintaining that automation is higher than manually adding --sha256 hashes for the few repositories that we do import in this way.

Copy link
Member

Choose a reason for hiding this comment

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

I think the cost of maintaining that automation is higher than manually adding

We can't just keep the inherit (pkgs) checkCabalProject line + this call?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately not — the checkCabalProject is actually provided by the iohkNix input (which adds it to pkgs via the overlay mechanism), which has bitrotted to the point where importing it breaks. See also input-output-hk/iohk-nix#589 .

Copy link
Member

@Anviking Anviking left a comment

Choose a reason for hiding this comment

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

Haven't rebuilt the world to try this locally but LGTM

Comment on lines -7 to -8
# Regenerate --sha256 hashes in cabal.project
nix build .#checkCabalProject -o check-cabal-project.sh && ./check-cabal-project.sh
Copy link
Member

Choose a reason for hiding this comment

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

I think the cost of maintaining that automation is higher than manually adding

We can't just keep the inherit (pkgs) checkCabalProject line + this call?

@@ -1 +1 @@
[ "address-derivation-discovery" "cardano-api-extra" "cardano-balance-tx" "cardano-coin-selection" "cardano-numeric" "cardano-wallet" "cardano-wallet-api" "cardano-wallet-benchmarks" "cardano-wallet-blackbox-benchmarks" "cardano-wallet-integration" "cardano-wallet-launcher" "cardano-wallet-network-layer" "cardano-wallet-primitive" "cardano-wallet-read" "cardano-wallet-secrets" "cardano-wallet-test-utils" "cardano-wallet-unit" "customer-deposit-wallet" "delta-chain" "delta-store" "delta-table" "delta-types" "faucet" "local-cluster" "text-class" "wai-middleware-logging" ]
[ "address-derivation-discovery" "cardano-api-extra" "cardano-balance-tx" "cardano-coin-selection" "cardano-numeric" "cardano-wallet" "cardano-wallet-api" "cardano-wallet-application-extras" "cardano-wallet-benchmarks" "cardano-wallet-blackbox-benchmarks" "cardano-wallet-buildkite" "cardano-wallet-e2e" "cardano-wallet-exe" "cardano-wallet-integration" "cardano-wallet-launcher" "cardano-wallet-network-layer" "cardano-wallet-primitive" "cardano-wallet-secrets" "cardano-wallet-test-utils" "cardano-wallet-ui" "cardano-wallet-unit" "crypto-primitives" "customer-deposit-wallet" "delta-chain" "delta-store" "delta-table" "delta-types" "faucet" "iohk-monitoring-extra" "local-cluster" "std-gen-seed" "temporary-extra" "text-class" "wai-middleware-logging" ]
Copy link
Member

Choose a reason for hiding this comment

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

😮

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At least the list is up-to-date now. 😅

@HeinrichApfelmus
Copy link
Contributor Author

HeinrichApfelmus commented Dec 17, 2024

Dang. It looks like Windows cross-compilation does not work with the new version of haskell.nix.

I will try to adapt this pull request to only remove the cruft in our .nix files and leave the update for a later pull request.

@HeinrichApfelmus HeinrichApfelmus force-pushed the HeinrichApfelmus/ADP-3226/fix-hoogle branch from 7fde8cb to 6693055 Compare December 17, 2024 13:01
@HeinrichApfelmus
Copy link
Contributor Author

Luckily, it seems that the commit "Update indexState to match cardano-wallet-agda" was enough to populate the Hoogle index again — it seems that there is no need to update the haskell.nix input.

@HeinrichApfelmus HeinrichApfelmus changed the title [ADP-3226] Update nix flake [ADP-3226] Update haskell.nix index-state Dec 17, 2024
@HeinrichApfelmus HeinrichApfelmus changed the title [ADP-3226] Update haskell.nix index-state [ADP-3226] Update indexState in haskell.nix Dec 17, 2024
@HeinrichApfelmus HeinrichApfelmus added this pull request to the merge queue Dec 17, 2024
Merged via the queue into master with commit b3a29cc Dec 17, 2024
29 checks passed
@HeinrichApfelmus HeinrichApfelmus deleted the HeinrichApfelmus/ADP-3226/fix-hoogle branch December 17, 2024 14:55
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.

2 participants