From 10d1c5d28781683fac2252a06e7540821b76aac2 Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Thu, 8 Dec 2022 16:20:21 +0000 Subject: packaging: Fix upload_ghc_libs.py script This change reflects the changes where .cabal files are now generated by hadrian rather than ./configure. Fixes #22518 --- .gitlab/upload_ghc_libs.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitlab/upload_ghc_libs.py b/.gitlab/upload_ghc_libs.py index a1b5095c64..fdb1c55324 100755 --- a/.gitlab/upload_ghc_libs.py +++ b/.gitlab/upload_ghc_libs.py @@ -51,15 +51,19 @@ def prep_base(): def build_copy_file(pkg: Package, f: Path): target = Path('_build') / 'stage1' / pkg.path / 'build' / f dest = pkg.path / f - print(f'Building {target} for {dest}...') + build_file_hadrian(target) + print(f'Copying {target} to {dest}...') + dest.parent.mkdir(exist_ok=True, parents=True) + shutil.copyfile(target, dest) + +def build_file_hadrian(target: Path): build_cabal = Path('hadrian') / 'build-cabal' if not build_cabal.is_file(): build_cabal = Path('hadrian') / 'build.cabal.sh' + print(f'Building {target}...') run([build_cabal, target], check=True) - dest.parent.mkdir(exist_ok=True, parents=True) - shutil.copyfile(target, dest) def modify_file(pkg: Package, fname: Path, f: Callable[[str], str]): target = pkg.path / fname @@ -116,6 +120,7 @@ def prepare_sdist(pkg: Package): print(f'Preparing package {pkg.name}...') shutil.rmtree(pkg.path / 'dist-newstyle', ignore_errors=True) + build_file_hadrian(pkg.path / '{}.cabal'.format(pkg.name)) pkg.prepare_sdist() # Upload source tarball -- cgit v1.2.1