diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2023-01-04 17:19:13 -0500 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2023-01-26 00:17:03 -0500 |
commit | 892d10764791de0073ae59de62264d460fee4c7e (patch) | |
tree | 6ae0a383044cc09e360295102bd390be742fd10c /hadrian/bootstrap/bootstrap.py | |
parent | f3fee014c8c80247ba7689c316dc1f8c4f8a496b (diff) | |
download | haskell-wip/rts-configure-new-cabal.tar.gz |
Get newer Cabal for Hadrian, use for `findPtr`wip/rts-configure-new-cabal
There are many more things we would use this for, this is just a first
simple example to ensure the Cabal bump is working as intended.
The support for multiple package in `bootstrap.py` matches Cabal's
`bootstrap.py`, its inspiration, in order to keep it easy to sync
changes back and forth.
Diffstat (limited to 'hadrian/bootstrap/bootstrap.py')
-rwxr-xr-x | hadrian/bootstrap/bootstrap.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/hadrian/bootstrap/bootstrap.py b/hadrian/bootstrap/bootstrap.py index b997cbc916..4fd6e147a5 100755 --- a/hadrian/bootstrap/bootstrap.py +++ b/hadrian/bootstrap/bootstrap.py @@ -78,6 +78,8 @@ FetchInfo = NamedTuple('FetchInfo', [ FetchPlan = Dict[Path, FetchInfo] +local_packages: List[PackageName] = ["hadrian", "Cabal-syntax", "Cabal"] + class Compiler: def __init__(self, ghc_path: Path): if not ghc_path.is_file(): @@ -173,7 +175,7 @@ def resolve_dep(dep : BootstrapDep) -> Path: shutil.copyfile(cabal_file, sdist_dir / f'{dep.package}.cabal') elif dep.source == PackageSource.LOCAL: - if dep.package == 'hadrian': + if dep.package in local_packages: sdist_dir = Path(sys.path[0]).parent.resolve() else: raise ValueError(f'Unknown local package {dep.package}') @@ -341,7 +343,7 @@ def fetch_from_plan(plan : FetchPlan, output_dir : Path): def gen_fetch_plan(info : BootstrapInfo) -> FetchPlan : sources_dict = {} for dep in info.dependencies: - if dep.package != 'hadrian': + if not(dep.package in local_packages): sources_dict[f"{dep.package}-{dep.version}.tar.gz"] = FetchInfo(package_url(dep.package, dep.version), dep.src_sha256) if dep.revision is not None: sources_dict[f"{dep.package}.cabal"] = FetchInfo(package_cabal_url(dep.package, dep.version, dep.revision), dep.cabal_sha256) |