[Git][ghc/ghc][wip/mangoiv/fix-nightly-messup] nightlies: output yaml to file only
Magnus pushed to branch wip/mangoiv/fix-nightly-messup at Glasgow Haskell Compiler / GHC Commits: c2cb025d by mangoiv at 2026-08-28T12:23:23+02:00 nightlies: output yaml to file only Previously we would just output the metadata to stdout which risks that it's clobbered by incidental debugt output. We now output to file only. Fixes #27511 - - - - - 2 changed files: - .gitlab-ci.yml - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py Changes: ===================================== .gitlab-ci.yml ===================================== @@ -1280,7 +1280,7 @@ ghcup-metadata-nightly: artifacts: false - job: project-version script: - - nix shell -f .gitlab/rel_eng -c ghcup-metadata --metadata ghcup-0.0.7.yaml --date="$(date -d $CI_PIPELINE_CREATED_AT +%Y-%m-%d)" --pipeline-id="$CI_PIPELINE_ID" --version="$ProjectVersion" > "metadata_test.yaml" + - nix shell -f .gitlab/rel_eng -c ghcup-metadata --metadata ghcup-0.0.7.yaml --date="$(date -d $CI_PIPELINE_CREATED_AT +%Y-%m-%d)" --pipeline-id="$CI_PIPELINE_ID" --version="$ProjectVersion" metadata_test.yaml rules: - if: $NIGHTLY ===================================== .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py ===================================== @@ -324,6 +324,7 @@ def main() -> None: # TODO: We could work out the --version from the project-version CI job. parser.add_argument('--version', required=True, type=str, help='Version of the GHC compiler') parser.add_argument('--date', required=True, type=str, help='Date of the compiler release') + parser.add_argument('output_path', nargs='?', type=Path, help='Path to write the output to, if not set, dump to stdout') args = parser.parse_args() project = gl.projects.get(1, lazy=True) @@ -352,13 +353,14 @@ def main() -> None: with open(args.metadata, 'r') as file: ghcup_metadata = yaml.safe_load(file) if args.version in ghcup_metadata['ghcupDownloads']['GHC']: - # if there are days without a commit, then the nightly metadata - # is up to date by default, no need to fail, no need to upload anything - print("Refusing to override existing version in metadata, exiting") - sys.exit() + eprint("GHCUp nightly run produced the same metadata as last night") setNightlyTags(ghcup_metadata) ghcup_metadata['ghcupDownloads']['GHC'][args.version] = new_yaml - print(yaml.dump(ghcup_metadata)) + if args.output_path: + with open(args.output_path, 'w') as ofile: + yaml.dump(ghcup_metadata, ofile) + else: + print(yaml.dump(ghcup_metadata)) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c2cb025d26572f2a2b32a930c1532f8b... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c2cb025d26572f2a2b32a930c1532f8b... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Magnus (@MangoIV)