Skip to content
Open
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
9 changes: 6 additions & 3 deletions .github/workflows/reusable-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -528,12 +528,15 @@ jobs:
ghc --info
cabal update
gmake clean clean-cabal distclean
gmake _build/dist/haskell-toolchain.tar.gz _build/dist/ghc.tar.gz _build/dist/cabal.tar.gz _build/dist/tests.tar.gz _build/dist/ghc-javascript-unknown-ghcjs.tar.gz
# The FreeBSD self-hosted runner has no JS toolchain (llc/opt/
# emscripten), so it cannot build the javascript-unknown-ghcjs cross
# target. Skip both the JS bindist AND haskell-toolchain.tar.gz — the
# latter depends on stage3-javascript-unknown-ghcjs (Makefile:1058).
# Ship only the native FreeBSD ghc/cabal/tests bindists.
gmake _build/dist/ghc.tar.gz _build/dist/cabal.tar.gz _build/dist/tests.tar.gz
cd _build/dist
mv ghc.tar.gz ghc-$(bin/ghc --numeric-version)-${{ env.ARTIFACT }}.tar.gz
mv cabal.tar.gz cabal-$(bin/cabal --numeric-version)-${{ env.ARTIFACT }}.tar.gz
mv haskell-toolchain.tar.gz haskell-toolchain-${{ env.ARTIFACT }}.tar.gz
mv ghc-javascript-unknown-ghcjs.tar.gz ghc-javascript-unknown-ghcjs-$(bin/ghc --numeric-version)-${{ env.ARTIFACT }}.tar.gz
mv tests.tar.gz tests-${{ env.ARTIFACT }}.tar.gz
env:
EXTRA_LIB_DIRS: /usr/local/lib
Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,12 @@ THREADS ?= $(shell echo $$(( $(CPUS) + 1 )))
# Build macros
#

ifeq ($(MAKE_HOST),x86_64-pc-msys)
# Detect a Windows host across the make flavours CI may provide: MSYS2 msys
# (x86_64-pc-msys), MSYS2 mingw/clang64 (x86_64-w64-mingw32) and Cygwin
# (x86_64-pc-cygwin). The hosted runner's `make` has switched between these
# (e.g. msys -> cygwin), so match all three rather than a single triple — a
# miss here silently drops the Windows CC/CXX/LD overrides below.
ifneq (,$(filter x86_64-pc-msys x86_64-pc-cygwin x86_64-w64-mingw32,$(MAKE_HOST)))
# Windows executables require .exe extension for native programs to find them
EXE_EXT := .exe

Expand Down Expand Up @@ -692,7 +697,7 @@ STAGE2_LIBRARIES = \
transformers \
xhtml

ifeq ($(MAKE_HOST),x86_64-pc-msys)
ifneq (,$(filter x86_64-pc-msys x86_64-pc-cygwin x86_64-w64-mingw32,$(MAKE_HOST)))
STAGE2_LIBRARIES += Win32
else
STAGE2_LIBRARIES += terminfo unix
Expand Down
20 changes: 18 additions & 2 deletions cabal.project.stage0
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
source-repository-package
type: git
location: https://github.com/stable-haskell/Cabal.git
tag: stable-haskell/master
-- Pin Cabal to the stable-haskell feature/wasm-cross-ghcup-stack tip
-- (8b8433b), NOT the bare `stable-haskell/master` branch name. Two reasons:
-- 1. The bare branch name fails cabal's shallow git resolve at stage0
-- ("Failed to resolve stable-haskell/master as a valid revision").
-- 2. The master tip lacks the Host-only `package *` handling, so
-- cabal.project.stage2.dynamic's `package * { shared: True }` would also
-- build the BUILD-stage packages shared; those then fail to link against
-- the bootstrap GHC on essentially every release platform
-- ("ld: cannot find -lHSbytestring-...-ghc9.8.4", incl. glibc deb11/Mac).
-- 8b8433b carries that fix — it is the pin stable-haskell/ghc #181 uses
-- and builds green on all platforms with DYNAMIC=1.
-- 3. aa57a49 adds, on top of 8b8433b, a fix to always include the
-- artifact's own dir ($ORIGIN/@loader_path) in emitted rpaths, so a
-- same-dir sibling (e.g. a Backpack signature impl) is found by musl's
-- loader (GHC testsuite T14304 on Alpine; glibc masked it via runtime
-- LD_LIBRARY_PATH, which musl ignores).
-- Revisit (move back to master) once the host-only handling lands there.
tag: aa57a49b187b067f060eb9f87499edefe5d05120
subdir: Cabal
Cabal-syntax
cabal-install
cabal-install-solver
hooks-exe

