https://bugs.kde.org/show_bug.cgi?id=474427

            Bug ID: 474427
           Summary: When building AUR git package, and staying on
                    non-existing remote branch, getting fatal error
                    message
    Classification: Frameworks and Libraries
           Product: extra-cmake-modules
           Version: 5.109.0
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: ecm-bugs-n...@kde.org
          Reporter: ash...@linuxcomp.ru
  Target Milestone: ---

When trying to build some software that uses ECM, while staying at that git
branch that is not existing in remote, the message is shown:
`fatal: no upstream configured for branch 'makepkg'` 

This happens when building an AUR package, because it checkouts to the
`makepkg` branch.

STEPS TO REPRODUCE
1. Be on Arch Linux environment
2. Clone the https://aur.archlinux.org/plasma5-runners-jetbrains-runner-git.git
repo
3. Run makepkg
4. Observe output after `==> Starting build()...`. (The `build()` is a function
in PKGBUILD).

OBSERVED RESULT
There is a message in output:
```
==> Starting build()...
-- Found KF5: success (found suitable version "5.109.0", minimum required is
"5.72.0") found components: I18n Service Runner TextWidgets ConfigWidgets
PlasmaQuick KIO 
fatal: no upstream configured for branch 'makepkg'
-- Found KF5: success (found version "5.109.0") found components: Config
...
```

EXPECTED RESULT
There should be no errors

ADDITIONAL INFORMATION
Here is the context (got with `cmake ... --trace`):
```
/usr/share/ECM/kde-modules/KDECMakeSettings.cmake(345):  set(_reponame  )
/usr/share/ECM/kde-modules/KDECMakeSettings.cmake(346): 
_repository_name(_reponame ${CMAKE_SOURCE_DIR} )
/usr/share/ECM/kde-modules/KDECMakeSettings.cmake(304): 
execute_process(COMMAND git rev-parse --symbolic-full-name @{u} OUTPUT_VARIABLE
upstream_ref RESULT_VARIABLE exitCode WORKING_DIRECTORY ${dir} )
fatal: no upstream configured for branch 'makepkg'
/usr/share/ECM/kde-modules/KDECMakeSettings.cmake(308):  if(exitCode EQUAL 0 )
/usr/share/ECM/kde-modules/KDECMakeSettings.cmake(311):  else()
```

This is the line with the git command in cmake module:
https://invent.kde.org/frameworks/extra-cmake-modules/-/blob/ed9b7b7eb95bb66e92f2eff39ad8cf3b36cb1b76/kde-modules/KDECMakeSettings.cmake#L306

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.27.7
KDE Frameworks Version: 5.109.0
Qt Version: 5.15.10
extra-cmake-modules 5.109.0-1

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to