|
1 | 1 | help: ## Print documentation |
2 | | - @{ grep -hE '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST); echo -e '$(EXTRA_HELP)'; } | sed 's/^ //' | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-33s\033[0m %s\n", $$1, $$2}' |
| 2 | + @grep -hE '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sed 's/^ //' | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-33s\033[0m %s\n", $$1, $$2}' |
3 | 3 |
|
4 | | -include lib.mk |
5 | 4 | include nix.mk |
6 | 5 |
|
7 | 6 | PROJECT_NAME = cardano-node |
8 | 7 | NUM_PROC = $(nproc --all) |
9 | 8 |
|
10 | | -PROFILE ?= default |
11 | | -## One of: shelley allegra mary alonzo babbage conway dijkstra |
12 | | -ERA ?= conway |
13 | | -BACKEND ?= supervisor |
14 | | -REV ?= master |
15 | | -ITER ?= |
16 | | -BATCH ?= |
17 | | -ARGS ?= |
18 | | -CMD ?= |
19 | | -RUN ?= |
20 | | - |
21 | 9 | lint hlint: ## Run the CI version of hlint |
22 | 10 | nix build --no-link '.#checks/hlint' --cores 0 |
23 | 11 | haddock-hoogle haddocks hoogle: |
@@ -50,66 +38,46 @@ trace-schemas-validate: ## Validate trace message schemas against meta.schema.js |
50 | 38 | nix run .#validate-trace-schemas |
51 | 39 |
|
52 | 40 | ### |
53 | | -### Workbench |
| 41 | +### Workbench: cluster shells |
54 | 42 | ### |
| 43 | +## `make shell` (and -nix/-prof/-dev) opens a workbench dev shell for $(PROFILE) -- the usual |
| 44 | +## entry point (below). `make <profile>[-VARIANT]` are per-profile aliases; `make ps` lists |
| 45 | +## profile names. Targets, flags and the (generated) profile lists all live in |
| 46 | +## nix/workbench/lib.mk (which pulls in profiles.mk itself). |
| 47 | +include nix/workbench/lib.mk |
| 48 | + |
| 49 | +## Dev shells -- the usual entry point; each runs $(WB_ENTER) (defined in nix/workbench/lib.mk). |
| 50 | +shell: ## workbench dev shell for PROFILE (cabal build-on-demand); vars: PROFILE ERA BACKEND CMD RUN |
| 51 | + $(WB_ENTER) |
| 52 | +shell-nix: ## like shell, but run the Nix-store binary |
| 53 | + $(WB_ENTER) --arg useCabalRun false |
| 54 | +shell-prof: ## like shell, profiled build, run with -hT |
| 55 | + $(WB_ENTER) --arg profiledBuild true --arg profilingType '"space-heap"' |
| 56 | +shell-dev: |
| 57 | + $(WB_ENTER) |
| 58 | +.PHONY: shell shell-nix shell-prof shell-dev |
| 59 | + |
| 60 | +## CI entrypoints (drive the generated variant targets + Nix ci-test): |
55 | 61 | workbench-ci: workbench-ci-test ci-test-auto ci-test-autonix |
56 | 62 | CI_TARGETS := hlint workbench-ci haddock-hoogle |
57 | 63 | ci: ci-report ci-targets |
58 | 64 | ci-report: |
59 | 65 | @echo -e "\033[34mGoals under test\033[0m: \033[33m$(CI_TARGETS)\033[0m" |
60 | 66 | ci-targets: $(CI_TARGETS) |
61 | 67 |
|
62 | | -workbench-internals-walkthrough: |
63 | | - emn nix/workbench/doc.org |
64 | | - |
65 | | -## |
66 | | -## Base targets: |
67 | | -## |
68 | | -shell: ## Nix shell, (workbench from /nix/store), vars: PROFILE, ERA, CMD, RUN |
69 | | - nix-shell -A 'workbench-shell' --max-jobs 8 --cores 0 --show-trace --argstr profileName ${PROFILE} --argstr eraName ${ERA} --argstr backendName ${BACKEND} ${ARGS} ${if ${CMD},--command "${CMD}"} ${if ${RUN},--run "${RUN}"} |
70 | | -shell-dev shell-prof shell-nix: shell |
71 | | -shell-nix: ARGS += --arg 'useCabalRun' false ## Nix shell, (workbench from Nix store), vars: PROFILE, CMD, RUN |
72 | | -shell-prof: ARGS += --arg 'profiledBuild' true --arg 'profilingType' '"space-heap"' ## Nix shell, everything Haskell built profiled and run with `-hT`. |
73 | | - |
74 | | -analyse: RUN := wb analyse std ${TAG} |
75 | | -analyse: shell |
76 | | - |
77 | | -list-profiles: ## List workbench profiles |
78 | | - nix build .#all-profiles-json && cat result |
79 | | -show-profile: ## NAME=profile-name |
80 | | - @test -n "${NAME}" || { echo 'HELP: to specify profile to show, add NAME=profle-name' && exit 1; } |
81 | | - nix build .#all-profiles-json --json --option substitute false | jq '.[0].outputs.out' -r | xargs jq ".\"${NAME}\" | if . == null then error(\"\n###\n### Error: unknown profile: ${NAME} Please consult: make list-profiles\n###\") else . end" |
82 | | -ps: ## Plain-text list of profiles |
83 | | - @nix build .#workbench.profile-names-json --json | jq '.[0].outputs.out' -r | xargs jq '.[]' --raw-output |
84 | | - |
85 | | -## |
86 | | -## Profile-based cluster shells (autogenerated targets) |
87 | | -## |
88 | | -## wb_profiles.mk is autogenerated by `cardano-profile lib-make`. It contains all known profile families and flavours (minus the era, backend and shell type suffixes). |
89 | | -## After adding or removing profile definitions in `cardano-profile`, you'll probably want to also commit a regenerated version of that file. |
90 | | -## |
91 | | -include wb_profiles.mk |
92 | | - |
93 | | -$(eval $(call define_profile_targets, $(LOCAL_PROFILES))) |
94 | | -$(eval $(call define_profile_targets_nomadcloud,$(CLOUD_PROFILES))) |
95 | | - |
96 | | -# Dynamic local/supervisor profile targets. |
97 | | -playground-%: |
98 | | - nix-shell -A 'workbench-shell' --max-jobs 8 --cores 0 --show-trace --argstr profileName $* --argstr eraName ${ERA} --argstr backendName supervisor |
99 | | - |
100 | 68 | ### |
101 | 69 | ### Misc |
102 | 70 | ### |
103 | | -clean-profile proclean: |
104 | | - rm -f *.html *.prof *.hp *.stats *.eventlog |
105 | | - |
106 | 71 | clean: clean-profile |
107 | | - rm -rf logs/ socket/ cluster.* |
108 | 72 |
|
109 | 73 | full-clean: clean |
110 | 74 | rm -rf db dist-newstyle $(shell find . -name '*~' -or -name '*.swp') |
111 | 75 |
|
112 | 76 | cls: |
113 | 77 | echo -en "\ec" |
114 | 78 |
|
115 | | -.PHONY: cabal-hashes clean cli cls cluster-profiles help node run-test shell shell-dev stylish-haskell $(LOCAL_PROFILES) workbench-ci-test |
| 79 | +.PHONY: help lint hlint host-hlint haddock-hoogle stylish-haskell cabal-hashes cli node \ |
| 80 | + trace-documentation trace-schemas-regenerate trace-schemas-overrides-check \ |
| 81 | + trace-schemas-overrides-coverage trace-schemas-validate \ |
| 82 | + workbench-ci ci ci-report ci-targets \ |
| 83 | + clean full-clean cls |
0 commit comments