Unable to build from source (undocumented build requirements) #3802

Closed
opened 2025-11-02 05:25:39 -06:00 by GiteaMirror · 12 comments
Owner

Originally created by @jmrothst on GitHub (Aug 17, 2019).

  • Gitea version (or commit ref): 1.8.0, 1.8.1, 1.8.2, 1.8.3, 1.9.0, 1.9.1
  • Git version: NA
  • Operating system: Linux
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist: NA

Description

Using the source file download from the release tag (e.g. https://github.com/go-gitea/gitea/archive/v1.9.1.tar.gz), the bundled make files expect git to be installed, and that the extracted location is the result of a git checkout. Since neither of these is true, build fails when make executes git to determine the version.

Building without make using "go build -a -v -tags 'pam sqlite sqlite_unlock_notify'" is successful.

Why this is an issue is that I am trying to package gitea into RPM via mock in a chroot jail with minimal installed packages, and no network access to correctly identify all needed dependencies so that later usage of gitea will work in an environment where no internet access exists.

Originally created by @jmrothst on GitHub (Aug 17, 2019). - Gitea version (or commit ref): 1.8.0, 1.8.1, 1.8.2, 1.8.3, 1.9.0, 1.9.1 - Git version: NA - Operating system: Linux - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [X] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [X] Not relevant - Log gist: NA ## Description Using the source file download from the release tag (e.g. https://github.com/go-gitea/gitea/archive/v1.9.1.tar.gz), the bundled make files expect git to be installed, and that the extracted location is the result of a git checkout. Since neither of these is true, build fails when make executes git to determine the version. Building without make using "go build -a -v -tags 'pam sqlite sqlite_unlock_notify'" is successful. Why this is an issue is that I am trying to package gitea into RPM via mock in a chroot jail with minimal installed packages, and no network access to correctly identify all needed dependencies so that later usage of gitea will work in an environment where no internet access exists.
GiteaMirror added the type/question label 2025-11-02 05:25:39 -06:00
Author
Owner

@guillep2k commented on GitHub (Aug 17, 2019):

I guess this should be obvious, but git is a dependency of Gitea. You can not run it without git installed on the server side.

@guillep2k commented on GitHub (Aug 17, 2019): I guess this should be obvious, but git _is_ a dependency of Gitea. You can not run it without git installed on the server side.
Author
Owner

@lunny commented on GitHub (Aug 18, 2019):

Currently we still depends on git command line. We may remove it in future after src-d/go-git is mature enough.

@lunny commented on GitHub (Aug 18, 2019): Currently we still depends on git command line. We may remove it in future after src-d/go-git is mature enough.
Author
Owner

@jmrothst commented on GitHub (Aug 20, 2019):

I have no issue with git being a run time requirement for Gitea.

The issue is that git is an undocumented build time requirement of Gitea, and Gitea has had in the past, and current does have a method to successfully build without git.

@jmrothst commented on GitHub (Aug 20, 2019): I have no issue with git being a run time requirement for Gitea. The issue is that git is an undocumented build time requirement of Gitea, and Gitea has had in the past, and current does have a method to successfully build without git.
Author
Owner

@techknowlogick commented on GitHub (Aug 20, 2019):

Install from source specifically references using git.

As you have mentioned in your post it is possible to build without the use of make, if you want to use make without having git installed, then perhaps setting the DRONE_TAG env var might also work for you.

@techknowlogick commented on GitHub (Aug 20, 2019): [Install from source](https://docs.gitea.io/en-us/install-from-source/) specifically references using git. As you have mentioned in your post it is possible to build without the use of make, if you want to use make without having git installed, then perhaps setting the `DRONE_TAG` env var might also work for you.
Author
Owner

@jmrothst commented on GitHub (Aug 20, 2019):

Quoting from the same installation instructions provided :

Since all required libraries are already bundled in the Gitea source, it’s possible to build Gitea with no additional downloads apart from Make (See here how to get Make). Various make tasks are provided to keep the build process as simple as possible.

As such, git is not a documented build requirement.

Source is downloaded from the GitHub release page for the tagged release.

This creates a barrier to packaging Gitea into RPM format, and later validation that the installed system is actually a result of the previously validated binaries.

@jmrothst commented on GitHub (Aug 20, 2019): Quoting from the same installation instructions provided : > Since all required libraries are already bundled in the Gitea source, it’s possible to build Gitea with no additional downloads apart from Make (See here how to get Make). Various make tasks are provided to keep the build process as simple as possible. As such, git is not a documented build requirement. Source is downloaded from the GitHub release page for the tagged release. This creates a barrier to packaging Gitea into RPM format, and later validation that the installed system is actually a result of the previously validated binaries.
Author
Owner

@lunny commented on GitHub (Aug 20, 2019):

@jmrothst I don't think building gitea needs git ever.

@lunny commented on GitHub (Aug 20, 2019): @jmrothst I don't think building gitea needs git ever.
Author
Owner

@guillep2k commented on GitHub (Aug 20, 2019):

@jmrothst I don't think building gitea needs git ever.

@lunny There are in fact a couple of references in the Makefile:

css: npm
    npx stylelint public/less
    npx lessc --clean-css="--s0 -b" public/less/index.less public/css/index.css
    $(foreach file, [....]

    @diff=$$(git diff public/css/*); \
    if ([ -n "$$CI" ] && [ -n "$$diff" ]); then \
        echo "Generated files in public/css have changed, please commit the result:"; \
        echo "$${diff}"; \
        exit 1; \
    fi;

Also for swagger-check: and test-vendor:, but I don't think those are hit during build.

@guillep2k commented on GitHub (Aug 20, 2019): > > > @jmrothst I don't think building gitea needs git ever. @lunny There are in fact a couple of references in the `Makefile`: ``` css: npm npx stylelint public/less npx lessc --clean-css="--s0 -b" public/less/index.less public/css/index.css $(foreach file, [....] @diff=$$(git diff public/css/*); \ if ([ -n "$$CI" ] && [ -n "$$diff" ]); then \ echo "Generated files in public/css have changed, please commit the result:"; \ echo "$${diff}"; \ exit 1; \ fi; ``` Also for `swagger-check:` and `test-vendor:`, but I don't think those are hit during build.
Author
Owner

@guillep2k commented on GitHub (Aug 20, 2019):

mkdir checkgitmake
(
    echo '#!/bin/bash'
    echo 'echo "GIT WAS HIT!" >&2'
    echo 'exit 2'
) > checkgitmake/git
chmod 700 checkgitmake/git
PATH="`pwd`/checkgitmake:$PATH" make

This prints GIT WAS HIT! right at the start of make.

@guillep2k commented on GitHub (Aug 20, 2019): ``` mkdir checkgitmake ( echo '#!/bin/bash' echo 'echo "GIT WAS HIT!" >&2' echo 'exit 2' ) > checkgitmake/git chmod 700 checkgitmake/git PATH="`pwd`/checkgitmake:$PATH" make ``` This prints `GIT WAS HIT!` right at the start of `make`.
Author
Owner

@ecsgh commented on GitHub (Aug 25, 2019):

I think i have the same problem and i don't think this is fixed.
I also want to build gitea as rpm without access to github at build process.
Till version 1.8.3 all go right.
But at beginning of 1.9.0 i can no more build gitea.
So why?
And if this issue is really fixed what must i do?

@ecsgh commented on GitHub (Aug 25, 2019): I think i have the same problem and i don't think this is fixed. I also want to build gitea as rpm without access to github at build process. Till version 1.8.3 all go right. But at beginning of 1.9.0 i can no more build gitea. So why? And if this issue is really fixed what must i do?
Author
Owner

@guillep2k commented on GitHub (Aug 25, 2019):

@ecsgh You don't need access to GitHub. Just install git in the computer where you are building Gitea and make sure it's available from the same place you use make to start the build (e.g. modify your PATH variable so git is reachable).

@guillep2k commented on GitHub (Aug 25, 2019): @ecsgh You don't need access to GitHub. Just install `git` in the computer where you are building Gitea and make sure it's available from the same place you use `make` to start the build (e.g. modify your `PATH` variable so git is reachable).
Author
Owner

@ecsgh commented on GitHub (Aug 25, 2019):

@guillep2k
This is not the problem.
git is installed and reachable.
I have two problems.
I can not build "local" and i can not build in opensuse build server.
Local it downloads packages but exit with error.
In Opensuse build server github is not reachable.
And the needed package are in "your" vendor dir. But why use it the build procedure no more since 1.9?
Before 1.9 it can build without not reachable github!

@ecsgh commented on GitHub (Aug 25, 2019): @guillep2k This is not the problem. git is installed and reachable. I have two problems. I can not build "local" and i can not build in opensuse build server. Local it downloads packages but exit with error. In Opensuse build server github is not reachable. And the needed package are in "your" vendor dir. But why use it the build procedure no more since 1.9? Before 1.9 it can build without not reachable github!
Author
Owner

@guillep2k commented on GitHub (Aug 25, 2019):

@guillep2k
This is not the problem.
git is installed and reachable.
I have two problems.
I can not build "local" and i can not build in opensuse build server.
Local it downloads packages but exit with error.
In Opensuse build server github is not reachable.
And the needed package are in "your" vendor dir. But why use it the build procedure no more since 1.9?
Before 1.9 it can build without not reachable github!

OK, so yours is a different issue than this. Please open a new issue and include the last portion of the build output for reference.

@guillep2k commented on GitHub (Aug 25, 2019): > > > @guillep2k > This is not the problem. > git is installed and reachable. > I have two problems. > I can not build "local" and i can not build in opensuse build server. > Local it downloads packages but exit with error. > In Opensuse build server github is not reachable. > And the needed package are in "your" vendor dir. But why use it the build procedure no more since 1.9? > Before 1.9 it can build without not reachable github! OK, so yours is a different issue than this. Please open a new issue and include the last portion of the build output for reference.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3802