git.iko.soy/rowtype-yoga/purescm
on bytevector help sign in
Switch to the new spago (#94)
113cb0cFabrizio Ferrai
.github/workflows/ci.yml+7−17
@@ -10,21 +10,8 @@ jobs:
10 build:
10 build:
11 runs-on: ubuntu-latest
11 runs-on: ubuntu-latest
12 steps:
12 steps:
13− - name: Install Chez Scheme
14− run: |
15− sudo apt-get update
16− sudo apt-get install -y chezscheme
17− scheme --version
18−
19 - uses: actions/checkout@v2
13 - uses: actions/checkout@v2
20
14
21− - uses: purescript-contrib/setup-purescript@main
22− with:
23− purescript: "0.15.8"
24− purs-tidy: "0.9.2"
25− psa: "0.8.2"
26− spago: "0.20.9"
27−
28 - name: Cache PureScript dependencies
15 - name: Cache PureScript dependencies
29 uses: actions/cache@v2
16 uses: actions/cache@v2
30 with:
17 with:
@@ -38,14 +25,17 @@ jobs:
38 with:
25 with:
39 node-version: "16"
26 node-version: "16"
40
27
28+ - name: Install Nix
29+ uses: cachix/install-nix-action@v16
30+
41 - name: Build the project
31 - name: Build the project
42 run: |
32 run: |
43− spago build --purs-args "--censor-lib --strict"
33+ nix-shell --command "spago build"
44
34
45− - name: Run tests
35+ - name: Run tests
46 run: |
36 run: |
47− spago -x test.dhall test
37+ nix-shell --command "spago test"
48
38
49 - name: Check Formatting
39 - name: Check Formatting
50 run: |
40 run: |
51− purs-tidy check src test
41+ nix-shell --command "purs-tidy check src test"
.gitignore+2−2
@@ -17,7 +17,7 @@
17/examples/**/out
17/examples/**/out
18/test-snapshots/.spago
18/test-snapshots/.spago
19/test-snapshots/output
19/test-snapshots/output
20−/test-snapshots/.purs*
20+/test-snapshots/**/.purs*
21−/test-snapshots/.psc*
21+/test-snapshots/**/.psc*
22/test-snapshots/generated-docs
22/test-snapshots/generated-docs
23/test-snapshots/test-out/
23/test-snapshots/test-out/
shell.nix+13−7
@@ -1,11 +1,18 @@
1−{ pkgs ? import <nixpkgs> { } }:
2let
1let
2+ nixpkgs = builtins.fetchTarball {
3+ url = "https://github.com/NixOS/nixpkgs/archive/402cc3633cc60dfc50378197305c984518b30773.tar.gz";
4+ sha256 = "0yvlprdkqg1kizg83j7nivlc58zk7llrbf82jqvgjimrwhsva1m9";
5+ };
6+
7+ pkgs = import nixpkgs {};
8+
3 easy-ps = import
9 easy-ps = import
10+ # On f-f's fork of easy-purescript-nix, as spago-next is not in mainline yet
4 (pkgs.fetchFromGitHub {
11 (pkgs.fetchFromGitHub {
5− owner = "justinwoo";
12+ owner = "f-f";
6 repo = "easy-purescript-nix";
13 repo = "easy-purescript-nix";
7− rev = "0c10ff170461aed0c336f5c21ed0f430c2c3574b";
14+ rev = "b02cff3db1671fc8fb76a680597a216a9c9b2d03";
8− sha256 = "sha256-LLqaLPJNiap2U8I77K5XVPGJA/Be30Z8lyGOyYXmBlc=";
15+ sha256 = "sha256-vfzrVwBntXao3nMi2hkjYlWGUnuyUOVmYi95mQQ0EEY=";
9 }) {
16 }) {
10 inherit pkgs;
17 inherit pkgs;
11 };
18 };
@@ -13,11 +20,10 @@ in
13pkgs.mkShell {
20pkgs.mkShell {
14 buildInputs = [
21 buildInputs = [
15 easy-ps.purs-0_15_8
22 easy-ps.purs-0_15_8
16− easy-ps.psc-package
17 easy-ps.purs-tidy
23 easy-ps.purs-tidy
18 easy-ps.psa
24 easy-ps.psa
19− easy-ps.spago
25+ easy-ps.spago-next
20 pkgs.nodejs-slim-16_x
26 pkgs.nodejs-slim-16_x
21− pkgs.chez
27+ pkgs.chez-racket
22 ];
28 ];
23}
29}
spago.dhalldeleted−28
@@ -1,28 +0,0 @@
1−{ name = "purs-backend-chez"
2−, dependencies =
3− [ "aff"
4− , "argonaut"
5− , "arrays"
6− , "backend-optimizer"
7− , "bifunctors"
8− , "console"
9− , "control"
10− , "debug"
11− , "dodo-printer"
12− , "effect"
13− , "either"
14− , "foldable-traversable"
15− , "maybe"
16− , "newtype"
17− , "ordered-collections"
18− , "partial"
19− , "prelude"
20− , "profunctor"
21− , "safe-coerce"
22− , "strings"
23− , "transformers"
24− , "tuples"
25− ]
26−, packages = ./packages.dhall
27−, sources = [ "src/**/*.purs" ]
28−}
spago.yamlnew file+108
@@ -0,0 +1,108 @@
1+package:
2+ name: purescm
3+ dependencies:
4+ - aff
5+ - argonaut
6+ - arrays
7+ - backend-optimizer
8+ - console
9+ - control
10+ - dodo-printer
11+ - effect
12+ - foldable-traversable
13+ - maybe
14+ - newtype
15+ - ordered-collections
16+ - prelude
17+ - safe-coerce
18+ - strings
19+ - transformers
20+ - tuples
21+ test:
22+ main: Test.Main
23+ dependencies:
24+ - ansi
25+ - argparse-basic
26+ - bifunctors
27+ - either
28+ - filterable
29+ - language-cst-parser
30+ - lazy
31+ - lists
32+ - node-buffer
33+ - node-child-process
34+ - node-execa
35+ - node-fs
36+ - node-fs-aff
37+ - node-glob-basic
38+ - node-path
39+ - node-process
40+ - node-streams
41+ - parallel
42+ - partial
43+ - posix-types
44+ - refs
45+workspace:
46+ package_set:
47+ registry: 19.1.0
48+ extra_packages:
49+ backend-optimizer:
50+ git: https://github.com/aristanetworks/purescript-backend-optimizer
51+ ref: purs-backend-es-v1.3.2
52+ dependencies:
53+ - aff
54+ - ansi
55+ - argonaut
56+ - argonaut-codecs
57+ - argparse-basic
58+ - arrays
59+ - bifunctors
60+ - console
61+ - control
62+ - debug
63+ - dodo-printer
64+ - effect
65+ - either
66+ - enums
67+ - filterable
68+ - foldable-traversable
69+ - foreign-object
70+ - integers
71+ - language-cst-parser
72+ - lazy
73+ - lists
74+ - maybe
75+ - newtype
76+ - node-buffer
77+ - node-child-process
78+ - node-fs
79+ - node-fs-aff
80+ - node-glob-basic
81+ - node-path
82+ - node-process
83+ - node-streams
84+ - ordered-collections
85+ - parallel
86+ - partial
87+ - posix-types
88+ - prelude
89+ - refs
90+ - safe-coerce
91+ - strings
92+ - transformers
93+ - tuples
94+ - unsafe-coerce
95+ node-glob-basic:
96+ git: https://github.com/natefaubion/purescript-node-glob-basic.git
97+ ref: v1.2.2
98+ dependencies:
99+ - aff
100+ - console
101+ - effect
102+ - lists
103+ - maybe
104+ - node-fs-aff
105+ - node-path
106+ - node-process
107+ - ordered-collections
108+ - strings
test-snapshots/packages.dhalldeleted−15
@@ -1,15 +0,0 @@
1−let upstream =
2− https://github.com/purescript/package-sets/releases/download/psc-0.15.7-20230320/packages.dhall
3− sha256:6f2a4b50b793f304d3a64fd25d631de990de280981c73b0683a090e4fa499f0d
4−
5−in upstream
6− with prelude =
7− { dependencies = [] : List Text
8− , repo = "https://github.com/purescm/purescript-prelude.git"
9− , version = "63ff5a24beba191c8fda919a58489f36bde2d506"
10− }
11− with partial =
12− { dependencies = [] : List Text
13− , repo = "https://github.com/purescm/purescript-partial.git"
14− , version = "d8b6daf068e4aab0ad85a42d0f890ed37f416923"
15− }
test-snapshots/spago.dhalldeleted−5
@@ -1,5 +0,0 @@
1−{ name = "snapshots"
2−, dependencies = [ "partial", "prelude" ]
3−, packages = ./packages.dhall
4−, sources = [ "snapshots-input/**/*.purs" ]
5−}
test-snapshots/spago.yamlnew file+17
@@ -0,0 +1,17 @@
1+package:
2+ name: purescm-snapshots
3+ dependencies:
4+ - partial
5+ - prelude
6+workspace:
7+ package_set:
8+ registry: 19.1.0
9+ extra_packages:
10+ prelude:
11+ git: https://github.com/purescm/purescript-prelude.git
12+ ref: 63ff5a24beba191c8fda919a58489f36bde2d506
13+ dependencies: []
14+ partial:
15+ git: https://github.com/purescm/purescript-partial.git
16+ ref: d8b6daf068e4aab0ad85a42d0f890ed37f416923
17+ dependencies: []
test-snapshots/snapshots-input/Snapshot.Branch.purs → test-snapshots/src/snapshots-input/Snapshot.Branch.pursrenamed

The content is the same.

test-snapshots/snapshots-input/Snapshot.Comparison.purs → test-snapshots/src/snapshots-input/Snapshot.Comparison.pursrenamed

The content is the same.

test-snapshots/snapshots-input/Snapshot.Function.purs → test-snapshots/src/snapshots-input/Snapshot.Function.pursrenamed

The content is the same.

test-snapshots/snapshots-input/Snapshot.Import.Impl.purs → test-snapshots/src/snapshots-input/Snapshot.Import.Impl.pursrenamed

The content is the same.

test-snapshots/snapshots-input/Snapshot.Import.Impl.ss → test-snapshots/src/snapshots-input/Snapshot.Import.Impl.ssrenamed

The content is the same.

test-snapshots/snapshots-input/Snapshot.Import.purs → test-snapshots/src/snapshots-input/Snapshot.Import.pursrenamed

The content is the same.

test-snapshots/snapshots-input/Snapshot.Literals.purs → test-snapshots/src/snapshots-input/Snapshot.Literals.pursrenamed

The content is the same.

test-snapshots/snapshots-output/Snapshot.Branch.ss → test-snapshots/src/snapshots-output/Snapshot.Branch.ssrenamed

The content is the same.

test-snapshots/snapshots-output/Snapshot.Comparison.ss → test-snapshots/src/snapshots-output/Snapshot.Comparison.ssrenamed

The content is the same.

test-snapshots/snapshots-output/Snapshot.Function.ss → test-snapshots/src/snapshots-output/Snapshot.Function.ssrenamed

The content is the same.

test-snapshots/snapshots-output/Snapshot.Import.Impl.ss → test-snapshots/src/snapshots-output/Snapshot.Import.Impl.ssrenamed

The content is the same.

test-snapshots/snapshots-output/Snapshot.Import.ss → test-snapshots/src/snapshots-output/Snapshot.Import.ssrenamed

The content is the same.

test-snapshots/snapshots-output/Snapshot.Literals.ss → test-snapshots/src/snapshots-output/Snapshot.Literals.ssrenamed

The content is the same.

test.dhalldeleted−46
@@ -1,46 +0,0 @@
1−{ name = "purs-backend-chez-tests"
2−, dependencies =
3− [ "aff"
4− , "ansi"
5− , "argonaut"
6− , "argparse-basic"
7− , "arrays"
8− , "backend-optimizer"
9− , "bifunctors"
10− , "console"
11− , "control"
12− , "debug"
13− , "dodo-printer"
14− , "effect"
15− , "either"
16− , "filterable"
17− , "foldable-traversable"
18− , "language-cst-parser"
19− , "lazy"
20− , "lists"
21− , "maybe"
22− , "newtype"
23− , "node-buffer"
24− , "node-child-process"
25− , "node-execa"
26− , "node-fs"
27− , "node-fs-aff"
28− , "node-glob-basic"
29− , "node-path"
30− , "node-process"
31− , "node-streams"
32− , "ordered-collections"
33− , "parallel"
34− , "partial"
35− , "posix-types"
36− , "prelude"
37− , "profunctor"
38− , "refs"
39− , "safe-coerce"
40− , "strings"
41− , "transformers"
42− , "tuples"
43− ]
44−, packages = ./packages.dhall
45−, sources = [ "src/**/*.purs", "test/**/*.purs" ]
46−}
test/Main.purs+3−3
@@ -84,13 +84,13 @@ main = do
84runSnapshotTests :: TestArgs -> Aff Unit
84runSnapshotTests :: TestArgs -> Aff Unit
85runSnapshotTests { accept, filter } = do
85runSnapshotTests { accept, filter } = do
86 liftEffect $ Process.chdir $ Path.concat [ "test-snapshots" ]
86 liftEffect $ Process.chdir $ Path.concat [ "test-snapshots" ]
87− spawnFromParent "spago" [ "build", "-u", "-g corefn" ]
87+ spawnFromParent "spago" [ "build", "--purs-args", "-g corefn" ]
88 snapshotDir <- liftEffect Process.cwd
88 snapshotDir <- liftEffect Process.cwd
89− snapshotPaths <- expandGlobs (Path.concat [ snapshotDir, "snapshots-input" ])
89+ snapshotPaths <- expandGlobs (Path.concat [ snapshotDir, "src", "snapshots-input" ])
90 [ "Snapshot.*.purs" ]
90 [ "Snapshot.*.purs" ]
91 schemeBin <- getSchemeBinary
91 schemeBin <- getSchemeBinary
92 outputRef <- liftEffect $ Ref.new Map.empty
92 outputRef <- liftEffect $ Ref.new Map.empty
93− let snapshotsOut = Path.concat [ snapshotDir, "snapshots-output" ]
93+ let snapshotsOut = Path.concat [ snapshotDir, "src", "snapshots-output" ]
94 let testOut = Path.concat [ snapshotDir, "test-out" ]
94 let testOut = Path.concat [ snapshotDir, "test-out" ]
95 mkdirp snapshotsOut
95 mkdirp snapshotsOut
96 mkdirp testOut
96 mkdirp testOut