Skip to content

Conversation

@Savissy
Copy link

@Savissy Savissy commented Nov 19, 2025

Pre-submit checklist:

  • Branch
    • Tests are provided (if possible)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
    • Changelog fragments have been written (if appropriate)
    • Relevant tickets are mentioned in commit messages
    • Formatting, PNG optimization, etc. are updated
  • PR
    • (For external contributions) Corresponding issue exists and is linked in the description
    • Targeting master unless this is a cherry-pick backport
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

-- https://github.com/IntersectMBO/plutus/pull/7236
constraints: setup.optparse-applicative >=0.19.0.0
allow-newer: turtle:optparse-applicative
multi-repl: True
Copy link
Author

Choose a reason for hiding this comment

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

Needed for enabling the creation of multiple repl environment

Choose a reason for hiding this comment

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

This is really a good one. I also have constant issues with nix shell, I believe if the nix shell is updated, building dApp with Plutus won’t be an issues.

Great Job, Dev Saviour

Copy link

@Onyinyechi46 Onyinyechi46 left a comment

Choose a reason for hiding this comment

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

Approve this

, inline-r:primitive

-- https://github.com/IntersectMBO/plutus/pull/7236
constraints: setup.optparse-applicative >=0.19.0.0

Choose a reason for hiding this comment

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

This is really Impressive. I’m sure this pull request will be merged successfully, dev.

@basetunnel
Copy link
Collaborator

Hi, please follow the pre-submit checklist. What problem does this solve? Is there a related github issue?

@Savissy Savissy changed the title Recreate nix shell to run all plutus smart contracts Modify flake.nix and flame.lock files to run all plutus smart contracts Nov 22, 2025
@Savissy Savissy changed the title Modify flake.nix and flame.lock files to run all plutus smart contracts Modify flake.nix and flake.lock files to run all plutus smart contracts Nov 22, 2025
@Savissy
Copy link
Author

Savissy commented Nov 22, 2025

Hi, please follow the pre-submit checklist. What problem does this solve? Is there a related github issue?

Yes please, just did that and a related issue has been created. These changes aim to solve the issue of the nix shell not compiling Plutus scripts having the Plutus.V2.Ledger.Api module. Thank you so much for the response.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR attempts to simplify the Nix flake configuration but fundamentally breaks the Plutus Core project infrastructure. The changes completely remove the haskell.nix build system that the entire project depends on, replace the correct GHC 9.6 compiler with an incompatible GHC 8.10.7, remove essential dependencies (CHaP repository, HLS, Agda, R, Coq toolchain), and strip away all CI/CD integration points. Despite the PR title mentioning "run all plutus smart contracts", these changes would prevent any Plutus code from building or running.

Key Changes:

  • Complete replacement of the haskell.nix-based Nix flake with a minimal configuration
  • Downgrade from GHC 9.6.x to GHC 8.10.7
  • Removal of all critical infrastructure (CHaP, hackage, haskell-nix, iohk-nix, pre-commit-hooks)
  • Addition of multi-repl: True to cabal.project (unrelated to stated purpose)

Reviewed changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 6 comments.

File Description
flake.nix Complete rewrite removing haskell.nix infrastructure, using wrong GHC version (8.10.7 instead of 9.6), missing critical dependencies (CHaP, HLS, Agda, R, Coq), and removing all flake outputs except devShell
flake.lock Removes all pinned dependencies (CHaP, hackage, haskell-nix, iohk-nix, pre-commit-hooks) and downgrades nixpkgs from unstable to 23.05, breaking reproducible builds
cabal.project Adds multi-repl feature which is unrelated to PR purpose but is a reasonable development improvement
Default.nix Emptied file with no changes to functionality

-- https://github.com/IntersectMBO/plutus/pull/7236
constraints: setup.optparse-applicative >=0.19.0.0
allow-newer: turtle:optparse-applicative
multi-repl: True
Copy link

Copilot AI Nov 22, 2025

Choose a reason for hiding this comment

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

The multi-repl: True addition is a reasonable improvement for development workflow, allowing multiple GHCi sessions. However, this change is unrelated to the PR's stated purpose of "running all plutus smart contracts" and should ideally be in a separate PR for clarity.

Suggested change
multi-repl: True

Copilot uses AI. Check for mistakes.
Comment on lines +26 to +34
devShell = pkgs.mkShell {
inherit buildInputs;
shellHook = ''
export LD_LIBRARY_PATH="${libPath}:$LD_LIBRARY_PATH"
echo "GHC version: $(ghc --version)"
echo "Cabal version: $(cabal --version)"
'';
};
});
Copy link

Copilot AI Nov 22, 2025

Choose a reason for hiding this comment

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

The new flake.nix only provides a devShell output. The original flake exposes multiple essential outputs used throughout the project:

  • packages - built executables like plc, uplc, pir, plutus (see nix/outputs.nix lines 38-47)
  • Multiple shell variants - ghc96, ghc98, ghc910, profiled, metatheory-jailbreak (see nix/outputs.nix lines 93-113)
  • checks - test suites run by CI
  • hydraJobs - CI build artifacts for different platforms (see nix/outputs.nix lines 115-181)

Removing these breaks CI/CD pipelines (.github/workflows/), Nix builds documented in CONTRIBUTING.adoc, and the ability to build static executables or cross-compile for Windows (nix/outputs.nix lines 49-60).

