From dfa9a340ad849637cdc1157f9ec13bac7d789b0e Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Tue, 2 Feb 2021 16:10:54 -0700 Subject: Makefile: make bin/* real targets! Backstory: every time you run 'make podman' or even just 'make', you get a full recompile. This is sub-ideal. Cause: I don't really know. It looks complicated. #5017 introduced a .PHONY for bin/podman, for reasons not explained in the PR. Then, much later, #5880 well- intentionedly but improperly tweaked the 'find' command used in defining SOURCES, adding a -prune but without the corresponding and required -print. Let's just say, it was an unfortunate cascade of events. This PR fixes the SOURCES definition and removes the highly-undesired .PHONY from podman & podman-remote, making it so you can type 'make' and, oh joy, not build anything if it's current. The way 'make' is supposed to work. Why fix this now? Because my PR (#9209) was failing in CI, in the Validate step: Can't exec "./bin/podman": No such file or directory at hack/xref-helpmsgs-manpages line 223. It failed even on Re-run, and only passed once I force-pushed the PR (with no changes, just a new commit SHA). I have no idea why bin/podman wasn't built, and I have zero interest in pursuing that right now, but the proper solution is to add bin/podman as a Makefile dependency for that particular test. So done. While I'm at it, fix what is pretty clearly a typo in a .PHONY And, finally, fix a go-md2man warning introduced in #9189 [NO TESTS NEEDED] Signed-off-by: Ed Santiago --- Makefile | 12 +++++++----- docs/source/markdown/podman-network-create.1.md | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 9e4ff47f4..f9674afe4 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,11 @@ PKG_MANAGER ?= $(shell command -v dnf yum|head -n1) # ~/.local/bin is not in PATH on all systems PRE_COMMIT = $(shell command -v bin/venv/bin/pre-commit ~/.local/bin/pre-commit pre-commit | head -n1) -SOURCES = $(shell find . -path './.*' -prune -o -name "*.go") +# This isn't what we actually build; it's a superset, used for target +# dependencies. Basically: all *.go files, except *_test.go, and except +# anything in a dot subdirectory. If any of these files is newer than +# our target (bin/podman{,-remote}), a rebuild is triggered. +SOURCES = $(shell find . -path './.*' -prune -o \( -name '*.go' -a ! -name '*_test.go' \) -print) BUILDFLAGS := -mod=vendor $(BUILDFLAGS) @@ -195,7 +199,6 @@ test/goecho/goecho: .gopathok $(wildcard test/goecho/*.go) $(GO) build $(BUILDFLAGS) -ldflags '$(LDFLAGS_PODMAN)' -o $@ ./test/goecho -.PHONY: bin/podman bin/podman: .gopathok $(SOURCES) go.mod go.sum ## Build with podman # Make sure to warn in case we're building without the systemd buildtag. ifeq (,$(findstring systemd,$(BUILDTAGS))) @@ -207,7 +210,6 @@ endif .PHONY: podman podman: bin/podman -.PHONY: bin/podman-remote bin/podman-remote: .gopathok $(SOURCES) go.mod go.sum ## Build with podman on remote environment $(GO) build $(BUILDFLAGS) -gcflags '$(GCFLAGS)' -asmflags '$(ASMFLAGS)' -ldflags '$(LDFLAGS_PODMAN)' -tags "${REMOTETAGS}" -o $@ ./cmd/podman @@ -390,7 +392,7 @@ MANPAGES_DEST ?= $(subst markdown,man, $(subst source,build,$(MANPAGES))) $(MANPAGES): %: %.md .install.md2man docdir @sed -e 's/\((podman.*\.md)\)//' -e 's/\[\(podman.*\)\]/\1/' -e 's;<\(/\)\?\(a[^>]*\|sup\)>;;g' $< | $(GOMD2MAN) -in /dev/stdin -out $(subst source/markdown,build/man,$@) -.PHONY: docs +.PHONY: docdir docdir: mkdir -p docs/build/man @@ -404,7 +406,7 @@ install-podman-remote-%-docs: podman-remote docs $(MANPAGES) docs/remote-docs.sh $* docs/build/remote/$* $(if $(findstring windows,$*),docs/source/markdown,docs/build/man) .PHONY: man-page-check -man-page-check: +man-page-check: bin/podman hack/man-page-checker hack/xref-helpmsgs-manpages diff --git a/docs/source/markdown/podman-network-create.1.md b/docs/source/markdown/podman-network-create.1.md index 86b15162a..3d5d98055 100644 --- a/docs/source/markdown/podman-network-create.1.md +++ b/docs/source/markdown/podman-network-create.1.md @@ -9,7 +9,7 @@ podman\-network-create - Create a Podman CNI network ## DESCRIPTION Create a CNI-network configuration for use with Podman. By default, Podman creates a bridge connection. A *Macvlan* connection can be created with the *-d macvlan* option. A parent device for macvlan can -be designated with the *-o parent=* option. In the case of *Macvlan* connections, the +be designated with the *-o parent=\* option. In the case of *Macvlan* connections, the CNI *dhcp* plugin needs to be activated or the container image must have a DHCP client to interact with the host network's DHCP server. -- cgit v1.2.3-54-g00ecf