Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
Upgrade to PureScript 0.14.5 (#66)
Browse files Browse the repository at this point in the history
* Update purescript to 0.14.5

* Upgrade package set

* Update materialized plan

* Update PSGenerator

* Update generic imports

* Update BigInteger usages

* Remove local web-common

* Remove JsonTuple imports

* Fix servant-support imports

* Remove TestUtils imports

* Remove other Data.Json

* Add missing Cursor module

* fix last import errors

* Upgrade plutus-playground to PS 14

* Turn warnings into errors

* Fix all warnings in playground

* Update pab-client generator

* Update pab-client package set

* Upgrade plutus-pab-client to PS 14

* Update spago packages nix

* Fix failing tests and switch to purescript-spec

* Update spago packages nix and consolidate package set

* run fix-stylish-haskell

* Update and prune dependencies

* Fix CSS build errors

* Delete plutus PAB client

* Delete plutus PAB client references

* Update servant-purescript

* Fix hydra build

* remove psc-package related stuff

* Fix webpack prod build

* fix haskell styling

* Fix CliSpec error

* Fix all erroneous usages of BigInt.show
  • Loading branch information
jhbertra authored Nov 5, 2021
1 parent c3676cf commit 4e79fa9
Show file tree
Hide file tree
Showing 258 changed files with 1,677 additions and 27,011 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,9 @@ pkgs/.stack
**/yarn-error.log
**/yarn.lock
**/.psci_modules/
**/.psc-package/
**/.psc-package2nix/
**/.spago/
**/.spago2nix/
**/.psa-stash

# Backend config files
marlowe-playground-server/playground.yaml
Expand Down
6 changes: 3 additions & 3 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,16 @@ source-repository-package
location: https://github.com/Quid2/flat.git
tag: ee59880f47ab835dbd73bea0847dab7869fc20d8

-- Needs some patches, but upstream seems to be fairly dead (no activity in > 1 year)
-- TODO replace with something more sustainable (and maintained)
source-repository-package
type: git
location: https://github.com/input-output-hk/purescript-bridge.git
tag: 6a92d7853ea514be8b70bab5e72077bf5a510596
tag: 366fc70b341e2633f3ad0158a577d52e1cd2b138

source-repository-package
type: git
location: https://github.com/input-output-hk/servant-purescript.git
tag: a0c7c7e37c95564061247461aef4be505a853538
tag: ebea59c7bdfc0338d83fca772b9a57e28560bcde

-- Copied from plutus-core
source-repository-package
Expand Down
2 changes: 1 addition & 1 deletion ci.nix
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ let
inherit (plutus-apps.haskell.project) roots;
} // pkgs.lib.optionalAttrs (!rootsOnly) (filterCross {
# build relevant top level attributes from default.nix
inherit (packages) docs tests plutus-playground plutus-pab plutus-use-cases;
inherit (packages) docs tests plutus-playground plutus-use-cases;

# Build the shell expression to be sure it works on all platforms
#
Expand Down
9 changes: 2 additions & 7 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ rec {
plutus-pab-examples
plutus-uniswap;

webCommon = pkgs.callPackage ./web-common { inherit (plutus-apps.lib) gitignore-nix; };
webCommon = pkgs.callPackage sources.web-common { inherit (plutus-apps.lib) gitignore-nix; };
webCommonPlutus = pkgs.callPackage ./web-common-plutus { inherit (plutus-apps.lib) gitignore-nix; };
webCommonPlayground = pkgs.callPackage ./web-common-playground { inherit (plutus-apps.lib) gitignore-nix; };

Expand All @@ -50,11 +50,6 @@ rec {
}) client server generate-purescript start-backend;
};

plutus-pab = pkgs.recurseIntoAttrs (pkgs.callPackage ./plutus-pab-client {
inherit (plutus-apps.lib) buildPursPackage buildNodeModules gitignore-nix filterNpm;
inherit haskell webCommon webCommonPlutus;
});

