Fail when a data-dependency fails to compile (#4219)

* Fail when a data-dependency fails to compile

Previously, we emitted errors but just kept on going which sometimes
kinda works but is certainly not the right thing to do.

Now we just crash and abort compilation.

changelog_begin
changelog_end

* why is windows

* undo crap
This commit is contained in:
Moritz Kiefer 2020-01-27 16:25:47 +01:00 committed by mergify[bot]
parent 40292c2b6d
commit 3245a7b587

View File

@ -14,6 +14,7 @@ module DA.Cli.Damlc.Packaging
import qualified "zip" Codec.Archive.Zip as Zip
import qualified "zip-archive" Codec.Archive.Zip as ZipArchive
import Control.Exception.Extra
import Control.Lens (toListOf)
import Control.Monad.Extra
import Control.Monad.IO.Class
@ -230,13 +231,15 @@ generateAndInstallIfaceFiles dalf src opts workDir dbPath projectPackageDatabase
]
}
_ <- withDamlIdeState opts' loggerH diagnosticsLogger $ \ide ->
res <- withDamlIdeState opts' loggerH diagnosticsLogger $ \ide ->
runAction ide $
-- Setting ifDir to . means that the interface files will end up directly next to
-- the source files which is what we want here.
writeIfacesAndHie
(toNormalizedFilePath ".")
[fp | (fp, _content) <- src']
when (isNothing res) $
errorIO $ "Failed to compile interface for data-dependency: " <> unitIdStr
-- write the conf file and refresh the package cache
(cfPath, cfBs) <-
mkConfFile