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

certcache.go: undefined: certurl.CertChainItem #494

Open
mjroeleveld opened this issue Feb 18, 2021 · 6 comments
Open

certcache.go: undefined: certurl.CertChainItem #494

mjroeleveld opened this issue Feb 18, 2021 · 6 comments
Labels

Comments

@mjroeleveld
Copy link

Trying to build amppackager as described by README gives me the following error (in CI and locally):

# github.com/ampproject/amppackager/packager/certcache
../../../.go/pkg/mod/github.com/ampproject/[email protected]/packager/certcache/certcache.go:252:19: undefined: certurl.CertChainItem

It seems to have been introduced within the last couple of days.

@mjroeleveld mjroeleveld changed the title certcache.go:252:19: undefined: certurl.CertChainItem certcache.go: undefined: certurl.CertChainItem Feb 18, 2021
@banaag
Copy link
Collaborator

banaag commented Feb 18, 2021

hi joachimroeleveld, sorry to hear that you're having issues. Which branch are you building this from?

I just cloned from the master and release branches and built both the amppkg and certcache directory successfully:

$ git clone -b master https://github.com/ampproject/amppackager.git amppackager.master
$ cd amppackager.master/packager/certcache
$ go test ./...
ok github.com/ampproject/amppackager/packager/certcache 0.128s

From the root dir:
banaag@banaag:~/github/ampproject/amppackager.master$ go test ./...
? github.com/ampproject/amppackager/cmd/amppkg [no test files]
? github.com/ampproject/amppackager/cmd/amppkg_dl_sxg [no test files]
? github.com/ampproject/amppackager/cmd/amppkg_test_cache [no test files]
? github.com/ampproject/amppackager/cmd/gateway_server [no test files]
? github.com/ampproject/amppackager/cmd/gateway_server/gateway [no test files]
? github.com/ampproject/amppackager/cmd/transform [no test files]
ok github.com/ampproject/amppackager/internal/url 0.014s
ok github.com/ampproject/amppackager/packager/accept 0.030s
ok github.com/ampproject/amppackager/packager/amp_cache_transform 0.061s
ok github.com/ampproject/amppackager/packager/certcache 0.152s
ok github.com/ampproject/amppackager/packager/certfetcher 0.339s
ok github.com/ampproject/amppackager/packager/certloader 0.044s
ok github.com/ampproject/amppackager/packager/healthz 0.088s
ok github.com/ampproject/amppackager/packager/mux 0.075s
ok github.com/ampproject/amppackager/packager/rtv 0.081s
ok github.com/ampproject/amppackager/packager/signer 0.153s
? github.com/ampproject/amppackager/packager/testing [no test files]
ok github.com/ampproject/amppackager/packager/util 0.126s
ok github.com/ampproject/amppackager/packager/validitymap 0.046s
ok github.com/ampproject/amppackager/transformer 0.085s
ok github.com/ampproject/amppackager/transformer/internal/amphtml 0.032s
ok github.com/ampproject/amppackager/transformer/internal/css 0.037s
ok github.com/ampproject/amppackager/transformer/internal/htmlnode 0.070s
? github.com/ampproject/amppackager/transformer/internal/testing [no test files]
ok github.com/ampproject/amppackager/transformer/layout 0.036s
ok github.com/ampproject/amppackager/transformer/printer 0.008s
? github.com/ampproject/amppackager/transformer/request [no test files]
ok github.com/ampproject/amppackager/transformer/transformers 0.036s

