Skip to content

Conversation

@paulfantom
Copy link
Contributor

Can I interest you in a Makefile? 😄

This is just something on top of which you could start building.

/CC: @sallyom @wking

@openshift-ci-robot openshift-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 1, 2018
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: paulfantom
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: abhinavdahiya

If they are not already assigned, you can assign the PR to them by writing /assign @abhinavdahiya in a comment when ready.

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

The pull request process is described here

Details 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

@rajatchopra
Copy link

FWIW, I created my own local Makefile to allow me to feed my habit of typing make for a build - so there is a set of people who will find it useful.
And the code here lgtm.

@crawford
Copy link
Contributor

crawford commented Oct 1, 2018

The help target is clever. I don't see the need for yet another way to trigger the build though. I'd rather we just stick to scripts since Go and Make really do not get along.

@paulfantom
Copy link
Contributor Author

That's why I just wrapped scripts into one Makefile and not used any go <sth> command. It just gives you one, unified way to execute those scripts.

Copy link
Member

@wking wking left a comment

Choose a reason for hiding this comment

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

I'm fine without a Makefile, but I agree that folks will generally expect something like this, and I don't expect it to be too hard to maintain, so I'm ok going ahead with this PR too.

Makefile Outdated
Copy link
Member

Choose a reason for hiding this comment

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

I'd rather this be a .PHONY bin/terraform, so the target matches the output, with .PHONY because we aren't declaring the upstream dependencies.

.PHONY: bin/terraform
bin/terraform:
  hack/get-terraform.sh

Pretty much everything in here is .PHONY. I'm fine if you want to have a single entry at the end too:

.PHONY: \
  bin/openshift-install \
  bin/terraform \
  help \
  etc \
  etc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For some stupid reason I had .PHONY everywhere and deleted it.

Makefile Outdated
Copy link
Member

Choose a reason for hiding this comment

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

Same as for the Terraform target, I'd rather this matched the name of the file being created. In this case, it's bin/openshift-install. And once you match, you'll need a .PHONY entry, because we aren't telling make about the Go dependencies.

Makefile Outdated
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't mass my personal "utility outweighs complexity" threshold, although other maintainers may feel differently. Can we just do something like this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I kinda like it. By writing one thing you automatically get two:

  • code comments
  • runtime help

So no need to maintain a part of Makefile responsible for help target.

Copy link
Member

@wking wking Oct 2, 2018

Choose a reason for hiding this comment

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

By writing one thing you automatically get two:

  • code comments
  • runtime help

Runtime help is useful for users who don't read Makefile. I don't think the comment role is important though, especially with a Makefile as short and simple as this.

A hard-coded approach to help is also harder to get wrong (e.g. this, I think?). And you'll have to expand your regexp to allow slashes for bin/terraform.

I also don't know how portable your ANSI color escapes are (e.g. does Windows' stock terminal support them?). I'd rather drop the terminal escapes.

But if you're really committed, I'll /lgtm this approach ;).

Makefile Outdated
Copy link
Member

Choose a reason for hiding this comment

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

This should be over ./pkg/.... Otherwise this looks good; why comment it out?

@crawford
Copy link
Contributor

crawford commented Oct 1, 2018

Can you also format your commit message properly? Take a look at the git history to see the general format we follow. I would use build: as the scope for this one.

@openshift-ci-robot openshift-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 2, 2018
@paulfantom
Copy link
Contributor Author

Fixed.

@frobware
Copy link

frobware commented Oct 2, 2018

The help target is clever. I don't see the need for yet another way to trigger the build though. I'd rather we just stick to scripts since Go and Make really do not get along.

From various places I find it easier to do make .... I don't normally care how that is make target is implemented; the Makefile and target rule provides the abstraction should you want to change it in the future.

@paulfantom paulfantom changed the title Makefile build: Makefile Oct 2, 2018
@paulfantom
Copy link
Contributor Author

Fixed.

@paulfantom
Copy link
Contributor Author

Fixed 😄

@abhinavdahiya
Copy link
Contributor

Personally, keeping the Makefile in the root makes it seem like the official way to run/build things in installer repo. And i think we have discussed it before that the hack/* script are the only supported way.
So people are free to create tooling around the scripts ... eg: switch / add TAGS,MODE for hack/build.sh etc. But a rooted Makefile doesn't seem like the way forward.

@crawford
Copy link
Contributor

crawford commented Oct 2, 2018

@abhinavdahiya and I talked it over in person and we don't think the Makefile is the right way forward. Thank you anyway for your effort.

/close

@openshift-ci-robot
Copy link
Contributor

@crawford: Closing this PR.

Details

In response to this:

@abhinavdahiya and I talked it over in person and we don't think the Makefile is the right way forward. Thank you anyway for your effort.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants