pulumi/changelog/pending
Abhinav Gupta a244de9092
fix(host/go): Download external plugins even if they're not imported
We previously changed how the Go language host retrieves information
about a Go module:

    before: go list -m -json -mod=mod all
    after:  go list -m -json $importPath1 $importPath1

This change made it possible for us to supprot running in vendored mode
which allowed for use of private plugins that are not go-get-able.

This uncovered a corner case in the `go` command's behavior
when running in module mode:

If a package is listed in the go.mod
but it's not imported by the current module,
`go list -m -json $importPath` will not list its Dir in the output
even if it's present in the module cache.
For example, given a go.mod file that declares a dependency
but code that doesn't import it, as of Go 1.20.5,

    export GOMODCACHE=$(mktemp -d)
    go mod download -json
    go list -m -json $importPath

The output of `go mod download` will include information
about the dependency and the `Dir` where it was downloaded,
but `go list -m` will not.

Unfortunately, we can't just use `go mod download`
because that breaks vendoring:
vendored dependencies cannot always be redownloaded.

To resolve this issue,
we switch to a two-pass variant to gather this information:

- Run `go list -m` to get whatever information we can locally.
  This will be sufficient for the majority of use cases.
- For the handful of cases where the dependency isn't imported,
  we'll use `go mod download -json` to download them on-demand
  and get their location from that instead.

The `go mod download` step will take place only if we're in module mode.
In vendor mode, we'll work with what we have.

Resolves #13301
2023-07-11 16:22:15 -07:00
..
20230614--programgen-go--adds-explicit-package-versioning-to-golang-codegen.yaml Changelog 2023-06-14 13:45:39 -07:00
20230622--cli-new--pulumi-new-s-org-project-stack-checks-the-specified-organization-for-project-existence-rather-than-the-currentuser.yaml `pulumi new -s 'org/project/stack'` checks the proper organization for project existence rather than backend.currentUser()'s org. 2023-07-03 09:28:52 -07:00
20230622--cli-new--when-providing-a-stack-and-name-to-pulumi-new-the-project-names-must-match-before-creating-pulumi-yaml.yaml `pulumi new` `--stack` and `--name` now must match before creating project. 2023-06-29 15:34:38 -07:00
20230624--sdk-nodejs--add-dependency-on-atopentelemetry-instrumentation.yaml [sdk/nodejs] Add explicit dependency on @opentelemetry/instrumentation 2023-06-24 16:32:40 -07:00
20230629--sdk-python--python-dynamic-provider-serialized-code-is-now-saved-to-state-as-secret.yaml Always mark dynamic provider code as secret 2023-07-06 13:50:59 +01:00
20230630--sdk-nodejs--node-js-dynamic-providers-mark-serialized-functions-as-secret-if-they-capture-any-secrets.yaml Add CHANGELOG 2023-06-29 22:20:47 -07:00
20230710--cli-plugin--fix-interpolation-of-vesion-into-http-plugin-source-urls.yaml Fix http source URL interpolation 2023-07-10 11:05:30 +01:00
20230710--programgen-dotnet-go-nodejs-python--allow-generating-code-for-unknown-invokes-tf-data-sources-in-non-strict-mode.yaml Allow generating code for unknown invokes in non-strict mode 2023-07-10 15:05:18 +02:00
20230711--sdk-go--fix-downloading-of-unimported-external-plugins.yaml fix(host/go): Download external plugins even if they're not imported 2023-07-11 16:22:15 -07:00