I also cloned from the release branch and here's the top level build:
$ git clone https://github.com/ampproject/amppackager.git amppackager.release
banaag@banaag:~/github/ampproject/amppackager.release$ go test ./...
? github.com/ampproject/amppackager/cmd/amppkg [no test files]
? github.com/ampproject/amppackager/cmd/amppkg_dl_sxg [no test files]
? github.com/ampproject/amppackager/cmd/amppkg_test_cache [no test files]
? github.com/ampproject/amppackager/cmd/gateway_server [no test files]
? github.com/ampproject/amppackager/cmd/gateway_server/gateway [no test files]
? github.com/ampproject/amppackager/cmd/transform [no test files]
ok github.com/ampproject/amppackager/internal/url 0.023s
ok github.com/ampproject/amppackager/packager/accept 0.034s
ok github.com/ampproject/amppackager/packager/amp_cache_transform 0.062s
ok github.com/ampproject/amppackager/packager/certcache 0.192s
ok github.com/ampproject/amppackager/packager/certfetcher 0.286s
ok github.com/ampproject/amppackager/packager/certloader 0.074s
ok github.com/ampproject/amppackager/packager/healthz 0.108s
ok github.com/ampproject/amppackager/packager/mux 0.126s
ok github.com/ampproject/amppackager/packager/rtv 0.110s
ok github.com/ampproject/amppackager/packager/signer 0.155s
? github.com/ampproject/amppackager/packager/testing [no test files]
ok github.com/ampproject/amppackager/packager/util 0.152s
ok github.com/ampproject/amppackager/packager/validitymap 0.068s
ok github.com/ampproject/amppackager/transformer 0.044s
ok github.com/ampproject/amppackager/transformer/internal/amphtml 0.028s
ok github.com/ampproject/amppackager/transformer/internal/css 0.041s
ok github.com/ampproject/amppackager/transformer/internal/htmlnode 0.046s
? github.com/ampproject/amppackager/transformer/internal/testing [no test files]
ok github.com/ampproject/amppackager/transformer/layout 0.028s
ok github.com/ampproject/amppackager/transformer/printer 0.043s
? github.com/ampproject/amppackager/transformer/request [no test files]
ok github.com/ampproject/amppackager/transformer/transformers 0.062s

@banaag
Copy link
Collaborator

banaag commented Feb 18, 2021

I was able to reproduce your problem with:
$ go get -u github.com/ampproject/amppackager/cmd/amppkg

github.com/ampproject/amppackager/packager/certcache

../pkg/mod/github.com/ampproject/[email protected]/packager/certcache/certcache.go:252:19: undefined: certurl.CertChainItem

Investigating ...

@twifkak
Copy link
Member

twifkak commented Feb 18, 2021

Hi @joachimroeleveld, thanks for the report. It looks like our install instructions are incompatible with the latest release of Go 1.16. Until we fix it, you can do one of:

  • Keep using Go 1.15 or lower, or
  • git clone https://github.com/ampproject/amppackager.git && cd amppackager && go install ./cmd/amppkg

Details:

certurl.CertChainItem was removed from our upstream dependency a while ago but we've kept our version locked for stability.

The latest release of Go 1.16 changed the behavior of go get so that it doesn't use our vendor directory any more.

This announcement says the new command should be go install github.com/ampproject/amppackager/cmd/amppkg@latest: https://twitter.com/FiloSottile/status/1361827549626695680

However, that seems to produce a new error:

$ go install github.com/ampproject/amppackager/cmd/amppkg@latest
go install github.com/ampproject/amppackager/cmd/amppkg@latest: github.com/ampproject/[email protected]
        The go.mod file for the module providing named packages contains one or
        more replace directives. It must not contain directives that would cause
        it to be interpreted differently than if it were the main module.

So, I guess replace has been replaced...

@twifkak twifkak added the fixit label Feb 18, 2021
@twifkak twifkak added this to the v3: b3 + local transforms milestone Feb 18, 2021
@mjroeleveld
Copy link
Author

Hi @twifkak, thanks for the reply. I'll be using a binary I still have in a cached Docker image in the meantime.

@banaag
Copy link
Collaborator

banaag commented Feb 23, 2021

@joachimroeleveld I have opened issue #495 to update the build instructions for Go 1.16 and higher. This should help solve the issue you ran into in this bug. I will keep #494 open to track updating our dependencies for WICG certurl.CertChainItem. Thanks again for reporting the issue.

@twifkak
Copy link
Member

twifkak commented Feb 24, 2021

Just a quick note that #494 also includes updating our go.mod to support go install @latest (if possible).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants