-
Notifications
You must be signed in to change notification settings - Fork 347
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
PkgPath contains vendor path prefix #916
Comments
Why is this causing problem ? Do you have a specific example, failing without, and succeeding with the behavior you propose ? |
Strill trying to recreate it. It fails with brotli at:
When removing the prefix i get to to a different error: |
Updated the example with snippets from brotli related to the error, this is incomplete though and no executable |
would need to be applied to // id returns a unique type identificator string.
func (t *itype) id() (res string) {
if t.name != "" {
if t.path != "" {
return t.path + "." + t.name
return fixPkgPathVendoring(t.path) + "." + t.name
}
return t.name
}
@ interp/type.go:1121 @ func (t *itype) id() (res string) {
case valueT:
res = ""
if t.rtype.PkgPath() != "" {
res += t.rtype.PkgPath() + "."
res += fixPkgPathVendoring(t.rtype.PkgPath()) + "."
}
res += t.rtype.Name()
} |
keeping a branch open where the error occurs:
|
will do |
@mvertes yes, boots up fine and plugin is visible in dashboard. |
ok thanks. Other changes are coming to fix the remaining issues in brotli. |
When running GTA, the type `path` was set to `rpath`. This equates to the package path (`github.com/traefik/yaegi`) in most cases. In the vendored case the `rpath` is the sub package path `something/vendor/github.com/traefik/yaegi` causing issues in typecheck and likely further down the line. By using the `importPath` it makes this consistent. **Note:** I have no clue how to test this decently. I am open to options here. Potentially Fixes #916
PkgPath can contain the vendor path prefix when using vendored dependencies in a traefik plugin.
equals then tries to compare an id with the prefix with one without it:
The following triggers an unexpected error:
Expected result:
Got:
To fix this the prefix might be removed from PkgPath as others have done.
see also golang/go#12739
The text was updated successfully, but these errors were encountered: