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

cmd/go: report trimpath erasing ldflags, and allow override #67072

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Apr 30, 2024

  1. cmd/go: report trimpath erasing ldflags, and allow override

    Add a new boolean option -trimldflags. Only meaningful when -trimpath
    is true. Defaults to true for backwards compatibility. Otheriwise when
    set to false reports ldflags in buildinfo, in spite of -trimpath
    setting. Also when ldflags are trimmed from the output, leave a
    reproducible marker that it happened.
    
    Building with '-trimpath -ldflags="-X main.Version=234"' will now emit:
    	build	-trimldflags=true
    
    Adding -trimldflags=false to the above will emit ldflags:
    	build	-ldflags="-X main.Version=234"
    
    Fixes: golang#63432
    
    Change-Id: I47d633ef0e6a90136799bef9701b7ff22c92f095
    GitHub-Pull-Request: golang#67072
    xnox committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    0355b6a View commit details
    Browse the repository at this point in the history