REPRODUCIBILITY (% or how often): 100%
BUILD ID = OS VERSION (Settings > About product): n/a
HARDWARE (XA2, X10, X10 II, …): n/a
UI LANGUAGE: n/a
REGRESSION: (compared to previous public release: Yes, No, ?): Not recent anyway
DESCRIPTION:
Adding a new file in the SDK through the “Add New” menu add it to git unless you opt out.
That borks the automatic versioning and prevents building.
PRECONDITIONS:
Automatic versioning for project/rpm
STEPS TO REPRODUCE:
Add new
Build
EXPECTED RESULT:
Build succeeds
ACTUAL RESULT:
Build fails
ADDITIONAL INFORMATION:
16:34:39: Running steps for project harbour-seaprint...
16:34:39: Starting: "/home/attah/.config/SailfishSDK/libsfdk/build-target-tools/sailfish-os-build-engine/SailfishOS-4.2.0.19EA-aarch64/qmake" /home/attah/repos/harbour-seaprint/harbour-seaprint.pro -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug
+ /home/attah/SailfishOS/bin/sfdk qmake /home/attah/repos/harbour-seaprint/harbour-seaprint.pro -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug
sfdk: [I] Options from environment: -c target=SailfishOS-4.2.0.19EA-aarch64
error: Entry 'src/curlworker.cpp' not uptodate. Cannot merge.
Cannot save the current worktree state
Fatal: Cannot save state of Git working tree: git-stash failed.
16:34:40: The process "/home/attah/.config/SailfishSDK/libsfdk/build-target-tools/sailfish-os-build-engine/SailfishOS-4.2.0.19EA-aarch64/qmake" exited with code 1.
Error while building/deploying project harbour-seaprint (kit: SailfishOS-4.2.0.19EA-aarch64 (in sailfish-os-build-engine))
When executing step "qmake"
16:34:40: Elapsed time: 00:01.
Note how these never-before-seen files show as “not staged” (as opposed to untracked) along with the project file.
Didn’t know that was possible…
Click build, deploy, or run sfdk build.
18:36:14: Running steps for project gitvsntest...
18:36:14: Start Build Engine: The "sailfish-os-build-engine" virtual machine is already running. Nothing to do.
18:36:14: Configuration unchanged, skipping qmake step.
18:36:14: Starting: "/home/attah/.config/SailfishSDK/libsfdk/build-target-tools/sailfish-os-build-engine/SailfishOS-4.1.0.24-aarch64/make"
+ /home/attah/SailfishOS/bin/sfdk make
sfdk: [I] Options from environment: -c target=SailfishOS-4.1.0.24-aarch64
error: Entry 'src/test.cpp' not uptodate. Cannot merge.
Cannot save the current worktree state
Fatal: Cannot save state of Git working tree: git-stash failed.
18:36:15: The process "/home/attah/.config/SailfishSDK/libsfdk/build-target-tools/sailfish-os-build-engine/SailfishOS-4.1.0.24-aarch64/make" exited with code 1.
Error while building/deploying project gitvsntest (kit: SailfishOS-4.1.0.24-aarch64 (in sailfish-os-build-engine))
When executing step "Make"
18:36:15: Elapsed time: 00:00.
Also note that git-stash fails:
attah@obsidian ~/repos/gitvsntest $ git stash
error: Entry 'src/test.cpp' not uptodate. Cannot merge.
Cannot save the current worktree state
I’m running git 2.33.0, but i’ve seen this quite a while now.
So the behavior is caused by Qt Creator using git add with --intent-to-add, which is known to prevent use of git-stash. It is necessary to add the newly added files to the index (stage) before git-stash is used. (some info git stash tracked but new files - Stack Overflow)
The next Sailfish SDK version will likely omit --intent-to-add by default.