Magnus pushed to branch wip/mangoiv/fix-nightly-messup at Glasgow Haskell Compiler / GHC

Commits:

2 changed files:

Changes:

  • .gitlab-ci.yml
    ... ... @@ -1280,7 +1280,7 @@ ghcup-metadata-nightly:
    1280 1280
           artifacts: false
    
    1281 1281
         - job: project-version
    
    1282 1282
       script:
    
    1283
    -    - 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"
    
    1283
    +    - 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
    
    1284 1284
       rules:
    
    1285 1285
         - if: $NIGHTLY
    
    1286 1286
     
    

  • .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
    ... ... @@ -324,6 +324,7 @@ def main() -> None:
    324 324
         # TODO: We could work out the --version from the project-version CI job.
    
    325 325
         parser.add_argument('--version', required=True, type=str, help='Version of the GHC compiler')
    
    326 326
         parser.add_argument('--date', required=True, type=str, help='Date of the compiler release')
    
    327
    +    parser.add_argument('output_path', nargs='?', type=Path, help='Path to write the output to, if not set, dump to stdout')
    
    327 328
         args = parser.parse_args()
    
    328 329
     
    
    329 330
         project = gl.projects.get(1, lazy=True)
    
    ... ... @@ -352,13 +353,14 @@ def main() -> None:
    352 353
             with open(args.metadata, 'r') as file:
    
    353 354
                 ghcup_metadata = yaml.safe_load(file)
    
    354 355
                 if  args.version in ghcup_metadata['ghcupDownloads']['GHC']:
    
    355
    -                # if there are days without a commit, then the nightly metadata
    
    356
    -                # is up to date by default, no need to fail, no need to upload anything
    
    357
    -                print("Refusing to override existing version in metadata, exiting")
    
    358
    -                sys.exit()
    
    356
    +                eprint("GHCUp nightly run produced the same metadata as last night")
    
    359 357
                 setNightlyTags(ghcup_metadata)
    
    360 358
                 ghcup_metadata['ghcupDownloads']['GHC'][args.version] = new_yaml
    
    361
    -            print(yaml.dump(ghcup_metadata))
    
    359
    +            if args.output_path:
    
    360
    +                with open(args.output_path, 'w') as ofile:
    
    361
    +                    yaml.dump(ghcup_metadata, ofile)
    
    362
    +            else:
    
    363
    +                print(yaml.dump(ghcup_metadata))
    
    362 364
     
    
    363 365
     
    
    364 366