Skip to content

Commit 47dcd3f

Browse files
author
GHC GitLab CI
committed
fix: Test suite fixes
- Fix tests: T10279, T16180, T20494, T20604, T21097b - Update test infrastructure - Fix ghc_ prefix stripping - Improve test handling
1 parent 6545059 commit 47dcd3f

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

.envrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Check if nix-direnv is already loaded; if not, source it
22
if ! has nix_direnv_reload; then
3-
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.0/direnvrc" "sha256-+IuxtJIDzJIlHDAxyzr7M2S3FD +zSd/BNfZe+ntXje0="
3+
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.7/direnvrc" "sha256-bn8WANE5a91RusFmRI7kS751ApelG02nMcwRekC/qzc="
44
fi
55

66
# Use the specified flake to enter the Nix development environment

Makefile

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ GHC1 = _build/stage1/bin/ghc
3939
GHC2 = _build/stage2/bin/ghc
4040

4141
define GHC_INFO
42-
$(shell sh -c "$(GHC0) --info | $(GHC0) -e 'getContents >>= foldMap putStrLn . lookup \"$1\" . read'")
42+
$(shell $(GHC0) --info | grep -oP '"$1",\s*"\K[^"]+')
4343
endef
4444

4545
TARGET_PLATFORM := $(call GHC_INFO,target platform string)
@@ -179,12 +179,17 @@ STAGE2_UTIL_EXECUTABLES := \
179179
# export CABAL := $(shell cabal update 2>&1 >/dev/null && cabal build cabal-install -v0 --disable-tests --project-dir libraries/Cabal && cabal list-bin -v0 --project-dir libraries/Cabal cabal-install:exe:cabal)
180180
$(abspath _build/stage0/bin/cabal): _build/stage0/bin/cabal
181181

182-
.PHONY: _build/stage0/bin/cabal
182+
# --- Stage 0 build ---
183+
184+
# This just builds cabal-install, which is used to build the rest of the project.
185+
186+
# We need an absolute path here otherwise cabal will consider the path relative to `the project directory
187+
_build/stage0/bin/cabal: BUILD_ARGS=-j -w $(GHC0) --disable-tests --project-dir libraries/Cabal --builddir=$(abspath _build/stage0)
183188
_build/stage0/bin/cabal:
184189
@echo ">>> Building Cabal..."
185190
@mkdir -p _build/stage0/bin _build/logs
186-
$(call run_and_log, cabal build -j -w $(GHC0) --disable-tests --project-dir libraries/Cabal --builddir=_build/stage0/cabal cabal-install:exe:cabal)
187-
cp -rfp $(shell cabal list-bin -v0 -j -w $(GHC0) --project-dir libraries/Cabal --builddir=_build/stage0/cabal cabal-install:exe:cabal) _build/stage0/bin/cabal
191+
cabal build $(BUILD_ARGS) cabal-install:exe:cabal
192+
cp -rfp $(shell cabal list-bin -v0 $(BUILD_ARGS) cabal-install:exe:cabal) _build/stage0/bin/cabal
188193
@echo ">>> Cabal built successfully."
189194

190195
# --- Stage 1 build ---
@@ -195,7 +200,7 @@ _build/stage1/%: private GHC=$(GHC0)
195200
.PHONY: $(addprefix _build/stage1/bin/,$(STAGE1_EXECUTABLES))
196201
$(addprefix _build/stage1/bin/,$(STAGE1_EXECUTABLES)) &: $(CABAL) | _build/booted
197202
# Force cabal to replan
198-
rm -rf _build/stage2/cache
203+
rm -rf _build/stage1/cache
199204
$(call run_and_log, HADRIAN_SETTINGS='$(HADRIAN_SETTINGS)' \
200205
$(CABAL_BUILD) $(STAGE1_TARGETS))
201206

@@ -357,4 +362,4 @@ test: _build/bindist
357362
make -C testsuite/tests test THREADS=${THREADS}
358363

359364
# Inform Make that these are not actual files if they get deleted by other means
360-
.PHONY: clean distclean test all configure
365+
.PHONY: clean distclean test all

0 commit comments

Comments
 (0)