Skip to content

Commit

Permalink
Fix last bug in testsuite
Browse files Browse the repository at this point in the history
  • Loading branch information
alt-romes committed Jan 12, 2024
1 parent 423d5b2 commit 13800dd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Cabal/src/Distribution/Simple/GHC/Build.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ rapidly reach this limit, in part, due to the long length of cabal v2
prefixes. To minimize the likelihood, we use
`makeRelativeToCurrentDirectory` to shorten the paths used in invocations
(see da6321bb).
However, in executables, we don't do this. It seems that we don't need to do it
for executable-like components because the linking step, instead of passing as
an argument the path to each module, it simply passes the module name, the sources dir, and --make.
RM: I believe we can use --make + module names instead of paths-to-objects
for linking libraries too (2024-01) (TODO)
-}

-- | The main build phase of building a component.
Expand Down Expand Up @@ -80,8 +86,11 @@ build numJobs pkg_descr = do
liftIO do
createDirectoryIfMissingVerbose verbosity True targetDir_absolute
createDirectoryIfMissingVerbose verbosity True buildTargetDir_absolute

-- See Note [Build Target Dir vs Target Dir] as well
targetDir <- makeRelativeToCurrentDirectory targetDir_absolute & liftIO
buildTargetDir <- makeRelativeToCurrentDirectory buildTargetDir_absolute & liftIO
buildTargetDir <- if isLib then makeRelativeToCurrentDirectory buildTargetDir_absolute & liftIO
else return buildTargetDir_absolute

(ghcProg, _) <- requireProgram verbosity ghcProgram (withPrograms lbi) & liftIO

Expand Down
1 change: 1 addition & 0 deletions Cabal/src/Distribution/Simple/GHC/Build/Link.hs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ linkOrLoadComponent ghcProg pkg_descr extraSources (buildTargetDir, targetDir) (
PD.ldOptions bi
++ [ "-static"
| withFullyStaticExe lbi -- ROMES:TODO: wb withStaticLib??
-- ROMES:TODO: wouldn't this be best handled by re-using the build opt for the way being linked?
]
-- Pass extra `ld-options` given
-- through to GHC's linker.
Expand Down

0 comments on commit 13800dd

Please sign in to comment.