-
Notifications
You must be signed in to change notification settings - Fork 921
Build Windows binary #2443
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
Open
mattn
wants to merge
3
commits into
containers:main
Choose a base branch
from
mattn:windows
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+12
−7
Open
Build Windows binary #2443
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,16 +21,16 @@ FISHINSTALLDIR=${PREFIX}/share/fish/vendor_completions.d | |
|
|
||
| GO ?= go | ||
| GOBIN := $(shell $(GO) env GOBIN) | ||
| GOOS ?= $(shell go env GOOS) | ||
| GOARCH ?= $(shell go env GOARCH) | ||
| GOOS ?= $(shell $(GO) env GOOS) | ||
| GOARCH ?= $(shell $(GO) env GOARCH) | ||
|
|
||
| # N/B: This value is managed by Renovate, manual changes are | ||
| # possible, as long as they don't disturb the formatting | ||
| # (i.e. DO NOT ADD A 'v' prefix!) | ||
| GOLANGCI_LINT_VERSION := 1.61.0 | ||
|
|
||
| ifeq ($(GOBIN),) | ||
| GOBIN := $(GOPATH)/bin | ||
| GOBIN := $(subst \,/,$(shell $(GO) env GOPATH))/bin | ||
| endif | ||
|
|
||
| # Scripts may also use CONTAINER_RUNTIME, so we need to export it. | ||
|
|
@@ -99,11 +99,16 @@ ifeq ($(DISABLE_CGO), 1) | |
| override BUILDTAGS = exclude_graphdriver_btrfs containers_image_openpgp | ||
| endif | ||
|
|
||
| BIN=bin/skopeo | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Naming this something a bit more explicit would help. There are quite a few other instances of |
||
| ifeq ($(OS),Windows_NT) | ||
| BIN := $(BIN).exe | ||
| endif | ||
|
|
||
| # make all DEBUG=1 | ||
| # Note: Uses the -N -l go compiler options to disable compiler optimizations | ||
| # and inlining. Using these build options allows you to subsequently | ||
| # use source debugging tools like delve. | ||
| all: bin/skopeo docs | ||
| all: $(BIN) docs | ||
|
|
||
| codespell: | ||
| codespell -S Makefile,build,buildah,buildah.spec,imgtype,copy,AUTHORS,bin,vendor,.git,go.sum,CHANGELOG.md,changelog.txt,seccomp.json,.cirrus.yml,"*.xz,*.gz,*.tar,*.tgz,*ico,*.png,*.1,*.5,*.orig,*.rej" -L fpr,uint,iff,od,ERRO -w | ||
|
|
@@ -129,16 +134,16 @@ binary: cmd/skopeo | |
| $(CONTAINER_RUN) make bin/skopeo $(if $(DEBUG),DEBUG=$(DEBUG)) BUILDTAGS='$(BUILDTAGS)' | ||
|
|
||
| # Build w/o using containers | ||
| .PHONY: bin/skopeo | ||
| bin/skopeo: | ||
| .PHONY: $(BIN) | ||
| $(BIN): | ||
| $(GO) build ${GO_DYN_FLAGS} ${SKOPEO_LDFLAGS} -gcflags "$(GOGCFLAGS)" -tags "$(BUILDTAGS)" -o $@ ./cmd/skopeo | ||
| bin/skopeo.%: | ||
| GOOS=$(word 2,$(subst ., ,$@)) GOARCH=$(word 3,$(subst ., ,$@)) $(GO) build ${SKOPEO_LDFLAGS} -tags "containers_image_openpgp $(BUILDTAGS)" -o $@ ./cmd/skopeo | ||
| local-cross: bin/skopeo.darwin.amd64 bin/skopeo.linux.arm bin/skopeo.linux.arm64 bin/skopeo.windows.386.exe bin/skopeo.windows.amd64.exe | ||
|
|
||
| $(MANPAGES): %: %.md | ||
| ifneq ($(DISABLE_DOCS), 1) | ||
| sed -e 's/\((skopeo.*\.md)\)//' -e 's/\[\(skopeo.*\)\]/\1/' $< | $(GOMD2MAN) -in /dev/stdin -out $@ | ||
| sed -e 's/\((skopeo.*\.md)\)//' -e 's/\[\(skopeo.*\)\]/\1/' $< | $(GOMD2MAN) -out $@ | ||
| endif | ||
|
|
||
| docs: $(MANPAGES) | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is surprising to me.
makedoesn’t like native-style paths? Which implementation is this?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Windows, GOPATH include backslash not slash.