Skip to content

Commit a155b07

Browse files
authored
Merge pull request #8194 from robx/bootstrap-setup
bootstrap: generate missing Setup.hs in dependencies
2 parents 5b64eae + 5afa86b commit a155b07

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

bootstrap/bootstrap.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,12 @@ def install_dep(dep: BootstrapDep, ghc: Compiler) -> None:
184184
if dep.revision is not None:
185185
shutil.copyfile(cabal_file, sdist_dir / f'{dep.package}.cabal')
186186

187+
# We rely on the presence of Setup.hs
188+
if len(list(sdist_dir.glob('Setup.*hs'))) == 0:
189+
with open(sdist_dir / 'Setup.hs', 'w') as f:
190+
f.write('import Distribution.Simple\n')
191+
f.write('main = defaultMain\n')
192+
187193
elif dep.source == PackageSource.LOCAL:
188194
if dep.package == 'Cabal':
189195
sdist_dir = Path('Cabal').resolve()

0 commit comments

Comments
 (0)