You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
plz query config correctly outputs the values of a plugin config field if it has been explicitly set in .plzconfig. However, it errors if not.
For example, in this repository:
plz query config plugin.go.gotool outputs //third_party/go:toolchain|go which has been explicitly set in .plzconfig
plz query config plugin.go.delvetool errors with Failed to get plugin.go.delvetool: Settable field not defined: plugin.go.delvetool
This is annoying for external consumers of these values as they have to hardcode the default values in their logic.
Solution
Update config.Config so that when we fail to look up a value from the "plugin" section of the configuration, we attempt to read the default values from the plugin's .plzconfig.
Default values which look like build labels are normalised. For example: plz query config plugin.go.pleasegotool outputs ///go//tools:please_go instead of //tools:please_go which was what was actually specified by the go plugin. This allows consumers of the values to not care were they came from (if they want to build the target for example).
Thanks for having a look at that build failure pebers, I missed that 🤦♂️
I don't really understand the cause (maybe the build.xattrs = false in the linux-build-alt.plzconfig?) but I can believe that your change will avoid it and it makes sense anyway since the test doesn't actually need the thing the label points to to exist.
Now the failure we're hitting in the build-darwin job is the race detector sounding the alarm (different from #3556). Seems unrelated to my change though since I see the same failure on my arm mac on master (also building plz wouldnt go through the code path i changed). I ran the pipeline myself and all of the jobs passed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
plz query configcorrectly outputs the values of a plugin config field if it has been explicitly set in.plzconfig. However, it errors if not.For example, in this repository:
plz query config plugin.go.gotooloutputs//third_party/go:toolchain|gowhich has been explicitly set in .plzconfigplz query config plugin.go.delvetoolerrors withFailed to get plugin.go.delvetool: Settable field not defined: plugin.go.delvetoolThis is annoying for external consumers of these values as they have to hardcode the default values in their logic.
Solution
Update
config.Configso that when we fail to look up a value from the"plugin"section of the configuration, we attempt to read the default values from the plugin's.plzconfig.Default values which look like build labels are normalised. For example:
plz query config plugin.go.pleasegotooloutputs///go//tools:please_goinstead of//tools:please_gowhich was what was actually specified by the go plugin. This allows consumers of the values to not care were they came from (if they want to build the target for example).