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

fix[tool]: compile multiple files #4053

Merged

Conversation

charles-cooper
Copy link
Member

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

What I did

fix compilation for multiple files where they initialize the same module. the analysis was getting cached between compilations, leading to a compiler panic on allocating the storage layout (because the module was previously touched by the allocator).

this was not caught in previous testing because the pattern in the test suite is to run a single compilation per test, with a fresh input bundle.

How I did it

How to verify it

Commit message

fix compilation for multiple files where they initialize the same
module. the analysis was getting cached between compilations, leading to
a compiler panic on allocating the storage layout (because the module
was previously touched by the allocator).

this was not caught in previous testing because the pattern in the test
suite is to run a single compilation per test, with a fresh input
bundle.

Description for the changelog

Cute Animal Picture

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

@charles-cooper charles-cooper marked this pull request as ready for review May 25, 2024 13:13
@charles-cooper charles-cooper added this to the v0.4.0 milestone May 25, 2024
@charles-cooper
Copy link
Member Author

charles-cooper commented May 25, 2024

depends on #3789 for the storage layout test updates

@cyberthirst
Copy link
Collaborator

very interesting issue. putting stuff to cache across separate compilation runs seems pretty dangerous.
are we sure there isn't another instance of this pattern?

@charles-cooper
Copy link
Member Author

very interesting issue. putting stuff to cache across separate compilation runs seems pretty dangerous. are we sure there isn't another instance of this pattern?

none come to mind. it's actually not supposed to cache across compilation runs, assigning _ast_of to the input bundle lifetime instead of the CompilerData lifetime was probably the mistake here

@charles-cooper charles-cooper enabled auto-merge (squash) May 28, 2024 17:19
@charles-cooper charles-cooper merged commit 003d0c6 into vyperlang:master May 28, 2024
156 checks passed
@charles-cooper charles-cooper deleted the fix/compile-multiple-files branch May 28, 2024 17:26
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