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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing .PHONY target #528

Merged
merged 1 commit into from
Oct 9, 2023
Merged

Conversation

marckhouzam
Copy link
Contributor

What this PR does / why we need it

Add a .PHONY make target for plugin-build-local to avoid risk of make plugin-build-local causing plugin-build-% to be tirggered.

Which issue(s) this PR fixes

Fixes #527

Describe testing done for PR

Before this PR.
First remove the extra TAB in plugin-tooling.mk

$ PLUGIN_NAME=builder make plugin-build-local
/Users/kmarc/git/tanzu-cli/bin/builder plugin build \
		--path ./cmd/plugin \
		--binary-artifacts /Users/kmarc/git/tanzu-cli/artifacts/plugins \
		--version v1.1.0-dev \
		--ldflags "-X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Date=2023-10-08' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.SHA=faae59672-dirty' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Version=v1.1.0-dev'" \
		--goflags "" \
		--os-arch darwin_arm64 \
		--match "builder" \
		--plugin-scope-association-file ./cmd/plugin/plugin-scope-association.yaml
2023-10-08T15:59:16-04:00 [i] building local repository at /Users/kmarc/git/tanzu-cli/artifacts/plugins, v1.1.0-dev, [darwin_arm64]
2023-10-08T15:59:16-04:00 [i] 馃惌 - building plugin at path "cmd/plugin/builder"
2023-10-08T15:59:18-04:00 [i] 馃惌 - $ /Users/kmarc/.asdf/shims/go build -o /Users/kmarc/git/tanzu-cli/artifacts/plugins/darwin/arm64/global/builder/v1.1.0-dev/tanzu-builder-darwin_arm64 -ldflags -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Date=2023-10-08' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.SHA=faae59672-dirty' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Version=v1.1.0-dev' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Version=v1.1.0-dev' -tags  ./cmd/plugin/builder
2023-10-08T15:59:19-04:00 [i] ========
2023-10-08T15:59:19-04:00 [i] saving plugin manifest...
2023-10-08T15:59:19-04:00 [i] saving plugin group manifest...
2023-10-08T15:59:19-04:00 [ok] successfully built local repository
/Users/kmarc/git/tanzu-cli/bin/builder plugin build \
		--path ./cmd/plugin \
		--binary-artifacts /Users/kmarc/git/tanzu-cli/artifacts/plugins \
		--version v1.1.0-dev \
		--ldflags "-X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Date=2023-10-08' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.SHA=faae59672-dirty' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Version=v1.1.0-dev'" \
		--goflags "" \
		--os-arch local_ \
		--match "builder" \
		--plugin-scope-association-file ./cmd/plugin/plugin-scope-association.yaml
2023-10-08T15:59:19-04:00 [i] building local repository at /Users/kmarc/git/tanzu-cli/artifacts/plugins, v1.1.0-dev, [local_]
2023-10-08T15:59:19-04:00 [i] 馃惍 - building plugin at path "cmd/plugin/builder"
2023-10-08T15:59:21-04:00 [x] "local_" build architecture is not supported
2023-10-08T15:59:21-04:00 [i] ========
2023-10-08T15:59:21-04:00 [i] saving plugin manifest...
Error: open /Users/kmarc/git/tanzu-cli/artifacts/plugins/local/plugin_manifest.yaml: no such file or directory
2023-10-08T15:59:21-04:00 [x] : open /Users/kmarc/git/tanzu-cli/artifacts/plugins/local/plugin_manifest.yaml: no such file or directory
make: *** [plugin-build-local] Error 1

Notice the extra attempt at building using the invalid local_ os-arch.

With this PR (which also removes the extra TAB)

$ PLUGIN_NAME=builder make plugin-build-local
/Users/kmarc/git/tanzu-cli/bin/builder plugin build \
		--path ./cmd/plugin \
		--binary-artifacts /Users/kmarc/git/tanzu-cli/artifacts/plugins \
		--version v1.1.0-dev \
		--ldflags "-X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Date=2023-10-08' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.SHA=faae59672-dirty' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Version=v1.1.0-dev'" \
		--goflags "" \
		--os-arch darwin_arm64 \
		--match "builder" \
		--plugin-scope-association-file ./cmd/plugin/plugin-scope-association.yaml
2023-10-08T15:59:51-04:00 [i] building local repository at /Users/kmarc/git/tanzu-cli/artifacts/plugins, v1.1.0-dev, [darwin_arm64]
2023-10-08T15:59:51-04:00 [i] 馃惣 - building plugin at path "cmd/plugin/builder"
2023-10-08T15:59:53-04:00 [i] 馃惣 - $ /Users/kmarc/.asdf/shims/go build -o /Users/kmarc/git/tanzu-cli/artifacts/plugins/darwin/arm64/global/builder/v1.1.0-dev/tanzu-builder-darwin_arm64 -ldflags -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Date=2023-10-08' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.SHA=faae59672-dirty' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Version=v1.1.0-dev' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Version=v1.1.0-dev' -tags  ./cmd/plugin/builder
2023-10-08T15:59:54-04:00 [i] ========
2023-10-08T15:59:54-04:00 [i] saving plugin manifest...
2023-10-08T15:59:54-04:00 [i] saving plugin group manifest...
2023-10-08T15:59:54-04:00 [ok] successfully built local repository

Only the single local build is performed as expected.

Release note

Fix missing target in `plugin-tooling.mk` file

Additional information

Special notes for your reviewer

Signed-off-by: Marc Khouzam <kmarc@vmware.com>
@marckhouzam marckhouzam requested a review from a team as a code owner October 8, 2023 22:45
Copy link
Contributor

@vuil vuil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@marckhouzam marckhouzam merged commit 8600df1 into vmware-tanzu:main Oct 9, 2023
7 checks passed
@marckhouzam marckhouzam deleted the fix/phony branch October 9, 2023 19:39
@marckhouzam marckhouzam added this to the 1.1.0 milestone Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing .PHONY target in plugin-tooling.mk
3 participants