aleeusgr / gimbalabs-dandelion-pbl

Test Driven Development of dApps on Cardano
MIT License
1 stars 1 forks source link

gimbalabs: build test via haskell.nix #12

Closed aleeusgr closed 1 year ago

aleeusgr commented 1 year ago

Now I have three ways to complete a user test in plutus-apps; The test is to run any contract: produce cborhex and run a cli request and compare it's output with a pre-defined value. Always succeds or the code from 101.

my options are:

cd plutus-apps -> git-checkout -> nix-shell cd plutus-apps -> git-checkout -> nix develop nixos-rebuild Why nix develop ? flake.nix

User test

Step 2: Start Plutus-Apps

In cabal.project, look for the expected tag for plutus-apps

Change directory to /plutus-apps that was cloned earlier (hint: for this project, it's v2022-04-06) In /plutus-apps, run git checkout v2022-04-06. in /plutus-apps run nix-shell

You will know you are successful if: You can see the nix command line [nix-shell:~/.../plutus-apps]$

aleeusgr commented 1 year ago

Ok, instead of that, I want to be able to run nix develop in the folder, and the use nix to choose proper tag for me.

aleeusgr commented 1 year ago

Following this guide: https://input-output-hk.github.io/haskell.nix/tutorials/getting-started-flakes.html

You just created an haskell.nix template using hix. Read more about it here

aleeusgr commented 1 year ago

trace: WARNING: No sha256 found for source-repository-package https://github.com/input-output-hk/plutus-apps.git v2022-04-06 download may fail in restricted mode (hydra) error: in pure evaluation mode, 'fetchTree' requires a locked input, at /nix/store/mrdp8ykh0l1lkrylh92rs658060d1jj4-source/lib/call-cabal-project-to-nix.nix:218:25 (use '--show-trace' to show detailed location information)

aleeusgr commented 1 year ago

Huh! not so fast; its actually more pain then anything. Nix wants you to manually (its an idea to automate, actually) find out sha256 of the particular git commit you are referring to in the imports.

so grab yourself nix-prefetch-github and find out the hash!

aleeusgr commented 1 year ago

cabal: Could not resolve dependencies:
[0] trying: Win32-network-0.1.0.0 (user goal)
[
1] trying: base-4.14.3.0/installed-4.14.3.0 (dependency of Win32-network)
[2] trying: plutus-tx-plugin-0.1.0.0 (user goal)
[
3] trying: plutus-tx-plugin:-use-ghc-stub
[4] next goal: ghc (dependency of plutus-tx-plugin -use-ghc-stub)
[
4] rejecting: ghc-9.2.1, ghc-9.0.2 (conflict: plutus-tx-plugin
-use-ghc-stub => ghc>=8.10 && <9)
[4] rejecting: ghc-8.10.2 (conflict: base==4.14.3.0/installed-4.14.3.0, ghc => base<0 && >=4.14 && <4.15) [4] skipping: ghc-8.10.1, ghc-8.8.3, ghc-8.8.1, ghc-8.6.5, ghc-8.6.4, ghc-8.6.1, ghc-8.4.4, ghc-8.4.3, ghc-8.4.1, ghc-8.2.2, ghc-8.2.1 (has the same characteristics that caused the previous version to fail: excludes 'base' version 4.14.3.0) [__4] fail (backjumping, conflict set: base, ghc, plutus-tx-plugin, plutus-tx-plugin:use-ghc-stub) After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: ghc, base, plutus-tx-plugin, plutus-tx-plugin:use-ghc-stub, Win32-network Try running with --minimize-conflict-set to improve the error message.