Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC

Commits:

2 changed files:

Changes:

  • .gitlab-ci.yml
    ... ... @@ -1293,7 +1293,7 @@ ghcup-metadata-nightly:
    1293 1293
           artifacts: false
    
    1294 1294
         - job: project-version
    
    1295 1295
       script:
    
    1296
    -    - 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
    
    1296
    +    - nix shell -f .gitlab/rel_eng -c ghcup-metadata --nightly-mode --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
    
    1297 1297
       rules:
    
    1298 1298
         - if: $NIGHTLY
    
    1299 1299
     
    

  • .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
    ... ... @@ -320,6 +320,7 @@ def main() -> None:
    320 320
         parser.add_argument('--metadata', required=True, type=Path, help='Path to GHCUp metadata')
    
    321 321
         parser.add_argument('--pipeline-id', required=True, type=int, help='Which pipeline to generate metadata for')
    
    322 322
         parser.add_argument('--release-mode', action='store_true', help='Generate metadata which points to downloads folder')
    
    323
    +    parser.add_argument('--nightly-mode', action='store_true', help='The pipeline is a nightly pipeline')
    
    323 324
         parser.add_argument('--fragment', action='store_true', help='Output the generated fragment rather than whole modified file')
    
    324 325
         # TODO: We could work out the --version from the project-version CI job.
    
    325 326
         parser.add_argument('--version', required=True, type=str, help='Version of the GHC compiler')
    
    ... ... @@ -329,19 +330,14 @@ def main() -> None:
    329 330
     
    
    330 331
         project = gl.projects.get(1, lazy=True)
    
    331 332
         pipeline = project.pipelines.get(args.pipeline_id)
    
    332
    -    jobs = pipeline.jobs.list()
    
    333
    +    jobs = pipeline.jobs.list(iterator=True)
    
    333 334
         job_map = { job.name: job for job in jobs }
    
    334
    -    # Bit of a hacky way to determine what pipeline we are dealing with but
    
    335
    -    # the aarch64-darwin job should stay stable for a long time.
    
    336
    -    if 'nightly-aarch64-darwin-validate' in job_map:
    
    337
    -        pipeline_type = 'n'
    
    338
    -        if args.release_mode:
    
    339
    -            raise Exception("Incompatible arguments: nightly pipeline but using --release-mode")
    
    340
    -
    
    341
    -    elif 'release-aarch64-darwin-release' in job_map:
    
    342
    -        pipeline_type = 'r'
    
    343
    -    else:
    
    344
    -        raise Exception("Not a nightly nor release pipeline")
    
    335
    +
    
    336
    +    if args.nightly_mode and args.release_mode:
    
    337
    +        raise Exception("Incompatible arguments: --nightly-mode and --release-mode are mutually exclusive")
    
    338
    +    if not args.nightly_mode and not args.release_mode:
    
    339
    +        raise Exception("Specify either --nightly-mode or --release-mode")
    
    340
    +    pipeline_type = 'n' if args.nightly_mode else 'r'
    
    345 341
         eprint(f"Pipeline Type: {pipeline_type}")
    
    346 342
     
    
    347 343