snowleopard / hadrian

Hadrian: a new build system for the Glasgow Haskell Compiler. Now merged into the GHC tree!
https://gitlab.haskell.org/ghc/ghc/tree/master/hadrian
MIT License
208 stars 39 forks source link

build.cabal.sh's condition on sandbox init is too brittle #524

Closed izgzhen closed 6 years ago

izgzhen commented 6 years ago

https://github.com/snowleopard/hadrian/blob/9eef6a7c7cce150f39740beb8570f4cbc38b947e/build.cabal.sh#L61-L68

If I CTRL-C during install phase, then continue, some packages will be left uninstalled.

snowleopard commented 6 years ago

Not sure what would be the right fix. I guess one could create a temporary file install-in-progress.txt before the install and remove it afterwards. This would indicate that the previous install was terminated and thus needs to be resumed.

izgzhen commented 6 years ago

I think a better solution is to make these three lines of cabal commands idempotent, and drop the condition

snowleopard commented 6 years ago

I guess, we can always do install (it will be fast when repeated), but the two sandbox commands should still be conditional.

izgzhen commented 6 years ago

sounds good