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

enable building without varlink tag #6353

Merged

Conversation

lsm5
Copy link
Member

@lsm5 lsm5 commented May 22, 2020

default build without varlink tag

Issue gh#6286 was already fixed in a prior commit but the Makefile still
ran some varlink steps by default.

This commit makes any varlink build steps dependent on the varlink
build tag and also makes the contrib rpm spec file independent of
varlink.

Signed-off-by: Lokesh Mandvekar lsm5@fedoraproject.org

@lsm5 lsm5 added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 22, 2020
@lsm5 lsm5 linked an issue May 22, 2020 that may be closed by this pull request
@rh-atomic-bot
Copy link
Collaborator

☔ The latest upstream changes (presumably #6341) made this pull request unmergeable. Please resolve the merge conflicts.

@lsm5 lsm5 force-pushed the build-without-varlink branch 3 times, most recently from e4e49cb to 312d2b6 Compare May 24, 2020 09:44
@lsm5 lsm5 changed the title [do-not-merge] WIP - enable building without varlink tag enable building without varlink tag May 24, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 24, 2020
@lsm5 lsm5 force-pushed the build-without-varlink branch 5 times, most recently from 06f289d to de29580 Compare May 24, 2020 13:03
@lsm5 lsm5 changed the title enable building without varlink tag [DO NOT MERGE] enable building without varlink tag May 24, 2020
@lsm5 lsm5 added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 24, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 24, 2020
@lsm5 lsm5 force-pushed the build-without-varlink branch 4 times, most recently from cf63127 to 1f802a2 Compare May 28, 2020 17:56
@lsm5 lsm5 changed the title [DO NOT MERGE] enable building without varlink tag enable building without varlink tag May 28, 2020
Copy link
Collaborator

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

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

Really nice work. Just one question.

.PHONY: varlink_generate
ifneq (or $(findstring varlink,$(BUILDTAGS)),$(findstring varlink,$(BUILD_TAGS)))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm super rusty on Makefile magic, but this doesn't look right to me. Are you looking for varlink in either of those two variables? If so would this work?

ifneq (,$(findstring varlink,$(BUILDTAGS) $(BUILD_TAGS)))

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, I'm looking for varlink in those two. I'll give that a try, thanks!

Copy link
Member Author

Choose a reason for hiding this comment

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

there seems to be some integration test issues that I'm looking into as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

make lint fails with:

# $BUILD_TAGS variable is used in hack/golangci-lint.sh
 .PHONY: varlink_generate
-ifneq (or $(findstring varlink,$(BUILDTAGS)),$(findstring varlink,$(BUILD_TAGS)))
+ifneq (,$(findstring varlink,$(BUILD_TAGS) $(BUILDTAGS)))
 varlink_generate: .gopathok pkg/varlink/iopodman.go ## Generate varlink
 else
 varlink_generate:

Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably some magic syntax detail I'm missing.

Well, does the or format work? If you run make with varlink in either variable, does it trigger the desired varlink_generate?

Copy link
Member Author

Choose a reason for hiding this comment

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

The or format works well for make lint. I don't need to specify varlink buildtag for tunnel and abi as it will automatically use it from the golangci-lint.sh file. Both make and `make BUILDTAGS='varlink' work correctly as well.

Copy link
Collaborator

Choose a reason for hiding this comment

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

OK - sorry to have muddled things. LGTM, thanks.

Copy link
Member Author

Choose a reason for hiding this comment

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

btw, what you suggested I think should work as well, which is what seems to be suggested in the official make doc, but for whatever reason it doesn't seem to work in this case. Maybe more eyes would help..

@lsm5
Copy link
Member Author

lsm5 commented May 28, 2020

Btw, I guess in the default case, it will now skip varlink build and tests. Let me know if CI needs to continue testing for the varlink case as well.

@edsantiago
Copy link
Collaborator

Hmmm. CI is not happy, and it doesn't look (at first glance) like a flake:

[+0179s] # github.com/containers/libpod/test/endpoint [github.com/containers/libpod/test/endpoint.test]
[+0179s] test/endpoint/config.go:10: undefined: ALPINE
[+0179s] test/endpoint/setup.go:19: undefined: EndpointTestIntegration
[+0179s] test/endpoint/setup.go:102: undefined: EndpointTestIntegration
[+0179s] test/endpoint/setup.go:120: undefined: EndpointTestIntegration
[+0179s] test/endpoint/setup.go:129: undefined: EndpointTestIntegration
[+0179s] test/endpoint/setup.go:136: undefined: EndpointTestIntegration
[+0179s] test/endpoint/setup.go:144: undefined: EndpointTestIntegration
[+0179s] test/endpoint/setup.go:176: undefined: EndpointTestIntegration
[+0179s] test/endpoint/setup.go:185: undefined: EndpointTestIntegration
[+0179s] test/endpoint/setup.go:195: undefined: EndpointTestIntegration
[+0179s] test/endpoint/config.go:10: too many errors

@lsm5
Copy link
Member Author

lsm5 commented May 28, 2020

Hmmm. CI is not happy, and it doesn't look (at first glance) like a flake:

[+0179s] # github.com/containers/libpod/test/endpoint [github.com/containers/libpod/test/endpoint.test]
[+0179s] test/endpoint/config.go:10: undefined: ALPINE
[+0179s] test/endpoint/setup.go:19: undefined: EndpointTestIntegration
[+0179s] test/endpoint/setup.go:102: undefined: EndpointTestIntegration
[+0179s] test/endpoint/setup.go:120: undefined: EndpointTestIntegration
[+0179s] test/endpoint/setup.go:129: undefined: EndpointTestIntegration
[+0179s] test/endpoint/setup.go:136: undefined: EndpointTestIntegration
[+0179s] test/endpoint/setup.go:144: undefined: EndpointTestIntegration
[+0179s] test/endpoint/setup.go:176: undefined: EndpointTestIntegration
[+0179s] test/endpoint/setup.go:185: undefined: EndpointTestIntegration
[+0179s] test/endpoint/setup.go:195: undefined: EndpointTestIntegration
[+0179s] test/endpoint/config.go:10: too many errors

err, yes that's a consequence of me wrapping test/endpoint/endpoint.go inside varlink buildtag.

Could someone please let me know if test/endpoint is a varlink-specific thing? Or if I should split out the varlink specific stuff in separate files?

@edsantiago
Copy link
Collaborator

if test/endpoint is a varlink-specific thing?

There is no way I can answer that but I'm going to jump in anyway: a quick ack -i varlink test/endpoint/ produces so many hits that I have to assume it is.

@lsm5 lsm5 force-pushed the build-without-varlink branch 4 times, most recently from 68cfda3 to e385635 Compare May 29, 2020 14:18
@lsm5
Copy link
Member Author

lsm5 commented May 29, 2020

I added conditional to skip endpoint tests if no varlink buildtag found.

@lsm5 lsm5 force-pushed the build-without-varlink branch 2 times, most recently from 554652b to cde93cd Compare May 29, 2020 14:44
Issue gh#6286 was already fixed in a prior commit but the Makefile still
ran some varlink steps by default.

This commit makes any varlink build steps dependent on the varlink
build tag and also makes the contrib rpm spec file independent of
varlink.

Endpoint tests will be run only if BUILDTAGS contains varlink.

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
@edsantiago
Copy link
Collaborator

LGTM

@rhatdan
Copy link
Member

rhatdan commented Jun 1, 2020

It would be nice to split out the varlink code into a separate Makefile.Varlink. And then optionally include it if necessary. That might cleanup the Makefile.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 1, 2020
@rhatdan
Copy link
Member

rhatdan commented Jun 1, 2020

/approve

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lsm5, rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 1, 2020
@openshift-merge-robot openshift-merge-robot merged commit 22713d6 into containers:master Jun 1, 2020
@lsm5 lsm5 deleted the build-without-varlink branch June 1, 2020 19:56
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

make error - undefined: varlinkapi.New
6 participants