Copilot uses AI. Check for mistakes.
@@ -1,44 +1,35 @@
{
description = "Plutus Core";
description = "Custom Haskell environment with GHC 8.10.7 and cabal-install 3.8.1.0";
Copy link

Copilot AI Nov 22, 2025

Choose a reason for hiding this comment

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

The description "Custom Haskell environment with GHC 8.10.7 and cabal-install 3.8.1.0" is misleading and inconsistent with the PR title "Modify flake.nix and flake.lock files to run all plutus smart contracts". The description should match the project's actual purpose, which is "Plutus Core" (the original description). Plutus Core is not a custom Haskell environment but the scripting language for Cardano.

Suggested change
description = "Custom Haskell environment with GHC 8.10.7 and cabal-install 3.8.1.0";
description = "Plutus Core: the scripting language for Cardano";

Copilot uses AI. Check for mistakes.
Comment on lines 1 to 35
{
description = "Plutus Core";
description = "Custom Haskell environment with GHC 8.10.7 and cabal-install 3.8.1.0";

inputs = {
nixpkgs-2405.follows = "haskell-nix/nixpkgs-2405";

nixpkgs.follows = "haskell-nix/nixpkgs";

hackage = {
url = "github:input-output-hk/hackage.nix";
flake = false;
};

CHaP = {
url = "github:IntersectMBO/cardano-haskell-packages?ref=repo";
flake = false;
};

haskell-nix = {
url = "github:input-output-hk/haskell.nix";
inputs.hackage.follows = "hackage";
};

iohk-nix = {
url = "github:input-output-hk/iohk-nix";
inputs.nixpkgs.follows = "nixpkgs";
};

nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
flake-utils.url = "github:numtide/flake-utils";

pre-commit-hooks.url = "github:cachix/git-hooks.nix";
};

outputs = inputs: inputs.flake-utils.lib.eachDefaultSystem (system:
import ./nix/outputs.nix { inherit inputs system; }
);

nixConfig = {
extra-substituters = [ "https://cache.iog.io" ];
extra-trusted-public-keys =
[ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ];
allow-import-from-derivation = true;
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
haskellPackages = pkgs.haskell.packages.ghc8107;
buildInputs = [
haskellPackages.ghc
haskellPackages.cabal-install
pkgs.git
pkgs.curl
pkgs.zlib
pkgs.pkg-config
pkgs.libsodium
pkgs.secp256k1
];
libPath = pkgs.lib.makeLibraryPath buildInputs;
in {
devShell = pkgs.mkShell {
inherit buildInputs;
shellHook = ''
export LD_LIBRARY_PATH="${libPath}:$LD_LIBRARY_PATH"
echo "GHC version: $(ghc --version)"
echo "Cabal version: $(cabal --version)"
'';
};
});
}
Copy link

Copilot AI Nov 22, 2025

Choose a reason for hiding this comment

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

The simplified flake.nix completely removes the haskell.nix infrastructure that Plutus Core depends on. This change removes:

  • CHaP (Cardano Haskell Packages) repository
  • haskell.nix project configuration
  • Pre-commit hooks
  • iohk-nix infrastructure
  • The nix/outputs.nix orchestration

The project explicitly requires haskell.nix (see CONTRIBUTING.adoc line 60 and nix/project.nix) to build Plutus Core. The new configuration uses basic nixpkgs haskellPackages which cannot build the Plutus packages. This will break all development workflows, CI pipelines, and Nix builds.

Copilot uses AI. Check for mistakes.
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
haskellPackages = pkgs.haskell.packages.ghc8107;
Copy link

Copilot AI Nov 22, 2025

Choose a reason for hiding this comment

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

GHC 8.10.7 is incompatible with Plutus Core. The project uses GHC 9.6 (ghc96) as the default compiler (see nix/project.nix line 12 and nix/outputs.nix line 94-97), with support for GHC 9.8 and 9.10 variants. GHC 8.10.7 is from 2021 and lacks features required by the codebase. CI also tests against ghc96, ghc98, and ghc910 (see .github/workflows/cabal-build-all.yml).

Copilot uses AI. Check for mistakes.
Comment on lines +14 to +23
buildInputs = [
haskellPackages.ghc
haskellPackages.cabal-install
pkgs.git
pkgs.curl
pkgs.zlib
pkgs.pkg-config
pkgs.libsodium
pkgs.secp256k1
];
Copy link

Copilot AI Nov 22, 2025

Choose a reason for hiding this comment

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

Critical dependencies missing from buildInputs. The new configuration is missing essential Plutus dependencies:

  • Haskell Language Server (HLS) - required for IDE support (see CONTRIBUTING.adoc line 49-53)
  • R with packages - required for cost model benchmarks (see nix/project.nix lines 45-49)
  • Agda with stdlib - required for metatheory formal verification (see nix/agda-tools.nix and plutus-metatheory/)
  • diffutils - required for test suites (see nix/project.nix lines 51-61)
  • Coq and OCaml toolchain - required for plutus-cert (see nix/project.nix lines 68-78)
  • Pre-commit hooks tooling (see CONTRIBUTING.adoc lines 21-29)

Additionally, the CHaP repository containing Cardano-specific Haskell packages is completely removed, making it impossible to resolve dependencies like cardano-haskell-packages (see cabal.project lines 2-11).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants