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

Make gitea work using cmd.exe again #22073

Merged
merged 5 commits into from
Dec 14, 2022

Conversation

zeripath
Copy link
Contributor

@zeripath zeripath commented Dec 8, 2022

Gitea will attempt to lookup its location using LookPath however, this fails on cmd.exe if gitea is in the current working directory.

exec.LookPath will return an exec.ErrDot error which we can test for and then simply using filepath.Abs(os.Args[0]) to absolute gitea against the current working directory.

Fix #22063

Signed-off-by: Andrew Thornton [email protected]

Gitea will attempt to lookup its location using LookPath however,
this fails on cmd.exe if gitea is in the current working directory.

exec.LookPath will return an exec.ErrDot error which we can test for
and then simply using filepath.Abs(os.Args[0]) to absolute gitea
against the current working directory.

Fix go-gitea#22063

Signed-off-by: Andrew Thornton <[email protected]>
@zeripath zeripath added type/bug outdated/backport/v1.18 This PR should be backported to Gitea 1.18 labels Dec 8, 2022
@zeripath zeripath added this to the 1.19.0 milestone Dec 8, 2022
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Dec 8, 2022
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Dec 8, 2022
@lunny
Copy link
Member

lunny commented Dec 9, 2022

exec.ErrDot is only supported by go1.19

Copy link
Member

@delvh delvh left a comment

Choose a reason for hiding this comment

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

As per @lunny, blocking until we use at least Go 1.19.

@delvh delvh added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. status/blocked This PR cannot be merged yet, i.e. because it depends on another unmerged PR lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Dec 9, 2022
Signed-off-by: Andrew Thornton <[email protected]>
@lunny lunny added reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. and removed status/blocked This PR cannot be merged yet, i.e. because it depends on another unmerged PR labels Dec 13, 2022
@techknowlogick
Copy link
Member

ping lg-tm

@techknowlogick techknowlogick merged commit 4fb2006 into go-gitea:main Dec 14, 2022
@lunny
Copy link
Member

lunny commented Dec 14, 2022

Please send backport to v1.18

@lunny lunny removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Dec 14, 2022
@zeripath zeripath deleted the fix-22063-default-app-path branch December 14, 2022 11:57
zeripath added a commit to zeripath/gitea that referenced this pull request Dec 14, 2022
Backport go-gitea#22073

Gitea will attempt to lookup its location using LookPath however, this
fails on cmd.exe if gitea is in the current working directory.

exec.LookPath will return an exec.ErrDot error which we can test for and
then simply using filepath.Abs(os.Args[0]) to absolute gitea against the
current working directory.

Fix go-gitea#22063

Signed-off-by: Andrew Thornton <[email protected]>
@zeripath zeripath added the backport/done All backports for this PR have been created label Dec 14, 2022
jolheiser pushed a commit that referenced this pull request Dec 14, 2022
Backport #22073

Gitea will attempt to lookup its location using LookPath however, this
fails on cmd.exe if gitea is in the current working directory.

exec.LookPath will return an exec.ErrDot error which we can test for and
then simply using filepath.Abs(os.Args[0]) to absolute gitea against the
current working directory.

Fix #22063

Signed-off-by: Andrew Thornton <[email protected]>
zjjhot added a commit to zjjhot/gitea that referenced this pull request Dec 15, 2022
* upstream/main:
  Fixed Project view .board-column height for tall screens. (go-gitea#22108)
  Correctly handle moved files in apply patch (go-gitea#22118)
  remove duplicated read file code (go-gitea#22042)
  Fix condition for is_internal (go-gitea#22095)
  Make gitea work using cmd.exe again (go-gitea#22073)
  Fix markdown typo of an extra backtick in docs (go-gitea#22123)
  Fix autofilled text visibility in dark mode (go-gitea#22088)
yardenshoham added a commit to yardenshoham/gitea that referenced this pull request Feb 3, 2023
This was meant to land in go-gitea#22073 but was blocked until go-gitea#22732 was merged

Signed-off-by: Yarden Shoham <[email protected]>
zeripath pushed a commit that referenced this pull request Feb 3, 2023
This was meant to land in #22073 but was blocked until #22732 was merged

Signed-off-by: Yarden Shoham <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. outdated/backport/v1.18 This PR should be backported to Gitea 1.18 type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't execute gitea.exe on Windows in cmd.exe
7 participants