source-repository-package
type: git
Expand Down
12 changes: 11 additions & 1 deletion cabal.project.stage1
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ packages:
source-repository-package
type: git
location: https://github.com/stable-haskell/Cabal.git
tag: stable-haskell/master
-- Pinned to aa57a49 (feature/wasm-cross-ghcup-stack); see cabal.project.stage0.
tag: aa57a49b187b067f060eb9f87499edefe5d05120
subdir: Cabal
Cabal-syntax

Expand Down Expand Up @@ -78,6 +79,15 @@ if !os(windows)
package *
library-for-ghci: True

-- libffi-clib compiles src/java_raw_api.c as a GHC c-source. Its deprecated
-- ffi_java_raw_* calls are a hard error on Rocky Linux 8's gcc-8, failing the
-- stage1 build. GHC's RTS/FFI uses ffi_call/closures, not the (Java) raw API,
-- and java_raw_api.c is wholly `#if !FFI_NO_RAW_API`-guarded — so force-define
-- FFI_NO_RAW_API on the C compiler to compile it to nothing. (libffi's own
-- --disable-raw-api configure flag does not reach this GHC c-source compile.)
package libffi-clib
ghc-options: -optc-DFFI_NO_RAW_API=1

package ghc
flags: +bootstrap

Expand Down
7 changes: 5 additions & 2 deletions cabal.project.stage2.common
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ packages:
source-repository-package
type: git
location: https://github.com/stable-haskell/Cabal.git
tag: stable-haskell/master
-- Pinned to aa57a49 (feature/wasm-cross-ghcup-stack); see cabal.project.stage0.
tag: aa57a49b187b067f060eb9f87499edefe5d05120
subdir: Cabal
Cabal-syntax

Expand Down Expand Up @@ -147,7 +148,9 @@ constraints:
--

