[Git][ghc/ghc][wip/supersven/libDir-setting] WIP: Relative LibDir is relative to topDir
Sven Tennie pushed to branch wip/supersven/libDir-setting at Glasgow Haskell Compiler / GHC Commits: 67aac579 by Sven Tennie at 2026-05-05T11:29:10+02:00 WIP: Relative LibDir is relative to topDir - - - - - 2 changed files: - compiler/GHC/Settings/IO.hs - hadrian/src/Rules/Generate.hs Changes: ===================================== compiler/GHC/Settings/IO.hs ===================================== @@ -152,9 +152,13 @@ initSettings top_dir = do -- LibDir is optional. If not set, derive it from topDir. This allows -- bindists to work without explicitly setting LibDir, but gives us the -- option to override it for inplace test compilers (the "stage2 - -- cross-compiler" scenario). - let lib_dir = fromRight top_dir $ - getRawFilePathSetting top_dir settingsFile mySettings "LibDir" + -- cross-compiler" scenario). If LibDir is a relative path, it is + -- interpreted relative to topDir. + let lib_dir_raw = fromRight top_dir $ + getRawFilePathSetting top_dir settingsFile mySettings "LibDir" + lib_dir = if isRelative lib_dir_raw + then top_dir </> lib_dir_raw + else lib_dir_raw return $ Settings { sGhcNameVersion = GhcNameVersion ===================================== hadrian/src/Rules/Generate.hs ===================================== @@ -491,7 +491,8 @@ generateSettings settingsFile includeLibDir package_db_path = do -- So, we need to decrement the stage to get the correct directory stage_dir_stage = predStage stage - rel_lib_topDir :: FilePath <- expr $ stageLibPath stage_dir_stage + lib_topDir :: FilePath <- expr $ stageLibPath stage_dir_stage + let rel_lib_topDir = makeRelativeNoSysLink (dropFileName settingsFile) lib_topDir settings <- traverse sequence $ [ ("unlit command", ("$topdir/../bin/" <>) <$> expr (programName (ctx { Context.package = unlit }))) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/67aac57907a85a545a741bca309b7eb7... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/67aac57907a85a545a741bca309b7eb7... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Sven Tennie (@supersven)