Bug 392654

Summary: module not in module-group is still being built after being "skipped"
Product: [Developer tools] kdesrc-build Reporter: David Faure <faure>
Component: generalAssignee: Michael Pyne <mpyne>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: Git   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 18.04
Sentry Crash Report:

Description David Faure 2018-04-02 21:16:22 UTC
Building kitinerary (build system KDE) from kde-pim (1/1)
        No source update, but the last configure failed
        Skipping kitinerary, this module was not in the containing module-set at this branch
        Source update complete for kitinerary: no files affected
        Preparing build system for kitinerary.
        Removing files in build directory for kitinerary
        Old build system cleaned, starting new build system.
        Running cmake...
        Unable to configure kitinerary with CMake!
        Unable to configure kitinerary with KDE

If it's skipping it, why is it trying to build it?
This obviously fails with
CMake Error: The source directory "/d/kde/src/5/kde/pim/kitinerary" does not exist.

Testcase: branch-group stable-kf5-qt5, and kdesrc-build kitinerary (not that I typed that of course, it just happened as part of a full kdesrc-build run.


Side question: now that kdesrc-build doesn't download a kde_projects.xml anymore, where can I see in which part of the virtual tree of git modules, is a git module like kitinerary? (I assume the actual fix for the above issue is to add kitinerary to kde-build-metadata, but for that I need to know if it's in playground, frameworks, kde/pim or whatever).

Thanks!
Comment 1 Michael Pyne 2018-04-03 03:01:04 UTC
You can use the --query flag to get some metadata about each module.  If you built/installed kdesrc-build with docs then you should have a kdesrc-build.1 man page which you can add to MANPATH, the option is documented there (and I think with the Docbook docs as well).

kde-svn@midna ~/kf5 $ kdesrc-build --query project-path kitinerary
kde/pim/kitinerary

So at least that part is easy. :)
Comment 2 Michael Pyne 2018-04-04 03:47:46 UTC
Git commit 9d09e4787898061ae38bc83dd53ca2f7ca88dca1 by Michael Pyne.
Committed on 04/04/2018 at 03:41.
Pushed by mpyne into branch 'master'.

git: Ensure we skip modules that we say we must skip.

The git code recognizes when a module that is selected for update/build
implicitly (e.g. because it is included as a subset of a module grouping
that *was* asked for) does not actually have a git branch.  This often
happens for newly-introduced modules (which obviously won't already have
historical "stable" branches).

Rather than forcing users to know that a module is new and manually
ignore it we announce we will skip the build for these modules.

However I confused the return code in this function; no errors are
returned, only exceptions are used for errors, which meant kdesrc-build
would try to merrily build the non-existant module anyways.

Fixed by making this an error.  I looked at making it possible to
completely elide the module from the update/build list entirely but that
requires a network call (we can't rely on cached source code since
we can't download non-existent sources), and I don't think that's
a good idea.  The error message can probably be worded better though.
FIXED-IN:18.04

M  +5    -6    modules/ksb/Updater/Git.pm

https://commits.kde.org/kdesrc-build/9d09e4787898061ae38bc83dd53ca2f7ca88dca1