Skip to content
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

Allow using project files together with --library #5297

Merged
merged 63 commits into from
Apr 29, 2024

Conversation

keyboardDrummer
Copy link
Member

@keyboardDrummer keyboardDrummer commented Apr 4, 2024

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
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
@keyboardDrummer keyboardDrummer merged commit 1be1cba into dafny-lang:master Apr 29, 2024
20 checks passed
@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