-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid including daml-stdlib and daml-prim twice #4222
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -579,10 +579,7 @@ dataDependencyTests damlc repl davlDar = testGroup "Data Dependencies" $ | |
callProcessSilent repl ["validate", projb </> "projb.dar"] | ||
projbPkgIds <- darPackageIds (projb </> "projb.dar") | ||
-- daml-prim, daml-stdlib for targetLfVer, daml-prim, daml-stdlib for depLfVer if targetLfVer /= depLfVer, proja and projb | ||
-- TODO We should not need nubOrd here. This is currently required since we include the daml-stdlib and daml-prim | ||
-- dalfs twice. This is not a problem but wasteful and useless. | ||
-- See https://github.com/digital-asset/daml/issues/4114 | ||
length (nubOrd projbPkgIds) @?= numStablePackages | ||
length projbPkgIds @?= numStablePackages | ||
targetLfVer + 2 + (if targetLfVer /= depLfVer then 2 else 0) + 1 + 1 | ||
length (filter (`notElem` projaPkgIds) projbPkgIds) @?= | ||
(numStablePackages targetLfVer - numStablePackages depLfVer) + -- new stable packages | ||
|
@@ -644,6 +641,72 @@ dataDependencyTests damlc repl davlDar = testGroup "Data Dependencies" $ | |
callProcessSilent repl ["validate", tmpDir </> "foobar.dar"] | ||
step "Testing scenario" | ||
callProcessSilent repl ["test", "Main:test", tmpDir </> "foobar.dar"] | ||
, testCaseSteps "Mixed dependencies and data-dependencies" $ \step -> withTempDir $ \tmpDir -> do | ||
step "Building 'lib'" | ||
createDirectoryIfMissing True (tmpDir </> "lib") | ||
writeFileUTF8 (tmpDir </> "lib" </> "daml.yaml") $ unlines | ||
[ "sdk-version: " <> sdkVersion | ||
, "version: 0.0.1" | ||
, "name: lib" | ||
, "source: ." | ||
, "dependencies: [daml-prim, daml-stdlib]" | ||
] | ||
writeFileUTF8 (tmpDir </> "lib" </> "Lib.daml") $ unlines | ||
[ "daml 1.2 module Lib where" | ||
, "inc : Int -> Int" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you think |
||
, "inc = (+ 1)" | ||
] | ||
withCurrentDirectory (tmpDir </> "lib") $ callProcessSilent damlc ["build", "-o", tmpDir </> "lib" </> "lib.dar"] | ||
libPackageIds <- darPackageIds (tmpDir </> "lib" </> "lib.dar") | ||
|
||
step "Building 'a'" | ||
createDirectoryIfMissing True (tmpDir </> "a") | ||
writeFileUTF8 (tmpDir </> "a" </> "daml.yaml") $ unlines | ||
[ "sdk-version: " <> sdkVersion | ||
, "version: 0.0.1" | ||
, "name: a" | ||
, "source: ." | ||
, "dependencies:" | ||
, " - daml-prim" | ||
, " - daml-stdlib" | ||
, " - " <> show (tmpDir </> "lib" </> "lib.dar") | ||
] | ||
writeFileUTF8 (tmpDir </> "a" </> "A.daml") $ unlines | ||
[ "daml 1.2 module A where" | ||
, "import Lib" | ||
, "two : Int" | ||
, "two = inc 1" | ||
] | ||
withCurrentDirectory (tmpDir </> "a") $ callProcessSilent damlc ["build", "-o", tmpDir </> "a" </> "a.dar"] | ||
aPackageIds <- darPackageIds (tmpDir </> "a" </> "a.dar") | ||
length aPackageIds @?= length libPackageIds + 1 | ||
|
||
step "Building 'b'" | ||
createDirectoryIfMissing True (tmpDir </> "b") | ||
writeFileUTF8 (tmpDir </> "b" </> "daml.yaml") $ unlines | ||
[ "sdk-version: " <> sdkVersion | ||
, "version: 0.0.1" | ||
, "name: b" | ||
, "source: ." | ||
, "dependencies:" | ||
, " - daml-prim" | ||
, " - daml-stdlib" | ||
, " - " <> show (tmpDir </> "lib" </> "lib.dar") | ||
, "data-dependencies: [" <> show (tmpDir </> "a" </> "a.dar") <> "]" | ||
] | ||
writeFileUTF8 (tmpDir </> "b" </> "B.daml") $ unlines | ||
[ "daml 1.2 module B where" | ||
, "import Lib" | ||
, "import A" | ||
, "three : Int" | ||
, "three = inc two" | ||
] | ||
withCurrentDirectory (tmpDir </> "b") $ callProcessSilent damlc ["build", "-o", tmpDir </> "b" </> "b.dar"] | ||
projbPackageIds <- darPackageIds (tmpDir </> "b" </> "b.dar") | ||
length projbPackageIds @?= length libPackageIds + 2 | ||
|
||
step "Validating DAR" | ||
callProcessSilent repl ["validate", tmpDir </> "b" </> "b.dar"] | ||
] <> | ||
[ testCaseSteps "Source generation edge cases" $ \step -> withTempDir $ \tmpDir -> do | ||
writeFileUTF8 (tmpDir </> "Foo.daml") $ unlines | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice :-)