Commit Graph

6 Commits

Author SHA1 Message Date
Sebastiaan van Stijn 6f7a931a2d
[20.10] use GO_LDFLAGS instead of LDFLAGS to prevent inheriting unrelated options
When building on Fedora 36, the build failed. I suspect this is because the
rpm tools also set LDFLAGS, but with options that cannot be used;

    GO_LINKMODE=dynamic
    + ./scripts/build/binary
      /go/src/github.com/docker/cli ~/rpmbuild/BUILD/src
      Building dynamic docker-linux-arm64
      + go build -o build/docker-linux-arm64 -tags ' pkcs11' -ldflags '-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -Wl,-dT,/root/rpmbuild/BUILD/src/.package_note-docker-ce-cli-0.0.0.20220330082637.68cad50-0.fc36.aarch64.ld -w -X "github.com/docker/cli/cli/version.GitCommit=68cad50" -X "github.com/docker/cli/cli/version.BuildTime=2022-03-30T20:05:36Z" -X "github.com/docker/cli/cli/version.Version=0.0.0-20220330082637-68cad50" -X "github.com/docker/cli/cli/version.PlatformName=Docker Engine - Community"' -buildmode=pie github.com/docker/cli/cmd/docker
    # github.com/docker/cli/cmd/docker
    flag provided but not defined: -Wl,-z,relro
    usage: link [options] main.o

This patch changes the variable we use to `GO_LDFLAGS`, taking a similar approach
as containerd, and various other projects using this name: https://grep.app/search?q=GO_LDFLAGS

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 391e6ad944)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-31 14:12:25 +02:00
Paul Mulders 05eebb8ccf scripts/make.ps1: actually define the CommitSuffix parameter
Signed-off-by: Paul Mulders <justinkb@gmail.com>
2020-07-10 14:36:22 +02:00
Arthur e5c86dbcf3 Forcing the creation of tmp directory so that build doesn't fail when it already exists
Signed-off-by: Arthur Peka <arthur.peka@outlook.com>
2019-05-12 21:09:07 +03:00
Stefan Scherer 69754ea952
Fix Windows LDFLAGS to use cli version package
Signed-off-by: Stefan Scherer <stefan.scherer@docker.com>
2019-03-20 15:33:17 -07:00
Vincent Demeester 10baa756b2
Remove unused powershell function
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-03-07 18:18:14 +01:00
Vincent Demeester facb22573d
Add appveyor setup to build and unit test
Adds a `make.ps1` powershell script to make it easy to compile and test.

```
.\scripts\make.ps1 -Binary
INFO: make.ps1 starting at 03/01/2018 14:37:28
INFO: Building...

 ________   ____  __.
 \_____  \ |    |/ _|
 /   |   \|      <
 /    |    \    |  \
 \_______  /____|__ \
         \/        \/

INFO: make.ps1 ended at 03/01/2018 14:37:30

.\scripts\make.ps1 -TestUnit
```

The next step is to run e2e tests on windows too.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-03-07 18:14:10 +01:00