Avoid globbing for stable packages (#3905)

I managed to break our Windows CI twice already due to this so while
it makes me sad, I think hardcoding those files is the more sensible
option for now.
This commit is contained in:
Moritz Kiefer 2019-12-19 11:29:11 +01:00 committed by mergify[bot]
parent 52bf6056a4
commit 10a7715d2b
2 changed files with 10 additions and 2 deletions

View File

@ -489,8 +489,15 @@ generatePackageMapRule opts =
generateStablePackages :: LF.Version -> FilePath -> IO ([FileDiagnostic], Map.Map (UnitId, LF.ModuleName) LF.DalfPackage)
generateStablePackages lfVersion fp = do
(diags, pkgs) <- fmap partitionEithers $ do
allFiles <- listFilesRecursive fp
let dalfs = filter ((== ".dalf") . takeExtension) allFiles
-- It is very tempting to just use a listFilesRecursive here.
-- However, that has broken CI several times on Windows due to the lack of
-- sandboxing which resulted in newly added files being picked up from other PRs.
-- Given that this list doesnt change too often and you will get a compile error
-- if you forget to update it, we hardcode it here.
let dalfs =
map (fp </>) $
map ("daml-prim" </>) ["DA-Types.dalf", "GHC-Prim.dalf", "GHC-Tuple.dalf", "GHC-Types.dalf"] <>
map ("daml-stdlib" </>) ["DA-Internal-Any.dalf", "DA-Internal-Template.dalf"]
forM dalfs $ \dalf -> do
let packagePath = takeFileName $ takeDirectory dalf
let unitId = stringToUnitId $ if packagePath == "daml-stdlib"

View File

@ -46,6 +46,7 @@ genrule(
visibility = ["//visibility:public"],
)
# If you change this you also need to update generateStablePackages in Development.IDE.Core.Rules.Daml
filegroup(
name = "stable-packages",
srcs = [