Skip to content
Merged
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
35 changes: 20 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,32 @@ else
stack install --pedantic --test --bench --no-run-benchmarks --local-bin-path=dist
endif

.PHONY: delete-cache-on-linker-errors
delete-cache-on-linker-errors:
# Clean
.PHONY: full-clean
full-clean: clean
rm -rf ~/.cache/hie-bios
ifdef CABAL_DIR
rm -rf $(CABAL_DIR)/store
else
rm -rf ~/.cabal/store
endif

.PHONY: clean
clean:
ifeq ($(WIRE_BUILD_WITH_CABAL), 1)
cabal clean
else
stack clean
endif
$(MAKE) -C services/nginz clean
-rm -rf dist
-rm -f .metadata

.PHONY: clean-hint
clean-hint:
@echo -e "\n\n\n>>> PSA: if you get errors that are hard to explain,"
@echo -e ">>> try 'make full-clean' and run your command again."
@echo -e ">>> see https://github.com/wireapp/wire-server/blob/develop/docs/developer/building.md#linker-errors-while-compiling\n\n\n"

.PHONY: cabal.project.local
cabal.project.local:
Expand All @@ -77,7 +94,7 @@ endif
# Usage: make c package=brig test=1
.PHONY: c
c: cabal-fmt
cabal build $(WIRE_CABAL_BUILD_OPTIONS) $(package)
cabal build $(WIRE_CABAL_BUILD_OPTIONS) $(package) || ( make clean-hint; false )
ifeq ($(test), 1)
./hack/bin/cabal-run-tests.sh $(package) $(testargs)
endif
Expand Down Expand Up @@ -156,18 +173,6 @@ add-license:
shellcheck:
./hack/bin/shellcheck.sh

# Clean
.PHONY: clean
clean:
ifeq ($(WIRE_BUILD_WITH_CABAL), 1)
cabal clean
else
stack clean
endif
$(MAKE) -C services/nginz clean
-rm -rf dist
-rm -f .metadata

#################################
## running integration tests

Expand Down
1 change: 1 addition & 0 deletions changelog.d/5-internal/tweak-makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve cleaning rules in Makefile.
6 changes: 3 additions & 3 deletions docs/developer/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ Linker errors can occur if the nix-provided build environment (see `nix/` direct

Haskell Language Server stores its build artifacts in `~/.cache/hie-bios` (equivalent to the `./dist-newstyle` directory) which become invalid for the same reason.

The easiest course of action is to to remove these directories via:
The easiest course of action is to to remove these directories via:

```
make delete-cache-on-linker-errors
make full-clean
```

# How to run integration tests
Expand Down Expand Up @@ -77,7 +77,7 @@ After all containers are up you can use these Makefile targets to run the tests

```
# build and run galley's integration tests
make ci package=galley
make ci package=galley

# run galley's integration tests that match a pattern
TASTY_PATTERN="/MLS/" make ci package=galley
Expand Down