Skip to content

cardano-testnet seems to make assumptions about where it is run #4194

Closed
IntersectMBO/hedgehog-extras
#77

Description

@locallycompact

Hi, I discovered the cardano-testnet executable, I was hoping to run it against a derivation containing the config for a private testnet but apparently I can not run it at all through nix.

nix build .#cardano-testnet
./result/bin/cardano-testnet cardano
    ━━━ Exception (IOException) ━━━
    ../dist-newstyle/cache/plan.json: openBinaryFile: does not exist (No such file or directory)

    This failure can be reproduced by running:
    > recheck (Size 0) (Seed 14417734425994254147 11580250401777982633) <property>

Why is it trying to look for things in dist-newstyle?

Activity

  1. added
    bug
    on Jul 18, 2022
  2. eyeinsky commented on Sep 29, 2022

    @eyeinsky
    Contributor

    I've just run into this as well, @locallycompact did you ever managed to resolve or work around it?

  3. koslambrou commented on Sep 29, 2022

    @koslambrou
    Contributor

    I fixed it locally by making the following env variables for Nix:

    export CARDANO_CLI=${config.hsPkgs.cardano-cli.components.exes.cardano-cli}/bin/cardano-cli${pkgs.stdenv.hostPlatform.extensions.executable}
    export CARDANO_NODE=${config.hsPkgs.cardano-node.components.exes.cardano-node}/bin/cardano-node${pkgs.stdenv.hostPlatform.extensions.executable}
    export CARDANO_NODE_SRC=${src}
    
  4. Jimbo4350 commented on Oct 27, 2022

    @Jimbo4350
    Contributor

    Closing this. Please reopen if this is still relevant.

  5. gilligan commented on Nov 22, 2024

    @gilligan

    I had the same issue outlined here where I get the error with opening ../dist-newstyle/cache/plan.json unless CARDANO_CLI and CARDANO_NODE are set.

    Setting those solves the issue but this still seems like a workaround to an actual problem to me.

  6. self-assigned this
    on Nov 22, 2024
  7. smelc commented on Dec 9, 2024

    @smelc
    Contributor

    This issue has also been reported by @johnalotoski here on Slack.

  8. removed
    bug
    on Jan 29, 2025
  9. smelc commented on Mar 18, 2025

    @smelc
    Contributor

    This is still an issue (on 238b4c8), reproducible as follows:

    # While in cardano-node repository
    cabal build cardano-testnet
    cabal build cardano-node
    
    export TMP_PATH=$(mktemp -d)
    
    cp $(cabal list-bin cardano-testnet) $(cabal list-bin cardano-node) $TMP_PATH/.
    cd $TMP_PATH
    ./cardano-testnet cardano --num-pool-nodes 3 --testnet-magic 42
    ... lots of output
        ━━━ Exception (ErrorCall) ━━━
        Could not find plan.json in the path: dist-newstyle/cache/plan.json
        CallStack (from HasCallStack):
          createSPOGenesisAndFiles, called at src/Testnet/Start/Cardano.hs:199:8 in cardano-testnet-10.0.0-inplace:Testnet.Start.Cardano
          cardanoTestnet, called at src/Testnet/Start/Cardano.hs:93:3 in cardano-testnet-10.0.0-inplace:Testnet.Start.Cardano
          cardanoTestnetDefault, called at src/Parsers/Run.hs:71:61 in cardano-testnet-10.0.0-inplace:Parsers.Run
      
        This failure can be reproduced by running:
        > recheckAt (Seed 9184080727122563869 11195688623784977365) "1:" <property>
    
  10. smelc commented on Mar 18, 2025

    @smelc
    Contributor

    We need to change hedgehog-extras's binDist function which errors here: https://github.com/input-output-hk/hedgehog-extras/blob/a8120b84d1baa4b26c69668fc37f307ba9e942e1/src/Hedgehog/Extras/Test/Process.hs#L302 when 1/ the environment variable for searching the executable isn't defined and 2/ the plan.json file doesn't exist.

    As a long-term solution, we should not error out in this function, but rather have the callers handle the different failures. As a short-term solution, we should have a better error message when we fail, indicating that the environment variable can be defined as a workaround. I'm going to do the short-term solution to see how much progress we get regarding running cardano-testnet locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions