Closed lancethepants closed 2 years ago
Both src/meson_config.h
and src/include/config.h
the line #define VERSION
the closing "
is on the next line down.
I am cloning and then deleting .git
directory, so not sure if that's causing the issue. VERSION
does have a value, looks like a sha1, just the terminating "
is on the following line.
Hmmm, not deleting .git
it now doesn't result in the issue. Now show 1.1pre18
instead of sha1.
GitHub is buggy again, so I'm posting this as a new comment.
Working without .git
isn't really supported, there's no other way to detect what version you're building.
We could create a separate file in the source tree (VERSION
?) and use it as a fallback, but then @gsliepen will have to remember to update it on each release.
I'm guessing you put tinc's source inside another git repository, and the script is using that repository as its own. Could you try this patch?
diff --git a/version.py b/version.py
index ff491bb5..d9a84d59 100755
--- a/version.py
+++ b/version.py
@@ -1,12 +1,15 @@
#!/usr/bin/env python3
-from sys import argv, exit
+from os import environ, path
+from sys import argv
import subprocess as subp
prefix = "release-"
cmd = [
"git",
+ "--git-dir",
+ path.join(environ['MESON_SOURCE_ROOT'], '.git'),
"describe",
"--always",
"--tags",
@@ -23,4 +26,3 @@ if not result.returncode and version and version.startswith(prefix):
version = version[len(prefix):].strip()
print(version if version else "unknown", end="")
-exit(not version)
It's not ideal (what if someone renames the .git
directory or moves it somewhere?), but there are limits on what the project can support.
We could also maybe add the toolchain you're using into CI, so it's tested more frequently.
I think it's better to first os.chdir(environ['MESON_SOURCE_ROOT'])
, then call git describe --always --tags
so git can do its own best to find the .git directory.
Depends on whether you'd like to see tinc use commit hashes from the repository above it as its own version.
I guess it probably makes some sense if you're building firmware as a whole unit? What do other projects used do in that situation?
The patch above forces it to stay it its own directory (so if git directory is missing, you get unknown
instead of 2df5ccc48bcfc8644af949b87c22dd943c0cd76a
).
Yes, tinc gets put inside another source repo, kinda goofy they way it's done. That patch does allow it to compile and gives "unknown" as the version. In actuality we probably will only be doing actual tarball (pre)-releases. How will a tarball of an actual (pre)-release work, just the hardcoded version of that release?
Commit 33f0918cde36accb606271c379bc8e75973e9d59 causing the following build issue while cross-compiling for tomato firmware.