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

"could not find package" build fail with AWS-V2 and dependents #1034

Open
theGlenn opened this issue Feb 20, 2024 · 2 comments
Open

"could not find package" build fail with AWS-V2 and dependents #1034

theGlenn opened this issue Feb 20, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@theGlenn
Copy link

theGlenn commented Feb 20, 2024

On deploy encore build fails with could not find package "github.com/aws/aws-sdk-go-v2/service/s3"

The same failure occurs with dependent package gocloud.dev/blob

Sources for reproducibility

AWS-SDK V2

import (
	"github.com/aws/aws-sdk-go-v2/service/s3"
)

type fileStorageClient struct {
	s3 *s3.Client
}

Stack

test build step initializing
── Error ──────────────────────────────────────────────────────────────[E0003]──

err: exit status 1: stderr: go: downloading
github.com/aws/aws-sdk-go-v2/service/s3 v1.50.1

"level":"info","dir":"/.cache/go-cacher","time":"2024-02-20T11:10:19Z","message":"using
default cache dir"}

"level":"debug","base_url":"http://127.0.0.1:43001","time":"2024-02-20T11:10:19Z","message":"using
http cacheprog server"}
go: downloading github.com/aws/aws-sdk-go-v2 v1.25.0
go: downloading github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.0
go: downloading github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.0
go: downloading github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.0
go: downloading github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding
v1.11.0
go: downloading github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.0
go: downloading github.com/aws/aws-sdk-go-v2/service/internal/presigned-url
v1.11.0
go: downloading github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.0
go: downloading github.com/aws/smithy-go v1.20.0
go: downloading github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.0
go: downloading github.com/google/go-cmp v0.5.9
go: updates to go.mod needed; to update it:
	go mod tidy

╭─[Stack Trace]
├─▶ pkginfo.(*Loader).resolveModuleForPkg            [email protected]/v2/internals/pkginfo/modresolve.go:175
├─▶ pkginfo.(*Loader).LoadPkg                        [email protected]/v2/internals/pkginfo/loader.go:183
├─▶ pkginfo.(*Loader).MustLoadPkg                    [email protected]/v2/internals/pkginfo/loader.go:136
├─▶ pkginfo.(*FileNames).resolveImportPath.func1.1.1 [email protected]/v2/internals/pkginfo/names.go:766
├─▶ sync.(*Once).doSlow                              sync/once.go:74
├─▶ sync.(*Once).Do                                  sync/once.go:65
╰─[... remaining frames omitted ...]

── Error ──────────────────────────────────────────────────────────────[E0003]──

could not find package "github.com/aws/aws-sdk-go-v2/service/s3"

go cloud

package files

import (
	"github.com/pkg/errors"
	"gocloud.dev/blob"
)

type fileStorageClient struct {
	bucketURL  string
}

...

func (c *fileStorageClient) openBucket(ctx context.Context) (*blob.Bucket, error) {
	bucket, err := blob.OpenBucket(ctx, c.bucketURL)
	if err != nil {
		return nil, errors.Wrap(err, "failed to open bucket")
	}
	return bucket, nil
}

Stack

compile build step initializing
compiling application
── Error ──────────────────────────────────────────────────────────────[E0003]──

err: exit status 1: stderr: go: downloading gocloud.dev v0.36.0
go: updates to go.mod needed; to update it:
	go mod tidy

╭─[Stack Trace]
├─▶ pkginfo.(*Loader).resolveModuleForPkg            [email protected]/v2/internals/pkginfo/modresolve.go:175
├─▶ pkginfo.(*Loader).LoadPkg                        [email protected]/v2/internals/pkginfo/loader.go:183
├─▶ pkginfo.(*Loader).MustLoadPkg                    [email protected]/v2/internals/pkginfo/loader.go:136
├─▶ pkginfo.(*FileNames).resolveImportPath.func1.1.1 [email protected]/v2/internals/pkginfo/names.go:766
├─▶ sync.(*Once).doSlow                              sync/once.go:74
├─▶ sync.(*Once).Do                                  sync/once.go:65
╰─[... remaining frames omitted ...]

── Error ──────────────────────────────────────────────────────────────[E0003]──

could not find package "gocloud.dev/blob"
@theGlenn theGlenn changed the title "could not find package" is with AWS-V2 and dependent "could not find package" build fail with AWS-V2 and dependents Feb 20, 2024
@eandre
Copy link
Member

eandre commented Feb 20, 2024

Thanks @theGlenn for the detailed report! Will try to reproduce.

@eandre eandre self-assigned this Feb 20, 2024
@eandre eandre added the bug Something isn't working label Feb 20, 2024
@theGlenn
Copy link
Author

Update this seems to work fine with cgo_enabled:true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants