Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ packages: cardano-constitution
plutus-tx
plutus-tx-plugin
doc/docusaurus/docusaurus-examples.cabal
--plutus-profiled-plugin-test

-- We never, ever, want this.
write-ghc-environment-files: never
Expand Down
77 changes: 56 additions & 21 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions nix/agda-tools.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{ self, pkgs, lib }:
{ inputs, self, pkgs, lib }:

let

# Agda standard library pinned to v2.1.1.
# Used in: `nix/metatheory.nix` (as a build input) and `nix/shell.nix` (via agda-with-stdlib).
agda-stdlib = agda-packages.standard-library.overrideAttrs (oldAtts: rec {
agda-stdlib = agda-packages.standard-library.overrideAttrs (oldAttrs: rec {

version = "2.1.1";

Expand Down Expand Up @@ -68,7 +68,7 @@ let
};
};
in
pkgs.agdaPackages.override {
inputs.nixpkgs-2405.legacyPackages.${pkgs.stdenv.hostPlatform.system}.agdaPackages.override {
Agda = frankenAgda;
pkgs = frankenPkgs;
};
Expand Down
2 changes: 1 addition & 1 deletion nix/metatheory.nix
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ let
{
buildInputs = [
pkgs.jekyll
inputs.nixpkgs-2405.legacyPackages.${pkgs.system}.linkchecker
inputs.nixpkgs-2405.legacyPackages.${pkgs.stdenv.hostPlatform.system}.linkchecker
];
} ''
mkdir "$out"
Expand Down
76 changes: 28 additions & 48 deletions nix/outputs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let
{ inherit pkgs; };

agda-tools = import ./agda-tools.nix
{ inherit self pkgs lib; };
{ inherit inputs self pkgs lib; };

build-latex-doc = import ./build-latex-doc.nix
{ inherit pkgs lib agda-tools; };
Expand Down Expand Up @@ -76,18 +76,12 @@ let

project-variants-hydra-jobs = {
ghc96 = (project.flake { }).hydraJobs.ghc96;
ghc98 = (project.flake { }).hydraJobs.ghc98;
ghc910 = (project.flake { }).hydraJobs.ghc910;
ghc912 = (project.flake { }).hydraJobs.ghc912;
};

project-variants-roots-and-plan-nix = {
ghc96.roots = project-variants-hydra-jobs.ghc96.roots;
ghc96.plan-nix = project-variants-hydra-jobs.ghc96.plan-nix;
ghc98.roots = project-variants-hydra-jobs.ghc98.roots;
ghc98.plan-nix = project-variants-hydra-jobs.ghc98.plan-nix;
ghc910.roots = project-variants-hydra-jobs.ghc910.roots;
ghc910.plan-nix = project-variants-hydra-jobs.ghc910.plan-nix;
ghc912.roots = project-variants-hydra-jobs.ghc912.roots;
ghc912.plan-nix = project-variants-hydra-jobs.ghc912.plan-nix;
};
Expand All @@ -97,74 +91,63 @@ let
exposed-haskell-packages //
extra-artifacts;

non-profiled-shells = rec {
default = ghc96;
ghc96 = mkShell "ghc96";
ghc98 = mkShell "ghc98";
ghc910 = mkShell "ghc910";
ghc912 = mkShell "ghc912";
};

# The default shell contains the agda-with-stdlib-and-metatheory package which will
# break on `nix develop` if the .lagda files are broken. In order to escape this
# situation we introduce a shell that doesn't contain that executable.
metatheory-jailbreak-shell = non-profiled-shells.default.overrideAttrs (attrs: {
metatheory-jailbreak-shell = devShells.default.overrideAttrs (attrs: {
buildInputs =
lib.remove metatheory.agda-with-stdlib-and-metatheory attrs.buildInputs;
nativeBuildInputs =
lib.remove metatheory.agda-with-stdlib-and-metatheory attrs.nativeBuildInputs;
});

devShells =
(non-profiled-shells) //
{ profiled = mkShell project.projectVariants.ghc96-profiled; } //
{ metatheory-jailbreak = metatheory-jailbreak-shell; };

full-nested-ci-jobs = {
"x86_64-linux" =
(project-variants-hydra-jobs) //
(windows-hydra-jobs) //
(packages) //
{ devShells = non-profiled-shells; } //
{ required = hydra-required-job; };
"x86_64-darwin" =
(project-variants-hydra-jobs) //
{ devShells = non-profiled-shells; } //
{ required = hydra-required-job; };
"aarch64-linux" =
{ };
"aarch64-darwin" =
(project-variants-roots-and-plan-nix) //
{ devShells = non-profiled-shells; } //
{ required = hydra-required-job; };
devShells = rec {
default = ghc96;
ghc96 = mkShell "ghc96";
ghc912 = mkShell "ghc912";
ghc96-profiled = mkShell "ghc96-profiled";
ghc96-plugin = mkShell "ghc96-plugin";
ghc96-plugin2 = mkShell "ghc96-plugin2";
metatheory-jailbreak = metatheory-jailbreak-shell;
};

small-nested-ci-jobs = {
test-profiled-ghc =
project.projectVariants.ghc96-plugin.hsPkgs.plutus-tx-plugin.components.tests.plutus-tx-plugin-tests; # editorconfig-checker-disable-line

nested-ci-jobs = {
"x86_64-linux" =
(windows-hydra-jobs) //
(packages) //
{ ghc96 = project-variants-hydra-jobs.ghc96; } //
{ ghc912 = project-variants-hydra-jobs.ghc912; } //
{ devShells.default = non-profiled-shells.default; } //
{ devShells.ghc96 = devShells.ghc96; } //
{ devShells.ghc912 = devShells.ghc912; } //
{ devShells.ghc96-plugin = devShells.ghc96-plugin; } //
{ devShells.ghc96-plugin2 = devShells.ghc96-plugin2; } //
{ devShells.metatheory-jailbreak = metatheory-jailbreak-shell; } //
{ inherit test-profiled-ghc; } //
{ required = hydra-required-job; };
"x86_64-darwin" =
{ ghc96 = project-variants-hydra-jobs.ghc96; } //
{ ghc912 = project-variants-hydra-jobs.ghc912; } //
{ devShells.default = non-profiled-shells.default; } //
{ devShells.ghc96 = devShells.ghc96; } //
{ devShells.ghc912 = devShells.ghc912; } //
{ devShells.ghc96-plugin = devShells.ghc96-plugin; } //
{ devShells.ghc96-plugin2 = devShells.ghc96-plugin2; } //
{ devShells.metatheory-jailbreak = metatheory-jailbreak-shell; } //
{ inherit test-profiled-ghc; } //
{ required = hydra-required-job; };
"aarch64-linux" =
{ };
"aarch64-darwin" =
{ devShells.default = non-profiled-shells.default; } //
(project-variants-roots-and-plan-nix) //
{ devShells.ghc96 = devShells.ghc96; } //
{ devShells.ghc912 = devShells.ghc912; } //
{ devShells.metatheory-jailbreak = metatheory-jailbreak-shell; } //
{ required = hydra-required-job; };
};

flattened-ci-jobs = utils.flattenDerivationTree ":" small-nested-ci-jobs;

ciJobs = utils.flattenDerivationTree ":" small-nested-ci-jobs.${system};
ciJobs = utils.flattenDerivationTree ":" nested-ci-jobs.${system};

checks = ciJobs;

Expand All @@ -181,9 +164,6 @@ let
inherit windows-hydra-jobs;
inherit static-haskell-packages;
inherit exposed-haskell-packages;
inherit flattened-ci-jobs;
inherit full-nested-ci-jobs;
inherit small-nested-ci-jobs;
inherit metatheory;
inherit project-coverage-report;
};
Expand Down
13 changes: 13 additions & 0 deletions nix/profiled-ghc-964.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/hadrian/src/Flavour.hs b/hadrian/src/Flavour.hs
index a281a2401a..da513a70e8 100644
--- a/hadrian/src/Flavour.hs
+++ b/hadrian/src/Flavour.hs
@@ -221,7 +221,7 @@ viaLlvmBackend = addArgs $ notStage0 ? builder Ghc ? arg "-fllvm"
-- dynamically-linker.
enableProfiledGhc :: Flavour -> Flavour
enableProfiledGhc flavour =
- enableLateCCS flavour { rtsWays = do
+ flavour { rtsWays = do
ws <- rtsWays flavour
pure $ (Set.map (\w -> if wayUnit Dynamic w then w else w <> profiling) ws) <> ws
, libraryWays = (Set.singleton profiling <>) <$> (libraryWays flavour)
14 changes: 11 additions & 3 deletions nix/project.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,21 @@ let

flake.variants = {
ghc96 = { }; # Alias for the default project
ghc912.compiler-nix-name = "ghc912";
ghc96-profiled.modules = [{
enableProfiling = true;
enableLibraryProfiling = true;
}];
ghc98.compiler-nix-name = "ghc98";
ghc910.compiler-nix-name = "ghc910";
ghc912.compiler-nix-name = "ghc912";
ghc96-plugin = {
ghcOverride = pkgs.haskell-nix.compiler.ghc967.override {
extraFlavourTransformers = [ "+profiled_ghc+no_dynamic_ghc" ];
ghc-patches = [ ./profiled-ghc-964.patch ];
};
modules = [{
enableProfiling = true;
enableLibraryProfiling = true;
}];
};
ghc96-coverage.modules = [{
packages.plutus-metatheory.doCoverage = true;
packages.plutus-core.doCoverage = true;
Expand Down
Loading