diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-12-08 16:20:21 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-12-20 21:15:22 -0500 |
commit | 9736ab7497ab91fe9d3bda57ca6d1230d7968fe2 (patch) | |
tree | 66b944982fc04bf4608ce4b3f6d2835f70e1930b /.gitlab | |
parent | 703a466511307c5737d371898f9771991a0a31cc (diff) | |
download | haskell-9736ab7497ab91fe9d3bda57ca6d1230d7968fe2.tar.gz |
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
Diffstat (limited to '.gitlab')
-rwxr-xr-x | .gitlab/upload_ghc_libs.py | 11 |
1 files 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 |