Skip to content

Allow using project files together with --library#5297

Merged
keyboardDrummer merged 63 commits into
dafny-lang:masterfrom
keyboardDrummer:projectAsLibrary
Apr 29, 2024
Merged

Allow using project files together with --library#5297
keyboardDrummer merged 63 commits into
dafny-lang:masterfrom
keyboardDrummer:projectAsLibrary

Conversation

@keyboardDrummer

@keyboardDrummer keyboardDrummer commented Apr 4, 2024

Copy link
Copy Markdown
Member

Changes

  • To enable smoothly working with multiple projects inside a single repository, Dafny now allows using a Dafny project file as an argument to --library. This does the following:
    1. Call dafny build -t:lib using the project file to get a doo file. In the future we plan to let this be a NOOP if the right build file is already there.
    2. Replace the usage of the project file in the origin call to dafny, with this doo file.
  • Extract code from DafnyFile.CreateAndValidate into methods
  • When parsing a file, correctly pass parse options to included files. This does not have any particular affect because only doo files are passed with different options, and those do not use includes. However, doing this does seem more correct and it was useful previously, so I'll keep it in.
  • Move ReadsClausesOnMethods option code
  • Do not let project files include themselves through something like includes = ["**/*"]

How has this been tested?

  • Add the CLI test projectAsLibrary.dfy

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

auto-merge was automatically disabled April 9, 2024 10:14

Merge queue setting changed

auto-merge was automatically disabled April 9, 2024 12:55

Merge queue setting changed

@keyboardDrummer keyboardDrummer enabled auto-merge (squash) April 9, 2024 13:01
@keyboardDrummer keyboardDrummer changed the title Warn when passing non-doo files to --library, and allow using project files in the same places as .dfy files Allow using project files in the same places as .dfy files Apr 10, 2024
@@ -0,0 +1,12 @@
// RUN: %resolve --library "%S/dfyconfig.toml" --library %S/wrappersLib.dfy --allow-warnings --function-syntax 3 %s > "%t"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to pass --library %S/wrappersLib.dfy as well because it' a dependency of our dependency.

@keyboardDrummer keyboardDrummer marked this pull request as ready for review April 23, 2024 12:54
Comment thread Source/DafnyDriver/DafnyNewCli.cs
@keyboardDrummer keyboardDrummer enabled auto-merge (squash) April 29, 2024 07:52
@keyboardDrummer keyboardDrummer merged commit 1be1cba into dafny-lang:master Apr 29, 2024
@keyboardDrummer keyboardDrummer deleted the projectAsLibrary branch April 30, 2024 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants