Skip to content

Commit

Permalink
;stack: simplify stack file names
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichael committed Jan 27, 2020
1 parent ce7929b commit b9763b9
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 14 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Expand Up @@ -1378,9 +1378,9 @@ This can take a while! To save time, you can build individual packages, eg just
Note stack does not fetch C libraries such as curses or terminfo, which you might need to install yourself, using your system's package manager. Note stack does not fetch C libraries such as curses or terminfo, which you might need to install yourself, using your system's package manager.
In case of trouble, see [download](/download.html#link-errors). In case of trouble, see [download](/download.html#link-errors).
If you want to use an older snapshot/GHC for some reason, specify one of the older stack-ghc*.yaml files: If you want to use an older snapshot/GHC for some reason, specify one of the older stack-*.yaml files:
stack --stack-yaml stack-ghc8.2.yaml build stack --stack-yaml stack-8.2.yaml build
### Run in place ### Run in place
Expand Down
14 changes: 4 additions & 10 deletions Makefile
Expand Up @@ -391,7 +391,7 @@ buildplantest: $(call def-help,buildplantest, stack build --dry-run all hledger
buildplantest-all: $(call def-help,buildplantest-all, stack build --dry-run all hledger packages ensuring an install plan with each ghc version/stackage snapshot ) buildplantest-all: $(call def-help,buildplantest-all, stack build --dry-run all hledger packages ensuring an install plan with each ghc version/stackage snapshot )
for F in stack-*.yaml stack.yaml; do make --no-print-directory buildplantest-$$F; done for F in stack-*.yaml stack.yaml; do make --no-print-directory buildplantest-$$F; done


buildplantest-%: $(call def-help,buildplantest-STACKFILE, stack build --dry-run all hledger packages ensuring an install plan with the given stack yaml file; eg make buildplantest-stack-ghc8.2.yaml ) buildplantest-%: $(call def-help,buildplantest-STACKFILE, stack build --dry-run all hledger packages ensuring an install plan with the given stack yaml file; eg make buildplantest-stack-8.2.yaml )
$(STACK) build --dry-run --test --bench --stack-yaml=$* $(STACK) build --dry-run --test --bench --stack-yaml=$*


buildtest: $(call def-help,buildtest, force-rebuild all hledger packages/modules quickly ensuring no warnings with default snapshot) \ buildtest: $(call def-help,buildtest, force-rebuild all hledger packages/modules quickly ensuring no warnings with default snapshot) \
Expand All @@ -400,7 +400,7 @@ buildtest: $(call def-help,buildtest, force-rebuild all hledger packages/modules
buildtest-all: $(call def-help,buildtest-all, force-rebuild all hledger packages/modules quickly ensuring no warnings with each ghc version/stackage snapshot ) buildtest-all: $(call def-help,buildtest-all, force-rebuild all hledger packages/modules quickly ensuring no warnings with each ghc version/stackage snapshot )
for F in stack-*.yaml stack.yaml; do make --no-print-directory buildtest-$$F; done for F in stack-*.yaml stack.yaml; do make --no-print-directory buildtest-$$F; done


buildtest-%: $(call def-help,buildtest-STACKFILE, force-rebuild all hledger packages/modules quickly ensuring no warnings with the given stack yaml file; eg make buildtest-stack-ghc8.2.yaml ) buildtest-%: $(call def-help,buildtest-STACKFILE, force-rebuild all hledger packages/modules quickly ensuring no warnings with the given stack yaml file; eg make buildtest-stack-8.2.yaml )
$(STACK) build --test --bench $(SKIPTESTSBENCHS) --fast --force-dirty --ghc-options=-fforce-recomp --ghc-options=-Werror --stack-yaml=$* $(STACK) build --test --bench $(SKIPTESTSBENCHS) --fast --force-dirty --ghc-options=-fforce-recomp --ghc-options=-Werror --stack-yaml=$*


incr-buildtest: $(call def-help,incr-buildtest, build any outdated hledger packages/modules quickly ensuring no warnings with default snapshot. Wont detect warnings in up-to-date modules.) \ incr-buildtest: $(call def-help,incr-buildtest, build any outdated hledger packages/modules quickly ensuring no warnings with default snapshot. Wont detect warnings in up-to-date modules.) \
Expand All @@ -409,15 +409,15 @@ incr-buildtest: $(call def-help,incr-buildtest, build any outdated hledger packa
incr-buildtest-all: $(call def-help,incr-buildtest-all, build any outdated hledger packages/modules quickly ensuring no warnings with each ghc version/stackage snapshot. Wont detect warnings in up-to-date modules. ) incr-buildtest-all: $(call def-help,incr-buildtest-all, build any outdated hledger packages/modules quickly ensuring no warnings with each ghc version/stackage snapshot. Wont detect warnings in up-to-date modules. )
for F in stack-*.yaml stack.yaml; do make --no-print-directory incr-buildtest-$$F; done for F in stack-*.yaml stack.yaml; do make --no-print-directory incr-buildtest-$$F; done


incr-buildtest-%: $(call def-help,incr-buildtest-STACKFILE, build any outdated hledger packages/modules quickly ensuring no warnings with the stack yaml file; eg make buildtest-stack-ghc8.2.yaml. Wont detect warnings in up-to-date modules. ) incr-buildtest-%: $(call def-help,incr-buildtest-STACKFILE, build any outdated hledger packages/modules quickly ensuring no warnings with the stack yaml file; eg make buildtest-stack-8.2.yaml. Wont detect warnings in up-to-date modules. )
$(STACK) build --test --bench $(SKIPTESTSBENCHS) --fast --ghc-options=-Werror --stack-yaml=$* $(STACK) build --test --bench $(SKIPTESTSBENCHS) --fast --ghc-options=-Werror --stack-yaml=$*


pkgtest: $(call def-help,pkgtest, run the test suites in each package ) pkgtest: $(call def-help,pkgtest, run the test suites in each package )
@($(STACKTEST) && echo $@ PASSED) || (echo $@ FAILED; false) @($(STACKTEST) && echo $@ PASSED) || (echo $@ FAILED; false)


# doctest with ghc 8.4 on mac requires a workaround, see hledger-lib/package.yaml. # doctest with ghc 8.4 on mac requires a workaround, see hledger-lib/package.yaml.
# Or, could run it with ghc 8.2: # Or, could run it with ghc 8.2:
# @($(STACKTEST) --stack-yaml stack-ghc8.2.yaml hledger-lib:test:doctest && echo $@ PASSED) || (echo $@ FAILED; false) # @($(STACKTEST) --stack-yaml stack-8.2.yaml hledger-lib:test:doctest && echo $@ PASSED) || (echo $@ FAILED; false)
doctest: $(call def-help,doctest, run the doctests in hledger-lib module/function docs ) doctest: $(call def-help,doctest, run the doctests in hledger-lib module/function docs )
@($(STACKTEST) hledger-lib:test:doctest && echo $@ PASSED) || (echo $@ FAILED; false) @($(STACKTEST) hledger-lib:test:doctest && echo $@ PASSED) || (echo $@ FAILED; false)


Expand Down Expand Up @@ -465,12 +465,6 @@ haddocktest: $(call def-help,haddocktest, run haddock to make sure it can genera
cabalfiletest: $(call def-help,cabalfiletest, run cabal check to test cabal file syntax ) cabalfiletest: $(call def-help,cabalfiletest, run cabal check to test cabal file syntax )
@(make --no-print-directory cabalcheck && echo $@ PASSED) || (echo $@ FAILED; false) @(make --no-print-directory cabalcheck && echo $@ PASSED) || (echo $@ FAILED; false)


allghcstest: $(call def-help,allghcstest, build/test/benchmark with all supported GHC versions/stackage snapshots and warning-free) \
test-stack-ghc7.10.yaml \
test-stack-ghc8.0.yaml \
test-stack-ghc8.2.yaml \
test-stack.yaml \

test-stack%yaml: test-stack%yaml:
$(STACK) --stack-yaml stack$*yaml clean $(STACK) --stack-yaml stack$*yaml clean
$(STACK) --stack-yaml stack$*yaml build --ghc-options="$(WARNINGS) -Werror" --test --bench --haddock --no-haddock-deps $(STACK) --stack-yaml stack$*yaml build --ghc-options="$(WARNINGS) -Werror" --test --bench --haddock --no-haddock-deps
Expand Down
4 changes: 2 additions & 2 deletions Shake.hs
@@ -1,7 +1,7 @@
#!/usr/bin/env stack #!/usr/bin/env stack
{- stack exec {- stack exec
--verbosity=info --verbosity=info
--stack-yaml=stack-ghc8.6.yaml --stack-yaml=stack-8.6.yaml
--package base-prelude --package base-prelude
--package directory --package directory
--package extra --package extra
Expand All @@ -12,7 +12,7 @@
ghc ghc
-} -}
-- Normally uses the project's default resolver & extra deps (stack.yaml). -- Normally uses the project's default resolver & extra deps (stack.yaml).
-- Currently using stack-ghc8.6.yaml (& building two sets of deps) because of -- Currently using stack-8.6.yaml (& building two sets of deps) because of
-- https://github.com/iconnect/regex/issues/173#issuecomment-570836346 -- https://github.com/iconnect/regex/issues/173#issuecomment-570836346
{- {-
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit b9763b9

Please sign in to comment.