-
Notifications
You must be signed in to change notification settings - Fork 68
Modify the golang.mk to support go modules #74
Conversation
@soorena776 I like the direction, but I have to admit I'm fairly ignorant around how Go modules work (and also pretty bad at |
Prior art: #63 |
@negz Sorry about not providing an intro earlier! Please read below:
Since other projects are still using |
78e6950
to
c4752a3
Compare
I don't think its ideal to have two |
@bassam I can definitely combine this with the current one. The only concern there is if other repositories still want to stick with |
@bassam modified the existing |
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.
There was some work done on this in #63 that addressed modules and maintained support for dep as well. Do you believe it is insufficient for this issue? If you want to sync up on anything I did there feel free to let me know! Thanks for driving this :)
@hasheddan Thanks for the pointer to #63. I wasn't aware of this effort (my bad in not searching existing related work) when I started this. The main difference seems to be that you tried to maintain the support for
Please let me know what you think |
I'm not sure we can switch all projects using this project all together. It might be prudent to leave |
@bassam I agree, and that is why I initially created a separate file. |
I took a quick look at the diff and I'm not sure its that bad to support go modules and dep. I think you can contain the changes in different flavors of targets and using variables for command line switches. I worry about the two file approach. I think it will be a a while before everyone switches to go modules, and that in the meantime we have two files to maintain. |
265bb7f
to
de6fd80
Compare
de6fd80
to
f8bd82d
Compare
c2bf4c2
to
7b2e1e3
Compare
b505f63
to
e7aa21b
Compare
makelib/kubebuilder.mk
Outdated
@cd $(TOOLS_HOST_DIR)/tmp-controllergen; GOPATH=$(abspath $(GO_PKG_DIR)) GO111MODULE=on GOBIN=$(TOOLS_HOST_DIR) $(GOHOST) get sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_GEN_VERSION) || $(FAIL) | ||
@rm -fr $(TOOLS_HOST_DIR)/tmp-controllergen | ||
|
||
@$(OK) installing controller-gen @$(CONTROLLER_GEN_VERSION) |
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.
can you not use the same @GO111MODULE=off
approach as in golang.mk?
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.
No, as the comment above mentions versioned go packages do need GO111MODULE=on
.
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.
I thought about downloading the binary directly, but there is no binary distribution for this tool: https://github.com/kubernetes-sigs/controller-tools/releases/tag/v0.2.1
so we do need to build the go src and install it, by using go get
ec7ebe5
to
106ac5d
Compare
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.
Would be good to test this for Multiplatform builds (try make build.all)
@bassam tested on jenkins for: using go modules: |
Signed-off-by: soorena776 <[email protected]>
Signed-off-by: soorena776 <[email protected]>
b169d16
to
f6742d7
Compare
Signed-off-by: soorena776 <[email protected]>
f6742d7
to
e9e0aa4
Compare
awesome, thank you for working through everything to make this a complete and robust solution @soorena776! |
Signed-off-by: soorena776 [email protected]