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

Enable l1-builtin-info test #673

Merged
merged 2 commits into from
Nov 14, 2024
Merged

Enable l1-builtin-info test #673

merged 2 commits into from
Nov 14, 2024

Conversation

Frassle
Copy link
Member

@Frassle Frassle commented Nov 13, 2024

This enables the l1-builtin-info test. As we're now running multiple templates with the same yamlLanguageHost we can't globally cache the template in loadTemplate anymore.

Instead we cache by the program directory. For normal runs there will only be the one program directory, and for conformance test we know each program will be in its own unique directory.

@Frassle Frassle force-pushed the fraser/l1-builtin-info branch 3 times, most recently from b206948 to 09c6472 Compare November 13, 2024 19:39
@Frassle Frassle added the impact/no-changelog-required This issue doesn't require a CHANGELOG update label Nov 13, 2024
@Frassle Frassle marked this pull request as ready for review November 13, 2024 19:40
@Frassle Frassle requested a review from a team as a code owner November 13, 2024 19:40
@Frassle Frassle force-pushed the fraser/l1-builtin-info branch 2 times, most recently from b0cfbbf to ba16090 Compare November 13, 2024 20:11
Copy link
Contributor

@lunaris lunaris left a comment

Choose a reason for hiding this comment

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

I'm minded for us to spend a bit of time trying to work out why directory caching doesn't work here, since it seems like the fundamental unit that we should be able to capture. Failing that, can we push down to the load and do it at the file level?

Base automatically changed from fraser/conformancetests to main November 14, 2024 10:00
@Frassle
Copy link
Member Author

Frassle commented Nov 14, 2024

I'm minded for us to spend a bit of time trying to work out why directory caching doesn't work here

Yeh I'll have a fresh look today. Maybe sleeping on it will have helped.

@Frassle
Copy link
Member Author

Frassle commented Nov 14, 2024

Found the problem with caching, it was only if "compiler" option was set. Fixed to use directory caches and added a comment as to why we don't cache if compiler is set.

@Frassle Frassle enabled auto-merge (squash) November 14, 2024 14:08
@Frassle Frassle merged commit 14b5d96 into main Nov 14, 2024
5 checks passed
@Frassle Frassle deleted the fraser/l1-builtin-info branch November 14, 2024 14:29
}
}

func (host *yamlLanguageHost) loadTemplate(directory string, compilerEnv []string) (*ast.TemplateDecl, syntax.Diagnostics, error) {
if host.template != nil && host.compiler == "" {
return host.template, host.diags, nil
// We can't cache comppiled templates because at the first point we call loadTemplate (in
Copy link
Contributor

Choose a reason for hiding this comment

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

s/comppiled/compiled/


return host.template, diags, nil
if host.compiler != "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be worth either adding a shouldCache method or even just a cache method that internalise this check/provide a single place we can document it.

@Frassle Frassle mentioned this pull request Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact/no-changelog-required This issue doesn't require a CHANGELOG update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants