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

feat[tool]: delay global constraint check #3810

Merged

Conversation

charles-cooper
Copy link
Member

@charles-cooper charles-cooper commented Feb 25, 2024

What I did

How I did it

How to verify it

Commit message

move the global constraint to later in compilation pipeline, so that you
can get a "partial compilation" of library modules with
`-f annotated_ast`. these library modules may declare `uses: X`, without
initializing `X`.

this is intended for third-party tools like IDEs, which may want to get
validation that a module will compile, even if it can't generate
bytecode (i.e., be a compilation target)

refactor:
* split `validate_semantics()` into `analyze_module()` and
  `validate_compilation_target()`

Description for the changelog

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

move the global constraint to later in compilation pipeline, so that you
can get a "partial compilation" library modules with `-f annotated_ast`.
these library modules may declare `uses: X`, without initializing `X.

this is intended for third-party tools like IDEs, which may want to get
validation that a module will compile, even if it can't generate
bytecode (be a compilation target)
@codecov-commenter
Copy link

codecov-commenter commented Feb 25, 2024

Codecov Report

Attention: Patch coverage is 95.45455% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 85.07%. Comparing base (391f3cc) to head (7b239c9).

Files Patch % Lines
vyper/semantics/analysis/module.py 87.50% 0 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3810      +/-   ##
==========================================
- Coverage   85.18%   85.07%   -0.11%     
==========================================
  Files          92       92              
  Lines       13908    13914       +6     
  Branches     3116     3118       +2     
==========================================
- Hits        11847    11838       -9     
- Misses       1567     1581      +14     
- Partials      494      495       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@charles-cooper charles-cooper changed the title feat: delay global constraint check feat[tool]: delay global constraint check Feb 25, 2024
Copy link
Member

@fubuloubu fubuloubu left a comment

Choose a reason for hiding this comment

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

One strong suggestion

@@ -54,8 +54,8 @@
def validate_module_semantics_r(
Copy link
Member

Choose a reason for hiding this comment

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

why _r? seems like unexplained codebase definition to use these as external API, and _r should just be expanded

Copy link
Member Author

Choose a reason for hiding this comment

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

_r is the convention for a lot of recursive functions. idk that it's really an external api, i can add a wrapper though

@charles-cooper charles-cooper enabled auto-merge (squash) February 27, 2024 23:19
@charles-cooper charles-cooper enabled auto-merge (squash) February 27, 2024 23:21
@charles-cooper charles-cooper merged commit 7d466a6 into vyperlang:master Feb 27, 2024
84 checks passed
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.

6 participants