Repository navigation
Cache plugin configs #3656
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
base: master
Are you sure you want to change the base?
Cache plugin configs #3656
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -244,8 +244,8 @@ func pkg(s *scope, args []pyObject) pyObject { | |
| s.Assert(configVal != nil, "error calling package(): %s is not a known config value", k) | ||
|
|
||
| // Merge in the existing config for dictionaries | ||
| if overrides, ok := v.(pyDict); ok { | ||
| if pluginConfig, ok := configVal.(pyDict); ok { | ||
| if overrides, ok := asDict(v); ok { | ||
| if pluginConfig, ok := asDict(configVal); ok { | ||
| newPluginConfig := pluginConfig.Copy() | ||
| for pluginKey, override := range overrides { | ||
| pluginKey = strings.ToUpper(pluginKey) | ||
|
|
@@ -515,11 +515,11 @@ func isType(obj pyObject, name string) bool { | |
| return name == "str" | ||
| case *pyRange: | ||
| return name == "range" | ||
| case pyList: | ||
| case pyList, pyFrozenList: | ||
| return name == "list" | ||
| case pyDict: | ||
| case pyDict, pyFrozenDict: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I ran a quick check against my repo and noticed differences in output, I suspect a change in behaviour; top-level variables in a sub included .build_defs file are frozen once it has loaded, so This changed output (ran a plz query print comparison with plz-before and plz-after), it's probably worth noting the slight change in behaviour (which probably makes more sense).
on would it make sense to check val != _UNSET before the isinstance call?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes exactly; there are some fixes in #3657 which I'll land in the same release as this and I've landed a fix internally to deal with that Thanks for looking into it! |
||
| return name == "dict" | ||
| case *pyConfig: | ||
| case *pyConfig, *pyFrozenConfig: | ||
| return name == "config" | ||
| case *pyFunc: | ||
| return name == "callable" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -510,7 +510,7 @@ func (d pyDict) Operator(operator Operator, operand pyObject) pyObject { | |
| } | ||
| panic("unknown dict key: " + s.String()) | ||
| case Union: | ||
| d2, ok := operand.(pyDict) | ||
| d2, ok := asDict(operand) | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. another drive-by about using a union operator of a dict and a frozen dict |
||
| if !ok { | ||
| panic("Operator to | must be another dict, not " + operand.Type()) | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1638,6 +1638,7 @@ func execute(command string) int { | |
| } | ||
| defer f.Close() | ||
| defer pprof.WriteHeapProfile(f) | ||
| defer runtime.GC() | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and here; we only get up-to-date stats for the heap profile once a GC cycle has completed, without this that might have been ages ago |
||
| } | ||
| if opts.MutexProfile != "" { | ||
| runtime.SetMutexProfileFraction(1) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not strictly related but a bit of a drive-by while I was here;
isinstanceshould treat a frozen list as being a list