dt unknown-version? ["solved" -- sort of]

Thank you, @kmilos,
Here are the three replies:

sh get_git_version_string.sh
3.9.0+1071~gd8f9de0b1

git describe --tags --dirty
release-3.9.0-1071-gd8f9de0b1

git describe --always --dirty
release-3.9.0-1071-gd8f9de0b1

Ok, that eliminates the shallow git cloning issues…

I’d start w/ a clean slate then by rm -rf build (or add the --clean-build -f option to your build command line above, perhaps even --clean-all -f).

Thank you.
a) I removed everything in my source folder, everything in /opt, and .config/darktable and .cache/darktable

b) git-cloned master branch and compiled again.

Result:
Unknown-version. (Both as a result from --version and from clicking the logo.)

sh get_git_version_string.sh
3.9.0+1073~g981c390a9

git describe --tags
release-3.9.0-1073-g981c390a9

git describe --always --dirty
release-3.9.0-1073-g981c390a9

:frowning:

Sincerely,
Claes in Lund, Sweden

Next thing I guess is to insert some message("I''m here") commands into that big if-else block of CmakeLists.txt to try to figure out which case you end up in… Don’t forget to comment out the build and install lines in build.sh, you don’t need to go that far, you just want to see the debug messages during the configuration step, and verify the generated version_gen.c

The problem is solved.
Actually, not “solved”, but circumvented, because I still do not know the reason for the dilemma. My “solution” was to install a brand new OS onto an empty SSD.

So from now on, I am running Debian 11 instead of Garuda Linux.

Have fun,
Claes in Lund, Sweden

Well the wallpaper is awesome, so you have that going for you.

The issue is related to a security update of git on Ubuntu 20.04. It has been announced 12 april 2022 (Git security vulnerability announced | The GitHub Blog). A new configuration parameter has been introduced (from Git - git-config Documentation) :

safe.directory

These config entries specify Git-tracked directories that are considered safe even if they are owned by someone other than the current user. By default, Git will refuse to even parse a Git config of a repository owned by someone else, let alone run its hooks, and this config setting allows users to specify exceptions, e.g. for intentionally shared repositories (see the --shared option in git-init[1]).

This is a multi-valued setting, i.e. you can add more than one directory via git config --add. To reset the list of safe directories (e.g. to override any such directories specified in the system config), add a safe.directory entry with an empty value.

This config setting is only respected when specified in a system or global config, not when it is specified in a repository config or via the command line option -c safe.directory=<path>.

The value of this setting is interpolated, i.e. ~/<path> expands to a path relative to the home directory and %(prefix)/<path> expands to a path relative to Git’s (runtime) prefix.

For me the issue is solved adding

sudo git config --global --add safe.directory /home/user/darktable/master

before

sudo cmake --build "/home/user/darktable/master/build" --target install -- -j12

where /home/user/darktable/master is the location of the git clone of darktable master.

6 Likes

Thank you @pehar for this solution! It works great!

With Ubuntu 22.04 I ran now into the same problem and tried the steps described above and on darktable reports "unknown version" · Issue #11542 · darktable-org/darktable · GitHub. But still DT states “unknown version”. For compiling I used
./build.sh --prefix /opt/darktable --build-type Release --install --sudo
after running
sudo git config --global --add safe.directory /home/till/git/darktable

EDIT:
When running ./build.sh without ‘–install’ and then checking ‘./build/bin/darktable --version’ shows the correct version, but after running installation by
‘sudo cmake --build “/home/till/git/darktable/build” --target install – -j16’
‘/opt/darktable/bin/darktable --version’ shows ‘unknown-version’.

Did you observed similar behavior recently?

Thanks for your help!
Till

This is how I build / install :

cd /home/user/darktable/master
git pull https://github.com/darktable-org/darktable.git
cd build
sudo make clean
cd ..
git submodule init
git submodule update
./build.sh --build-type Release |& tee ../build.log
sudo mv /opt/darktable /opt/darktable-3.9.0-previous-version
sudo git config --global --add safe.directory /home/user/darktable/master
sudo cmake --build "/home/user/darktable/master/build" --target install -- -j12

and this still works on Ubuntu 20.04.

Thanks, pehar! I am not sure, if the reason was that I had a final ‘/’ in my path when adding the safe directory, but it works now.

Definitely not. The sequence of the commands is of importance. You tried to set the safe directory before running the build script to build and install. The correct sequence is :

  1. run build script without installing
  2. set safe directory
  3. install via cmake

I’m compiling darktable with what https://github.com/darktable-org/darktable#compile recommends:

./build.sh --prefix /opt/darktable --build-type Release --install --sudo

I get the “unknown version” error.

Is that command wrong?

NO, but all is explains above

NO, but all is explains above

@nilvus sorry, I cannot realize why I don’t get the correct version is that command is correct… could you give me some more hint?

It’s related to a github security update. You have just a command to type one time only on your system. See @pehar comment above (16th comment on april 18th).

I issued sudo git config --global --add safe.directory /home/user/darktable/master (adapted to my darktable clone directory)

I re-pulled darktable repository

I run again ./build.sh --prefix /opt/darktable/ --build-type Release --install --sudo

Nothing changed: still version unknown.

What am I missing?

Please read the entire thread, everything is fully explained. See especially comments 19 and 21.

1 Like

ok, I found the solution.

An interrogation mark remains: why isn’t it enough to run sudo git config --global --add safe.directory /home/user/darktable/master once for all? does git forget that value?

I had to set it only once. The configuration is saved in ~.gitconfig :

[safe]
	directory = /home/<user>/darktable/master