Skip to content

Commit

Permalink
Merge pull request #8201 from haskell/mergify/bp/3.8/pr-8194
Browse files Browse the repository at this point in the history
bootstrap: generate missing Setup.hs in dependencies (backport #8194)
  • Loading branch information
Mikolaj authored Jun 8, 2022
2 parents 71fc82c + 4f0839f commit 323f916
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@ def install_dep(dep: BootstrapDep, ghc: Compiler) -> None:
if dep.revision is not None:
shutil.copyfile(cabal_file, sdist_dir / f'{dep.package}.cabal')

# We rely on the presence of Setup.hs
if len(list(sdist_dir.glob('Setup.*hs'))) == 0:
with open(sdist_dir / 'Setup.hs', 'w') as f:
f.write('import Distribution.Simple\n')
f.write('main = defaultMain\n')

elif dep.source == PackageSource.LOCAL:
if dep.package == 'Cabal':
sdist_dir = Path('Cabal').resolve()
Expand Down

0 comments on commit 323f916

Please sign in to comment.