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

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

Closed
jmrothst opened this issue Aug 17, 2019 · 12 comments

Comments

@jmrothst
Copy link

commented 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.

@guillep2k

This comment has been minimized.

Copy link
Member

commented 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.

@lunny

This comment has been minimized.

Copy link
Member

commented 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.

@jmrothst

This comment has been minimized.

Copy link
Author

commented 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 jmrothst changed the title Unable to build from source Unable to build from source (undocumented build requirements) Aug 20, 2019

@techknowlogick

This comment has been minimized.

Copy link
Member

commented 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.

@jmrothst

This comment has been minimized.

Copy link
Author

commented 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.

@lunny

This comment has been minimized.

Copy link
Member

commented Aug 20, 2019

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

@guillep2k

This comment has been minimized.

Copy link
Member

commented 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

This comment has been minimized.

Copy link
Member

commented 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.

@ecsgh

This comment has been minimized.

Copy link

commented 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?

@guillep2k

This comment has been minimized.

Copy link
Member

commented 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).

@ecsgh

This comment has been minimized.

Copy link

commented 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!

@guillep2k

This comment has been minimized.

Copy link
Member

commented 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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5 participants
You can’t perform that action at this time.