plutus-use-cases = pkgs.recurseIntoAttrs (pkgs.callPackage ./plutus-use-cases {
inherit haskell;
});
Expand All @@ -63,7 +58,7 @@ rec {
inherit pkgs docs;
inherit (plutus-apps.lib) gitignore-nix;
inherit (plutus-apps) fixStylishHaskell fixPurty fixPngOptimization;
inherit plutus-playground web-ghc plutus-pab;
inherit plutus-playground web-ghc;
src = ./.;
};

Expand Down
25 changes: 21 additions & 4 deletions flake.lock

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

4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@
url = "github:input-output-hk/stackage.nix";
flake = false;
};
web-common = {
url = "github:input-output-hk/purescript-web-common";
flake = false;
};
};

outputs = { self, flake-utils, ... }@inputs:
Expand Down
15 changes: 8 additions & 7 deletions nix/lib/purescript.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
, src
# name of the project
, name
# packages as generated by psc-pacakge2nix
, packages
# spago packages as generated by spago2nix
, spagoPackages
# a map of source directory name to contents that will be symlinked into the environment before building
Expand All @@ -22,7 +20,9 @@
let
addExtraSrc = k: v: "ln -sf ${v} ${k}";
addExtraSrcs = builtins.concatStringsSep "\n" (builtins.attrValues (pkgs.lib.mapAttrs addExtraSrc extraSrcs));
extraPSPaths = builtins.concatStringsSep " " (map (d: "${d}/**/*.purs") (builtins.attrNames extraSrcs));
extraPSPaths = builtins.concatStringsSep " " (map (d: "'${d}/**/*.purs'") (builtins.attrNames extraSrcs));
getGlob = pkg: ''".spago/${pkg.name}/${pkg.version}/src/**/*.purs"'';
spagoSources = builtins.toString (builtins.map getGlob (builtins.attrValues spagoPackages.inputs));
in
stdenv.mkDerivation {
inherit name src checkPhase;
Expand All @@ -31,9 +31,8 @@ stdenv.mkDerivation {
nodeModules
easyPS.purs
easyPS.spago
easyPS.psc-package
easyPS.psa
spagoPackages.installSpagoStyle
spagoPackages.buildSpagoStyle
];
buildPhase = ''
export HOME=$NIX_BUILD_TOP
Expand All @@ -43,8 +42,10 @@ stdenv.mkDerivation {
${addExtraSrcs}
install-spago-style
build-spago-style src/**/*.purs test/**/*.purs ${extraPSPaths}
npm run webpack
echo building project...
psa compile --strict --censor-lib --stash --is-lib=generated --is-lib=.spago ${spagoSources} ${extraPSPaths} "src/**/*.purs" "test/**/*.purs"
echo done.
npm run build:webpack:prod
'';
doCheck = true;
installPhase = ''
Expand Down
26 changes: 3 additions & 23 deletions nix/pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ let
$(nix-build default.nix -A plutus-apps.haskell.extraPackages.updateAllShaFiles --argstr system x86_64-darwin)
'';
updateClientDeps = pkgs.callPackage ./update-client-deps {
inherit purs psc-package spago spago2nix;
inherit purs spago spago2nix;
};

#
Expand Down Expand Up @@ -94,27 +94,7 @@ let
# We pull out some packages from easyPS that are a pain to get otherwise.
# In particular, we used to build purty ourselves, but now its build is a nightmare.
# This does mean we can't as easily control the version we get, though.
inherit (easyPS) purty purs psc-package spago;

# There is a spago2nix in easyPS, but it doesn't (currently) work. It doesn't
# matter because it's actually just a thin call to spago2nix's nix build
# script. So we can just go directly to the source and get the latest
# version.
#
# It's worth periodically checking to see if the easyPS version is working
# again. To check:
#
# * Replace this call with `inherit (easyPS) spago2nix;`.
# * Run `nix-shell --run 'cd plutus-playground-client ; update-client-deps'
#
# If that fails, it's not ready. Rollback.
# If it succeeds:
#
# * Merge your new `inherit (easyPS) spago2nix` with the one above.
# * Remove spago2nix from flake.nix
# * Run `nix --experimental-features 'nix-command flakes' flake lock`
#
spago2nix = pkgs.callPackage (sources.spago2nix) { };
inherit (easyPS) purty purs spago purescript-language-server psa spago2nix;

# sphinx haddock support
sphinxcontrib-haddock = pkgs.callPackage (sources.sphinxcontrib-haddock) { pythonPackages = pkgs.python3Packages; };
Expand Down Expand Up @@ -155,7 +135,7 @@ in
inherit sphinx-markdown-tables sphinxemoji sphinxcontrib-haddock;
inherit nix-pre-commit-hooks;
inherit haskell cabal-install cardano-repo-tool stylish-haskell hlint haskell-language-server haskell-language-server-wrapper hie-bios cardano-cli cardano-node;
inherit purty purty-pre-commit purs spago spago2nix;
inherit purty purty-pre-commit purs spago spago2nix purescript-language-server psa;
inherit fixPurty fixStylishHaskell fixPngOptimization updateMaterialized updateClientDeps;
inherit web-ghc;
inherit easyPS plutus-haddock-combined;
Expand Down
1 change: 0 additions & 1 deletion nix/pkgs/fix-purty/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ writeShellScriptBin "fix-purty" ''
# ignore the exit code, which is usually unhelpful.
${fd}/bin/fd \
--extension purs \
--exclude '*/.psc-package/*' \
--exclude '*/.spago/*' \
--exclude '*/node_modules/*' \
--exclude '*/generated/*' \
Expand Down
4 changes: 2 additions & 2 deletions nix/pkgs/haskell/haskell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ let
inherit checkMaterialization;
sha256map = {
"https://github.com/Quid2/flat.git"."ee59880f47ab835dbd73bea0847dab7869fc20d8" = "1lrzknw765pz2j97nvv9ip3l1mcpf2zr4n56hwlz0rk7wq7ls4cm";
"https://github.com/input-output-hk/purescript-bridge.git"."6a92d7853ea514be8b70bab5e72077bf5a510596" = "13j64vv116in3c204qsl1v0ajphac9fqvsjp7x3zzfr7n7g61drb";
"https://github.com/input-output-hk/servant-purescript.git"."a0c7c7e37c95564061247461aef4be505a853538" = "177na04jf6wf18kandzsah40lw3xswmmccpr3hkb8wb4hypcffnf";
"https://github.com/input-output-hk/purescript-bridge.git"."366fc70b341e2633f3ad0158a577d52e1cd2b138" = "18j0rysfccbmfpbw2d1rsjkpd5h84alpsn6b5rwzdxw9h5vqi9m5";
"https://github.com/input-output-hk/servant-purescript.git"."ebea59c7bdfc0338d83fca772b9a57e28560bcde" = "0gjcq4y61kwb4w70pnswn5dp23wd13dac8d9hz84j374cm1kshsn";
"https://github.com/input-output-hk/cardano-base"."4ea7e2d927c9a7f78ddc69738409a5827ab66b98" = "0n0hxbr0l95cdc25jmmgs7apmmw17i91chhj5rzzv1k7f3iymf6d";
"https://github.com/input-output-hk/cardano-crypto.git"."07397f0e50da97eaa0575d93bee7ac4b2b2576ec" = "06sdx5ndn2g722jhpicmg96vsrys89fl81k8290b3lr6b1b0w4m3";
"https://github.com/input-output-hk/cardano-ledger-specs"."bf008ce028751cae9fb0b53c3bef20f07c06e333" = "0my3801w1vinc0kf5yh9lxl6saqxgwm6ccg0vvzi104pafcwwcqx";
Expand Down

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

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

4 changes: 0 additions & 4 deletions nix/pkgs/haskell/materialized-darwin/default.nix

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

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

Loading

0 comments on commit 4e79fa9

Please sign in to comment.