Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
-
dc14443b
by mangoiv at 2026-06-12T19:40:34-04:00
-
18b1d7f7
by David Eichmann at 2026-06-12T19:40:34-04:00
-
f1b098bc
by David Eichmann at 2026-06-12T19:40:35-04:00
5 changed files:
- .gitlab-ci.yml
- libraries/process
- testsuite/driver/testlib.py
- utils/ghc-toolchain/src/GHC/Toolchain/Program.hs
- utils/ghc-toolchain/src/GHC/Toolchain/Utils.hs
Changes:
| ... | ... | @@ -255,6 +255,9 @@ lint-changelog: |
| 255 | 255 | BUILD_FLAVOUR: default
|
| 256 | 256 | CHANGELOG_EXPECT_MR: "$CI_MERGE_REQUEST_IID"
|
| 257 | 257 | script:
|
| 258 | + # Cancel the job if there is a no-changelog label
|
|
| 259 | + - |
|
|
| 260 | + [[ ",${CI_MERGE_REQUEST_LABELS}," == *",no-changelog,"* ]] && exit 0
|
|
| 258 | 261 | # Check that the MR adds at least one changelog entry
|
| 259 | 262 | - git fetch "$CI_MERGE_REQUEST_PROJECT_URL" "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
|
| 260 | 263 | - base="$(git merge-base FETCH_HEAD $CI_COMMIT_SHA)"
|
| ... | ... | @@ -274,8 +277,6 @@ lint-changelog: |
| 274 | 277 | rules:
|
| 275 | 278 | - if: '$CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/'
|
| 276 | 279 | when: never
|
| 277 | - - if: '$CI_MERGE_REQUEST_LABELS =~ /.*no-changelog.*/'
|
|
| 278 | - when: never
|
|
| 279 | 280 | - if: $CI_MERGE_REQUEST_ID
|
| 280 | 281 | - *drafts-can-fail-lint
|
| 281 | 282 |
| 1 | -Subproject commit 92deb52c1781bf10ad390296dbc435abe103bfe4 |
|
| 1 | +Subproject commit 11fd247ad33208da7a914acf15d4a09d64a6a4c4 |
| ... | ... | @@ -3066,11 +3066,15 @@ def normalise_errmsg(s: str) -> str: |
| 3066 | 3066 | # Old emcc warns when we export HEAP8 but new one requires it (see #26290)
|
| 3067 | 3067 | s = s.replace('warning: invalid item in EXPORTED_RUNTIME_METHODS: HEAP8\nwarning: invalid item in EXPORTED_RUNTIME_METHODS: HEAPU8\nemcc: warning: warnings in JS library compilation [-Wjs-compiler]\n','')
|
| 3068 | 3068 | |
| 3069 | - # on newer versions of MacOS X, the shipped ranlib warns about object files with no symbols,
|
|
| 3070 | - # however, these are completely benign stubs.
|
|
| 3071 | - # See https://gitlab.haskell.org/ghc/ghc/-/issues/27116
|
|
| 3072 | 3069 | if opsys('darwin'):
|
| 3070 | + # on newer versions of MacOS X, the shipped ranlib warns about object files with no symbols,
|
|
| 3071 | + # however, these are completely benign stubs.
|
|
| 3072 | + # See https://gitlab.haskell.org/ghc/ghc/-/issues/27116
|
|
| 3073 | 3073 | s = modify_lines(s, lambda l: re.sub(r'.*ranlib:.*has no symbols', '', l))
|
| 3074 | + # we also want to remove linker warnings having to do with undefined dynamic_lookup in combination with
|
|
| 3075 | + # making a single weak symbol undefined as this is dependent on other linker flags
|
|
| 3076 | + # See also https://github.com/haskell/process/pull/377
|
|
| 3077 | + s = drop_lines_containing(s, 'ld: warning: -U option is redundant when using -undefined dynamic_lookup')
|
|
| 3074 | 3078 | |
| 3075 | 3079 | return s
|
| 3076 | 3080 |
| ... | ... | @@ -148,12 +148,14 @@ findProgram description userSpec candidates |
| 148 | 148 | Just prefix -> map (prefix++) candidates
|
| 149 | 149 | Nothing -> []
|
| 150 | 150 | candidates' = prefixedCandidates ++ candidates
|
| 151 | - err =
|
|
| 152 | - [ "Failed to find " ++ description ++ "."
|
|
| 153 | - , "Looked for one of " ++ show candidates' ++ " in the system search path."
|
|
| 154 | - ]
|
|
| 155 | - path <- oneOf' err (map findExecutableErr candidates')
|
|
| 156 | - return Program { prgPath = path, prgFlags = fromMaybe [] (poFlags userSpec) }
|
|
| 151 | + pathMay <- findM doesExecutableExist candidates'
|
|
| 152 | + case pathMay of
|
|
| 153 | + Nothing -> throwEs
|
|
| 154 | + [ "Failed to find " ++ description ++ "."
|
|
| 155 | + , "Looked for one of " ++ show candidates' ++ " in the system search path."
|
|
| 156 | + ]
|
|
| 157 | + Just path ->
|
|
| 158 | + return Program { prgPath = path, prgFlags = fromMaybe [] (poFlags userSpec) }
|
|
| 157 | 159 | |
| 158 | 160 | -- Note that @configure.ac@ checks these llvm version constants (using @sed@) to
|
| 159 | 161 | -- ensure they are the same as the @$LlvmMinVersion@ and @$LlvmMaxVersion@
|
| ... | ... | @@ -222,21 +224,18 @@ maybeFindProgramFromProgOpts :: String -> ProgOpt -> Maybe (M Program) |
| 222 | 224 | maybeFindProgramFromProgOpts description userSpec = case poPath userSpec of
|
| 223 | 225 | Nothing -> Nothing
|
| 224 | 226 | Just path -> Just $ do
|
| 225 | - let err =
|
|
| 226 | - [ "Failed to find " ++ description ++ "."
|
|
| 227 | - , "Looked for user-specified program '" ++ path ++ "' in the system search path."
|
|
| 228 | - ]
|
|
| 229 | - path' <- findExecutableErr path <|> throwEs err
|
|
| 230 | - return Program { prgPath = path', prgFlags = fromMaybe [] (poFlags userSpec) }
|
|
| 231 | - |
|
| 232 | -findExecutableErr :: String -> M FilePath
|
|
| 233 | -findExecutableErr name = do
|
|
| 234 | - r <- liftIO $ findExecutable name
|
|
| 235 | - case r of
|
|
| 236 | - Nothing -> throwE $ name ++ " not found in search path"
|
|
| 237 | - -- Use the given `prgPath` or candidate name rather than the
|
|
| 238 | - -- absolute path returned by `findExecutable`.
|
|
| 239 | - Just _x -> return name
|
|
| 227 | + exists <- doesExecutableExist path
|
|
| 228 | + unless exists $ throwEs
|
|
| 229 | + [ "Failed to find " ++ description ++ "."
|
|
| 230 | + , "Looked for user-specified program '" ++ path ++ "' in the system search path."
|
|
| 231 | + ]
|
|
| 232 | + return Program { prgPath = path, prgFlags = fromMaybe [] (poFlags userSpec) }
|
|
| 233 | + |
|
| 234 | +doesExecutableExist
|
|
| 235 | + :: String -- ^ executable name
|
|
| 236 | + -> M Bool
|
|
| 237 | +doesExecutableExist name = isJust <$> liftIO (findExecutable name)
|
|
| 238 | + |
|
| 240 | 239 | |
| 241 | 240 | -------------------- Compiling utilities --------------------
|
| 242 | 241 |
| ... | ... | @@ -9,6 +9,7 @@ module GHC.Toolchain.Utils |
| 9 | 9 | , oneOf'
|
| 10 | 10 | , isSuccess
|
| 11 | 11 | , lastLine
|
| 12 | + , findM
|
|
| 12 | 13 | ) where
|
| 13 | 14 | |
| 14 | 15 | import Control.Exception
|
| ... | ... | @@ -69,3 +70,10 @@ isSuccess = \case |
| 69 | 70 | |
| 70 | 71 | lastLine :: String -> String
|
| 71 | 72 | lastLine = maybe "" snd . unsnoc . lines
|
| 73 | + |
|
| 74 | +findM :: Monad m => (a -> m Bool) -> [a] -> m (Maybe a)
|
|
| 75 | +findM f = \case
|
|
| 76 | + [] -> return Nothing
|
|
| 77 | + a:as -> do
|
|
| 78 | + found <- f a
|
|
| 79 | + if found then return (Just a) else findM f as |