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

Why two distinct commands to install binary? #3169

Closed
rootulp opened this issue Feb 7, 2024 · 4 comments
Closed

Why two distinct commands to install binary? #3169

rootulp opened this issue Feb 7, 2024 · 4 comments
Assignees
Labels
external Issues created by non node team members

Comments

@rootulp
Copy link
Contributor

rootulp commented Feb 7, 2024

Context

Step 4 of https://docs.celestia.org/nodes/celestia-node#install-celestia-node shows that the install command differs for Mac and Ubuntu.

Platform Command Notes
Mac make go-install Uses go install to put binary in $GOPATH/bin (if GOPATH is set) or $HOME/go/bin (if GOPATH is not set)
Ubuntu make install Uses install to put binary in /usr/local/bin

Question

I'm wondering why? A prerequisite to this page is the development environment steps which instruct users to Install Go and configure PATH to include:

  1. /usr/local/go/bin
  2. $HOME/go/bin

So it seems to me like we only need to support the Go install command. Concretely, on a Linux machine, I can do:

root@rootulp-mocha:~/celestia-node# make go-install
--> Installing Celestia

root@rootulp-mocha:~/celestia-node# which celestia
/root/go/bin/celestia

root@rootulp-mocha:~/celestia-node# celestia version
Semantic version: v0.12.4
Commit: 8e5a71746bc9bd9300ad3e4853797e64fdd1d018
Build Date: Wed Feb  7 15:02:52 UTC 2024
System version: amd64/linux
Golang version: go1.21.6

Proposal

  1. Remove the existing make install command.
  2. Alias the existing make install command to do the same as make go-install.
@github-actions github-actions bot added needs:triage external Issues created by non node team members labels Feb 7, 2024
@Wondertan
Copy link
Member

Wondertan commented Feb 7, 2024

It exists to support two ways of installing the binary. The native go way and native linux way which doesn't rely on GOBIN. It might be not documented well enough, but we should keep two ways.

Personally, I never use go-install and only install.

Another option I see is to unify them into one install directive which checks for GOBIN presence and defines the path accordingly. Remember that go install is basically go build; mv and its not a must to use it.

@rootulp
Copy link
Contributor Author

rootulp commented Feb 7, 2024

Personally, I always try to use make install and hit an error:

$ make install
--> Installing Celestia
install: ./build/celestia -> /usr/local/bin//celestia
install: -t: No such file or directory
make: *** [install] Error 71

Then I recall that I'm supposed to use make go-install. It's minor but I wonder if other developers encounter the same friction. I like your idea of unifying them into one make install command. The unified make install could check for GOBIN (like you said) and/or the platform that the user is on and then delegate to the current implementations based on that info. Defer to ya'll

@jcstein
Copy link
Member

jcstein commented Feb 19, 2024

It exists to support two ways of installing the binary. The native go way and native linux way which doesn't rely on GOBIN. It might be not documented well enough, but we should keep two ways.

i think it is clearly documented in Celestia docs, if you all think this needs to be more clear let me know. also, thinking maybe it could be better documented in celestia-node itself?

@Wondertan
Copy link
Member

@jcstein, i meant to document better n celestia-node side, docs are good imo

ramin added a commit that referenced this issue Feb 20, 2024
@ramin ramin self-assigned this Feb 25, 2024
ramin added a commit that referenced this issue Mar 13, 2024
…nstall everywhere else (#3197)

<!--
Thank you for submitting a pull request!

Please make sure you have reviewed our contributors guide before
submitting your
first PR.

Please ensure you've addressed or included references to any related
issues.

Tips:
- Use keywords like "closes" or "fixes" followed by an issue number to
automatically close related issues when the PR is merged (e.g., "closes
#123" or "fixes #123").
- Describe the changes made in the PR.
- Ensure the PR has one of the required tags (kind:fix, kind:misc,
kind:break!, kind:refactor, kind:feat, kind:deps, kind:docs, kind:ci,
kind:chore, kind:testing)

-->

refs #3169

Suggestion we add this little detect and switch. One issue i see with
attempting to detect GOBIN is that it doesn't HAVE to be set (ie: there
can be a default). This i would think is a good quick compromise to
un-confuse @rootulp and (potentially) other devs and make this behavior
more delightful most of the time. IF not, we should close this and the
other issue.

---------

Co-authored-by: Rootul P <[email protected]>
@ramin ramin closed this as completed Mar 13, 2024
renaynay pushed a commit to renaynay/celestia-node that referenced this issue Apr 3, 2024
…nstall everywhere else (celestiaorg#3197)

<!--
Thank you for submitting a pull request!

Please make sure you have reviewed our contributors guide before
submitting your
first PR.

Please ensure you've addressed or included references to any related
issues.

Tips:
- Use keywords like "closes" or "fixes" followed by an issue number to
automatically close related issues when the PR is merged (e.g., "closes
#123" or "fixes #123").
- Describe the changes made in the PR.
- Ensure the PR has one of the required tags (kind:fix, kind:misc,
kind:break!, kind:refactor, kind:feat, kind:deps, kind:docs, kind:ci,
kind:chore, kind:testing)

-->

refs celestiaorg#3169

Suggestion we add this little detect and switch. One issue i see with
attempting to detect GOBIN is that it doesn't HAVE to be set (ie: there
can be a default). This i would think is a good quick compromise to
un-confuse @rootulp and (potentially) other devs and make this behavior
more delightful most of the time. IF not, we should close this and the
other issue.

---------

Co-authored-by: Rootul P <[email protected]>
renaynay pushed a commit to renaynay/celestia-node that referenced this issue Apr 3, 2024
…nstall everywhere else (celestiaorg#3197)

<!--
Thank you for submitting a pull request!

Please make sure you have reviewed our contributors guide before
submitting your
first PR.

Please ensure you've addressed or included references to any related
issues.

Tips:
- Use keywords like "closes" or "fixes" followed by an issue number to
automatically close related issues when the PR is merged (e.g., "closes
#123" or "fixes #123").
- Describe the changes made in the PR.
- Ensure the PR has one of the required tags (kind:fix, kind:misc,
kind:break!, kind:refactor, kind:feat, kind:deps, kind:docs, kind:ci,
kind:chore, kind:testing)

-->

refs celestiaorg#3169

Suggestion we add this little detect and switch. One issue i see with
attempting to detect GOBIN is that it doesn't HAVE to be set (ie: there
can be a default). This i would think is a good quick compromise to
un-confuse @rootulp and (potentially) other devs and make this behavior
more delightful most of the time. IF not, we should close this and the
other issue.

---------

Co-authored-by: Rootul P <[email protected]>
Wondertan pushed a commit that referenced this issue May 8, 2024
…only (#3340)

refs #3169 && #3197

Instead of make install, I was using make install-global because my path ordered the go/bin last. Took me a bit of time to clarify why the -t option wasn't working, so I had just removed it locally.. Anyway, figured I'd put this up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external Issues created by non node team members
Projects
None yet
Development

No branches or pull requests

4 participants