-
-
Notifications
You must be signed in to change notification settings - Fork 206
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
cannot build from git in portage/emerge #707
Comments
Incidently, this build error is not at all limited to gentoo, or even git builds. The problem is that git has been introduced as a requirement for all builds. This means it's no longer possible to make a release or build from a tag tarball. Here is me trying to build from the master tarball (there hasn't been a tag since the change or I would show from a tag as well)
|
Just tested this on both a fresh master.zip and a git pull; comment out the below lines in
Or display git stats from a git build:
@rabarar , since you helped get this going with #688, do you have any other suggestions? |
What version of git are you using?
… On Jul 18, 2022, at 6:56 PM, Nick ***@***.***> wrote:
Just tested this on both a fresh master.zip and a git pull; comment out the below lines in git_watcher.cmake:
https://github.com/robotastic/trunk-recorder/blob/a30ee308518d478c4fdcd39fab2314717898bd65/git_watcher.cmake#L137-L140
and it will build. T-R will fall back on the default version strings if queried from a snapshot build:
# ./trunk-recorder --version
Trunk-Recorder: 4.3.2
WARN: failed to get the current git state. Is this a git repo?
Or display git stats from a git build:
# ./trunk-recorder --version
Trunk-Recorder: 4.3.2
WARN: there were uncommitted changes at build-time.
commit a30ee30 (master)
describe 2.1.2-1460-ga30ee30
Author: Luke Berndt ***@***.***>
Date: 2022-07-16 09:42:05 -0400
updated costas_alpha to match OP25
@rabarar , since you helped get this going with #688, do you have any other suggestions?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
It fails because the .git directory is missing, I am very confident that is unrelated to the git software version. |
That said, looks like today it is 2.35.1 |
I tested the above with Per the comments just above the lines I quoted in git_watcher.cmake, commenting them out will allow the compile to continue with default values if the source is a tagged release or tarball, or anything other than a git pull.
I haven't tested is what happens if you dont even have git installed at all. I don't know what would happen in that event. |
Ah, I see… let me look and see what I can do to conditionally compile when there is no repo…
… On Jul 18, 2022, at 7:31 PM, Nick ***@***.***> wrote:
What version of git are you using?
…
I tested the above with git version 2.37.1 on MacOS/homebrew. As noted previously, building from a source zip will fail because it lacks a live .git directory.
Per the comments just above the lines I quoted in git_watcher.cmake, commenting them out will allow the compile to continue with default values if the source is a tagged release or tarball, or anything other than a git pull.
# Issue 26: git info not properly set
#
# Check if we should fail if any of the exit codes are non-zero.
# Most methods have a fall-back default value that's used in case of non-zero
# exit codes. If you're feeling risky, disable this safety check and use
# those default values.
I haven't tested is what happens if you dont even have git installed at all. I don't know what would happen in that event.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
Being able to inject a version by passing it in directly via cmake would be nice as well. |
The version is pulled out of the code in addition to the git status.
The solution i think is to modify line 139 of git_watcher.cmake and revise the output on line 53 of git.cc <http://git.cc/>.in to indicate no git repository is availble. Or I can delete it altogether and solely print out the version numbers extracted from the source. like the test below:
```
% ./trunk-recorder --version
Trunk-Recorder: 4.3.2
```
Thoughts/preferences? Let me know and I’ll do a PR
… On Jul 18, 2022, at 7:54 PM, Zero_Chaos ***@***.***> wrote:
Being able to inject a version by passing it in directly via cmake would be nice as well.
—
Reply to this email directly, view it on GitHub <#707 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABB2J6B35YRC4OFK4TQPUYTVUXVETANCNFSM52NWEN7Q>.
You are receiving this because you were mentioned.
|
Despite it breaking my builds, I thought the idea was great. I really just want a way to pass in the information for when auto extraction fails. Also, it should fall back to the static version tag if the git extraction fails and nothing is passed in via cmake. |
I didn’t realize anyone would be building from a non-repo so that’s why it was a fatal error. What information would one pass in if the git repo ins’t there?? Not sure I follow passing in git info from a non-git repo.
I think the solution is to go silent, build and just not output anything related to git stats on the ‘—version’ output.
… On Jul 18, 2022, at 8:39 PM, Zero_Chaos ***@***.***> wrote:
Despite it breaking my builds, I thought the idea was great. I really just want a way to pass in the information for when auto extraction fails. Also, it should fall back to the static version tag if the git extraction fails and nothing is passed in via cmake.
—
Reply to this email directly, view it on GitHub <#707 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABB2J6GFE2NPWZCZ2JULJADVUX2MNANCNFSM52NWEN7Q>.
You are receiving this because you were mentioned.
|
It's the way the Gentoo package manager works. It is building a git version but it doesn't keep the .git directory while building. So I have the info, but no way to pass it in. |
It is also a fatal error for building from a snapshot, or a tag, so if another release ever happens, a lot of people will be compiling without a .git directory. |
The git related stuff of this was already fixed, I'm going to open a new bug to cover the other part of the issue which was confused in this issue originally. |
I've had a "live ebuild" for TR for a while now, basically it automatically pulls from git within gentoo's package manager, and builds/installs the latest rev. It's super helpful for testing, as it runs everything through all the qa scripts, etc. Unfortunately, when version information was added to the build system, it breaks the way gentoo builds.
I suspect that the easiest solution to this, would to simply add a flag which can be passed to cmake that sets the version info manually.
Unfortunately, I don't see anything useful in cmake right now, not even an error.
The text was updated successfully, but these errors were encountered: