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

Update Golang to 1.12.1 #11330

Merged
merged 6 commits into from
Apr 9, 2019
Merged

Update Golang to 1.12.1 #11330

merged 6 commits into from
Apr 9, 2019

Conversation

kvch
Copy link
Contributor

@kvch kvch commented Mar 20, 2019

Changes in 1.12: https://golang.org/doc/go1.12
Changes in minor release: https://github.com/golang/go/issues?q=milestone%3AGo1.12.1

Updated vendored packages:

  • github.com/tsg/gopacket/pcap
  • github.com/docker/docker/pkg/*
  • github.com/docker/go-connections

New vendored packages (as required by dependencies):

  • github.com/konsorten/go-windows-terminal-sequences

Removed vendored package:

  • github.com/Sirupsen/logrus: github.com/sirupsen/logrus is used and it leads to a case insensitive collision, required by docker dependencies

TODO

  • use documented Cgo types in github.com/tsg/gopacket/pcap Cgo changes
  • fix recovering from panic in logp

Possibly interesting PR to devs @elastic/apm-server

@ruflin
Copy link
Member

ruflin commented Mar 20, 2019

Went through the changelog and also stumbled over TLS changes: https://golang.org/doc/go1.12 @ph I don't think it will have an affect but you should double check.

Overall +1 on going to 1.12.

@kvch
Copy link
Contributor Author

kvch commented Mar 20, 2019

@ruflin I would like to add support for TLS 1.3

@@ -1,4 +1,4 @@
FROM golang:1.10.3
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ruflin Do you know why the version of Golang differed from other Beats versions? Is it ok to update it?
I haven't seen any related failures yet.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is odd, all Beats should be in sync :-( I assume this had only an affect on testing and not packaging, meaning in 7.0 all Beats are packaged with the same Golang version.

Please update, I assume we missed it in the last Golang update.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was downgraded here: https://github.com/elastic/beats/pull/9242/files#diff-69f23758930df5eda4eeb23437b8a2ccR1

It seems like an accidental change. Or at least I haven't seen any reasoning why it was done.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kvch Thanks for investigation. @sayden I left a comment on the old PR, I wonder if any of these changes should have happened there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably was a merge gone bad.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sayden Can you please open a PR with reverting to the old Dockerfile?

@kvch kvch added the review label Mar 21, 2019
@kvch kvch marked this pull request as ready for review March 21, 2019 09:50
@kvch kvch requested review from a team as code owners March 21, 2019 09:51
@kvch kvch requested review from andrewkroh, ruflin and ph and removed request for a team March 21, 2019 09:52
@ph
Copy link
Contributor

ph commented Mar 21, 2019

We might want to look at using this:

The compiler now accepts a -lang flag to set the Go language version to use. For example, -lang=go1.8 causes the compiler to emit an error if the program uses type aliases, which were added in Go 1.9. Language changes made before Go 1.12 are not consistently enforced. 

@ph
Copy link
Contributor

ph commented Mar 21, 2019

On Linux, the runtime now uses MADV_FREE to release unused memory. This is more efficient but may result in higher reported RSS. The kernel will reclaim the unused data when it is needed. To revert to the Go 1.11 behavior (MADV_DONTNEED), set the environment variable GODEBUG=madvdontneed=1.

Something to keep in mind on SDH

@ph ph added the :Packaging label Mar 21, 2019
libbeat/logp/core_test.go Outdated Show resolved Hide resolved
@ph
Copy link
Contributor

ph commented Mar 21, 2019

Looking at the TLSv1.3, from my understanding you need to opt-in via an environment variables, not sure if can force it via a TLSConfig.

@graphaelli
Copy link
Member

While it hasn't been kept up so far, should the various golang.org/x packages be kept in sync with this update too? These are currently vendored:

golang.org/x/net/bpf@release-branch.go1.9
golang.org/x/net/context@release-branch.go1.9
golang.org/x/net/context/ctxhttp@release-branch.go1.9
golang.org/x/net/http2@release-branch.go1.9
golang.org/x/net/http2/hpack@release-branch.go1.9
golang.org/x/net/icmp@release-branch.go1.9
golang.org/x/net/internal/iana@release-branch.go1.9
golang.org/x/net/ipv4@release-branch.go1.9
golang.org/x/net/ipv6@release-branch.go1.9
golang.org/x/net/lex/httplex@release-branch.go1.9
golang.org/x/net/proxy@release-branch.go1.9
golang.org/x/net/publicsuffix@release-branch.go1.9
golang.org/x/tools/cmd/goimports@release-branch.go1.10
golang.org/x/tools/go/ast/astutil@release-branch.go1.10
golang.org/x/tools/go/buildutil@release-branch.go1.9
golang.org/x/tools/go/loader@release-branch.go1.9
golang.org/x/tools/imports@release-branch.go1.10
golang.org/x/tools/internal/fastwalk@release-branch.go1.10
golang.org/x/tools/internal/gopathwalk@release-branch.go1.10

@ph
Copy link
Contributor

ph commented Mar 21, 2019

@graphaelli correct, I think we were just updating them as needed or when a bug was detected (mostly following what ain't broke don't fix it..). I think we should clarify that strategy and I would be +1 to keep them in sync. Wdyt @ruflin?

@kvch kvch added the in progress Pull request is currently in progress. label Mar 21, 2019
@kvch
Copy link
Contributor Author

kvch commented Mar 21, 2019

@ph We could document that adding the environment variable lets you use TLSv3. But it's not so user friendly. Or we could add the feature regardless and release it officially when we update Go to 1.13. :D

@graphaelli @ph 👍 for keeping these packages in sync

@kvch kvch force-pushed the update-golang-to-1.12.1 branch 3 times, most recently from 1c6f729 to 8c451b8 Compare March 21, 2019 16:49
@ruflin
Copy link
Member

ruflin commented Mar 22, 2019

+1 to keep the libs in sync.

@@ -170,7 +170,7 @@ type InterfaceAddress struct {
// BPF is a compiled filter program, useful for offline packet matching.
type BPF struct {
orig string
bpf _Ctype_struct_bpf_program // takes a finalizer, not overriden by outsiders
bpf C.struct_bpf_program // takes a finalizer, not overriden by outsiders
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really familiar with this change. @tsg could you have a look?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

He merged the PR in his own repo. So he already accepted it. :)


// This binary tests that PCAP packet capture is working correctly by issuing
// HTTP requests, then making sure we actually capture data off the wire.
package main
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the removal of this file related to 1.12.1?

Copy link
Contributor Author

@kvch kvch Mar 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was removed by govendor when I ran fetch. I thought it was removed from the original repo... But now I see that it's still there. Let me look into why the tool got rid of this file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason could be that its package main. My first gest was that it's a test file, but it's a script.

@ruflin
Copy link
Member

ruflin commented Mar 25, 2019

CI Failure looks related.

@kvch kvch removed the in progress Pull request is currently in progress. label Apr 9, 2019
@kvch kvch merged commit 0c1d247 into elastic:master Apr 9, 2019
@jsoriano jsoriano mentioned this pull request Apr 15, 2019
@jordansissel
Copy link
Contributor

Can this be backported into backport into 7.0/7.x? I only see it in master. (Context: I ran into this tonight)

DStape pushed a commit to DStape/beats that referenced this pull request Aug 20, 2019
Changes in 1.12: https://golang.org/doc/go1.12
Changes in minor release: https://github.com/golang/go/issues?q=milestone%3AGo1.12.1

Updated vendored packages:
- `github.com/tsg/gopacket/pcap`
- `github.com/docker/docker/pkg/*`
- `github.com/docker/go-connections`

New vendored packages (as required by dependencies):
- `github.com/konsorten/go-windows-terminal-sequences`

Removed vendored package:
- `github.com/Sirupsen/logrus`: `github.com/sirupsen/logrus` is used and it leads to a case insensitive collision, required by docker dependencies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants