[Git][ghc/ghc][wip/t22518] packaging: Fix upload_ghc_libs.py script
Matthew Pickering (@mpickering)
gitlab at gitlab.haskell.org
Thu Dec 8 16:23:09 UTC 2022
Matthew Pickering pushed to branch wip/t22518 at Glasgow Haskell Compiler / GHC
Commits:
4738efa0 by Matthew Pickering at 2022-12-08T16:22:53+00:00
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
- - - - -
1 changed file:
- .gitlab/upload_ghc_libs.py
Changes:
=====================================
.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
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4738efa09634030d5987afb5a23851d80aa5465e
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4738efa09634030d5987afb5a23851d80aa5465e
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20221208/ff8aa72d/attachment-0001.html>
More information about the ghc-commits
mailing list