package libffi-clib
ghc-options: -no-rts -optc-Wno-error
-- Force-define FFI_NO_RAW_API to compile out libffi's deprecated (Java) raw
-- API (gcc-8/RockyLinux 8 errors on it; GHC doesn't use it). See stage1.
ghc-options: -no-rts -optc-Wno-error -optc-DFFI_NO_RAW_API=1

-- We end up injecting the following depednency:
--
Expand Down
3 changes: 2 additions & 1 deletion cabal.project.stage3
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ packages:
source-repository-package
type: git
location: https://github.com/stable-haskell/Cabal.git
tag: stable-haskell/master
-- Pinned to aa57a49 (feature/wasm-cross-ghcup-stack); see cabal.project.stage0.
tag: aa57a49b187b067f060eb9f87499edefe5d05120
subdir: Cabal
Cabal-syntax

Expand Down
24 changes: 5 additions & 19 deletions compiler/Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,12 @@ import qualified Data.Map as Map
import GHC.ResponseFile
import System.Environment

-- | Extract the 'Verbosity' from the configure flags.
--
-- Cabal 3.17 (commit edb808a0b8b) split the old @Verbosity@ type into
-- 'VerbosityFlags' (the CLI-passable part) and 'VerbosityHandles', so
-- 'configVerbosity' now yields a 'VerbosityFlags' which must be wrapped
-- back into a 'Verbosity' before passing it to the Cabal library functions.
configVerbosity' :: ConfigFlags -> Verbosity
#if MIN_VERSION_Cabal(3,17,0)
configVerbosity' cfg =
mkVerbosity defaultVerbosityHandles (fromFlagOrDefault silent (configVerbosity cfg))
#else
configVerbosity' cfg = fromFlagOrDefault minBound (configVerbosity cfg)
#endif

main :: IO ()
main = defaultMainWithHooks ghcHooks
where
ghcHooks = simpleUserHooks
{ postConf = \args cfg pd lbi -> do
let verbosity = configVerbosity' cfg
let verbosity = fromFlagOrDefault minBound (configVerbosity cfg)
ghcAutogen verbosity lbi
postConf simpleUserHooks args cfg pd lbi
}
Expand Down Expand Up @@ -90,10 +76,10 @@ ghcAutogen verbosity lbi@LocalBuildInfo{pkgDescrFile,withPrograms,componentNameM
let Just compilerRoot = (takeDirectory . fromSymPath) <$> pkgDescrFile

-- Require the necessary programs
(gcc ,withPrograms) <- requireProgram verbosity gccProgram withPrograms
(ghc ,withPrograms) <- requireProgram verbosity ghcProgram withPrograms
(gcc ,withPrograms) <- requireProgram normal gccProgram withPrograms
(ghc ,withPrograms) <- requireProgram normal ghcProgram withPrograms

settings <- read <$> getProgramOutput verbosity ghc ["--info"]
settings <- read <$> getProgramOutput normal ghc ["--info"]
-- We are reinstalling GHC
-- Write primop-*.hs-incl
let hsCppOpts = case lookup "Haskell CPP flags" settings of
Expand All @@ -103,7 +89,7 @@ ghcAutogen verbosity lbi@LocalBuildInfo{pkgDescrFile,withPrograms,componentNameM
cppOpts = hsCppOpts ++ ["-P","-x","c"]
cppIncludes = map ("-I"++) [compilerRoot]
-- Preprocess primops.txt.pp
primopsStr <- getProgramOutput verbosity gcc (cppOpts ++ cppIncludes ++ [primopsTxtPP])
primopsStr <- getProgramOutput normal gcc (cppOpts ++ cppIncludes ++ [primopsTxtPP])
-- Call genprimopcode to generate *.hs-incl
forM_ primopIncls $ \(file,command) -> do
contents <- readProcess "genprimopcode" [command] primopsStr
Expand Down
18 changes: 2 additions & 16 deletions libraries/ghc-boot/Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,12 @@ import Data.Char
import GHC.ResponseFile
import Distribution.System (Platform(..))

-- | Extract the 'Verbosity' from the configure flags.
--
-- Cabal 3.17 (commit edb808a0b8b) split the old @Verbosity@ type into
-- 'VerbosityFlags' (the CLI-passable part) and 'VerbosityHandles', so
-- 'configVerbosity' now yields a 'VerbosityFlags' which must be wrapped
-- back into a 'Verbosity' before passing it to the Cabal library functions.
configVerbosity' :: ConfigFlags -> Verbosity
#if MIN_VERSION_Cabal(3,17,0)
configVerbosity' cfg =
mkVerbosity defaultVerbosityHandles (fromFlagOrDefault silent (configVerbosity cfg))
#else
configVerbosity' cfg = fromFlagOrDefault minBound (configVerbosity cfg)
#endif

main :: IO ()
main = defaultMainWithHooks ghcHooks
where
ghcHooks = simpleUserHooks
{ confHook = \(gpd, hbi) cfg -> do
let verbosity = configVerbosity' cfg
let verbosity = fromFlagOrDefault minBound (configVerbosity cfg)
lbi <- confHook simpleUserHooks (gpd, hbi) cfg
gitCommitId <- lookupEnv "GIT_COMMIT_ID" >>= \case
Just str -> return str
Expand All @@ -55,7 +41,7 @@ main = defaultMainWithHooks ghcHooks
return lbi { configFlags = cfs { configProgramArgs = cPa } }

, postConf = \args cfg pd lbi -> do
let verbosity = configVerbosity' cfg
let verbosity = fromFlagOrDefault minBound (configVerbosity cfg)
ghcAutogen verbosity lbi
postConf simpleUserHooks args cfg pd lbi
}
Expand Down
Loading