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

Remove conflicting STATIC variable from build #28151

Merged
merged 1 commit into from Oct 21, 2020

Conversation

howardjohn
Copy link
Member

@howardjohn howardjohn commented Oct 21, 2020

We currently set STATIC=0 LDFLAGS='-extldflags -static -s -w' as part of the
build. This does not make much sense, since STATIC sets LDFLAGS to
empty, so we don't pass -static -s -w.

I believe we do want to pass these flags, as they were originally added
for a reason.

Binary size changes for istioctl, agent, and pilot in mb:

114 -> 81
104 -> 75
108 -> 77

Helps with #26232

[ ] Configuration Infrastructure
[ ] Docs
[ ] Installation
[ ] Networking
[ ] Performance and Scalability
[ ] Policies and Telemetry
[ ] Security
[ ] Test and Release
[ ] User Experience
[ ] Developer Infrastructure

Pull Request Attributes

Please check any characteristics that apply to this pull request.

[ ] Does not have any changes that may affect Istio users.

We currently set `STATIC=0 LDFLAGS='-extldflags -static -s -w'` as part of the
build. This does not make much sense, since STATIC sets LDFLAGS to
empty, so we don't pass `-static -s -w`.

I believe we do want to pass these flags, as they were originally added
for a reason.

Binary size changes for istioctl, agent, and pilot in mb:
```
114 -> 81
104 -> 75
108 -> 77
```

Helps with istio#26232
@howardjohn howardjohn added the release-notes-none Indicates a PR that does not require release notes. label Oct 21, 2020
@howardjohn howardjohn requested a review from a team as a code owner October 21, 2020 15:41
@google-cla google-cla bot added the cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. label Oct 21, 2020
@istio-testing istio-testing added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 21, 2020
@howardjohn
Copy link
Member Author

/retest

@ericvn
Copy link
Contributor

ericvn commented Oct 21, 2020

Possibly want to cherrypick to 1.8, or is this just an early change to get more testing for 1.9?

@istio-testing istio-testing merged commit 77988be into istio:master Oct 21, 2020
@sdake
Copy link
Member

sdake commented Oct 21, 2020

@howardjohn -

-W with no flags will strip all LDFLAGS from the compiler execution. I am not sure what the outcome is of go with this flag, however, I'd be wary of not passing any modifiers.

-s strips the binaries. I am not sure we want to strip the binaries, as debuggers would not work properly. Many systems deliver symbols independently, although I would not just strip because it was there in the past.

@sdake
Copy link
Member

sdake commented Oct 21, 2020

note man ld is the source.

@sdake
Copy link
Member

sdake commented Oct 21, 2020

fwiw, this exact set of linkage comes from stack overflow. I think its the wrong choice: https://stackoverflow.com/questions/22267189/what-does-the-w-flag-mean-when-passed-in-via-the-ldflags-option-to-the-go-comman

@nrjpoddar
Copy link
Member

nrjpoddar commented Nov 9, 2020

@howardjohn I would recommend adding comments around why these flags are important and affects on size if we remove them. @sdake concern here is valid that many Go programs ship with debug symbols to enable analysis via gdb or delve. However, I don’t know if we really need to support that specially if the binary is distributed per-workload and can lead to increased resource consumption. Some of these options can effect usage with profiling tools so we should ensure that we don’t end up losing out a lot of functionality.

@nrjpoddar
Copy link
Member

Additionally, I don’t think release notes none is correct here as it’s loss of debugging capabilities for end user. I’m not sure if anyone relies on it but it’s worth mentioning it if we decide strip off symbols.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. release-notes-none Indicates a PR that does not require release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants