Bug: Possible wrong PATH used in Makefile #545

Closed
opened 2023-04-17 20:04:41 +00:00 by ASDFGamer · 2 comments
Contributor

describe your environment

  • tea version used (tea -v): 0.9.0+21-gb9c743a
  • Gitea version used: not relevant
    • the issue only occurred after updating gitea recently
  • operating system: Linux Mint 21.1
  • I make use of...
    • non-standard default branch names (no main,master, or trunk)
    • .ssh/config or .gitconfig host aliases in my git remotes
    • ssh_agent or similar
    • non-standard ports for gitea and/or ssh
    • something else that's likely to interact badly with tea: ...

describe the issue (observed vs expected behaviour)

I saw that the Makefile uses the following command to add go to the PATH Variable:
export PATH := $($(GO) env GOPATH)/bin:$(PATH), but i think that the correct Version would be:
export PATH := $(shell $(GO) env GOPATH)/bin:$(PATH).

I tested the output of the PATH variable via @echo and the path started with "/bin:...".

But my knowlage of Makefiles is very small and i think it is possible that this is the desired behavior or the change to the path isn't needed.

I created no PR, because i don't know if this is a real bug.

### describe your environment - tea version used (`tea -v`): 0.9.0+21-gb9c743a - [x] I also reproduced the issue [with the latest master build](https://dl.gitea.io/tea/master) - Gitea version used: not relevant - [ ] the issue only occurred after updating gitea recently - operating system: Linux Mint 21.1 - I make use of... - [ ] non-standard default branch names (no `main`,`master`, or `trunk`) - [ ] .ssh/config or .gitconfig host aliases in my git remotes - [X] ssh_agent or similar - [X] non-standard ports for gitea and/or ssh - [ ] something else that's likely to interact badly with tea: ... ### describe the issue (observed vs expected behaviour) I saw that the Makefile uses the following command to add go to the PATH Variable: `export PATH := $($(GO) env GOPATH)/bin:$(PATH)`, but i think that the correct Version would be: `export PATH := $(shell $(GO) env GOPATH)/bin:$(PATH)`. I tested the output of the PATH variable via @echo and the path started with "/bin:...". But my knowlage of Makefiles is very small and i think it is possible that this is the desired behavior or the change to the path isn't needed. I created no PR, because i don't know if this is a real bug.
ASDFGamer added the
kind/bug
label 2023-04-17 20:04:41 +00:00
Owner

That isn't adding Go to PATH, it's adding the default GOBIN to PATH. The line is fairly old, and my best guess it was used to reliably have xgo in PATH when using the makefile.

The Makefile should probably be cleaned up, it makes some assumptions about the user's system in relation to their Go knowledge/installation.

That isn't adding Go to PATH, it's adding the default `GOBIN` to PATH. The line is fairly old, and my best guess it was used to reliably have `xgo` in PATH when using the makefile. The Makefile should probably be cleaned up, it makes some assumptions about the user's system in relation to their Go knowledge/installation.
Author
Contributor

Thanks for the clarification.
I would think, that this issue could be closed, because it isn't a bug

Thanks for the clarification. I would think, that this issue could be closed, because it isn't a bug
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gitea/tea#545
No description provided.