Bug 354796 - Add no-src configuration option, similar to the command line option
Summary: Add no-src configuration option, similar to the command line option
Status: RESOLVED FIXED
Alias: None
Product: kdesrc-build
Classification: Developer tools
Component: general (show other bugs)
Version: Git
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Michael Pyne
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-03 16:08 UTC by Alex Richardson
Modified: 2024-05-10 09:17 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Richardson 2015-11-03 16:08:54 UTC
I have the no-src option set in one of my modules (qt5). However, kdesrc-build will always try and update it unless I run it with the global --no-src flag:

alr48@honddu:/local/scratch/alr48/src/kf5/extragear/utils/kdesrc-build(master)> kdesrc-build -p qt5 --no-src

Building qt5 (1/1)
        Source update complete for qt5: Skipped
        Preparing build system for qt5.
        Would have cleaned build system for qt5
        Would have run 'make'
        Would have run 'make' 'install'
        Would have installed qt5

        Would have unlinked /local/scratch/alr48/logs/latest/build-status.
<<<  PACKAGES SUCCESSFULLY BUILT  >>>
qt5
 
alr48@honddu:/local/scratch/alr48/src/kf5/extragear/utils/kdesrc-build(master)> kdesrc-build -p qt5

Building qt5 (1/1)
        Would have run 'git' 'fetch' 'origin'
        Updating qt5 (to branch 5.6)
        Would have run 'git' 'checkout' '5.6'
        Would have run 'git' 'rebase' 'origin/5.6'
        No source update, but the last configure failed
        Source update complete for qt5: no files affected
        Preparing build system for qt5.
        Would have cleaned build system for qt5
        Would have run 'make'
        Would have run 'make' 'install'
        Would have installed qt5

        Would have unlinked /local/scratch/alr48/logs/latest/build-status.
<<<  PACKAGES SUCCESSFULLY BUILT  >>>
qt5


Reproducible: Always


Actual Results:  
git commands are run

Expected Results:  
git commands should not be run

My module definition looks like this:

module qt5
    override-build-system Qt
    configure-flags -debug -developer-build -nomake examples -nomake tests
    repository git://code.qt.io/qt/qt5.git 
    branch 5.6
    prefix /local/scratch/alr48/install/base
    manual-update true
    no-src true
end module

Unrelated to this I need to add "override-build-system Qt" otherwise kdesrc-build attempts to configure using qmake.
Comment 1 Michael Pyne 2015-11-10 03:38:18 UTC
I'm actually impressed things work with the Qt build system... I'd kind of simply never got around to implementing Qt5 support since it was released so far before KF5 that I figured distro packages would usually be enough.

--no-src is actually equivalent to the manual-update option internally, so it should already work given the options you've set. Obviously it still doesn't so I'll have to look at that...
Comment 2 Michael Pyne 2015-11-10 16:24:38 UTC
Actually looks like it is working right, I was assuming you wanted something else.

manual-update/no-src within an rc-file is supposed to allow you to have a module in your ~/.kdesrc-buildrc that is "skipped by default", but is updated/built if specifically mentioned on the command line.

Are you trying to still update the source manually (even if mentioned on cmdline) but want to have it built by kdesrc-build if mentioned on the cmdline or something? If you don't want qt5 built normally it *should* be sufficient to simply not mention it on the cmdline, which you can check by running something like "kdesrc-build -p --print-modules  | grep qt5"
Comment 3 Alex Richardson 2015-11-12 11:47:08 UTC
I want qt5 only to be built when I mention it on the command line and I want kdesrc-build to skip the git update step when building it.

So no-src in the rc file is not equivalent to --no-src on the command line? Is it exactly the same as manual-update?
Comment 4 Michael Pyne 2015-11-15 03:01:14 UTC
no-src in the rc-file means nothing. Unlike most command line options there is no rc-file equivalent for things like --no-src, --install-only, and other phase-selection command line options.

manual-update in the rc-file does map to --no-src internally (and also --no-build), and there is a manual-build option as well if you want kdesrc-build to keep the module updated by default but don't build it unless specified on the command line.

There's not currently a way to do something like force skipping the update or build steps even if you manually specify a module on the command line, without also using flags like --no-src or --no-build. If that's something that's desired I can probably think of a good way to do it.
Comment 5 Alex Richardson 2015-11-16 10:26:38 UTC
Thank you for the explanation. I'll just continue using --no-src for the few times that I update qt5.

The normal git update process that kdesrc-build does always fails for qt5.git so it would be nice to skip the updating even if I mention it on the command line but this is a very minor issue.
Comment 6 Justin Zobel 2021-03-09 23:42:35 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.
Comment 7 Andrew Shark 2023-09-01 18:00:13 UTC
This is accurate. Currently, the no-src option is not supported in configuration, see
https://docs.kde.org/trunk5/en/kdesrc-build/kdesrc-build/conf-options-table.html
Comment 8 Andrew Shark 2023-09-07 23:57:18 UTC
The [documentation for conf options](https://docs.kde.org/trunk5/en/kdesrc-build/kdesrc-build/conf-options-table.html) actually lists:
```
no-svn 	Module setting overrides global	If this option is set to true then kdesrc-build will not update the source code for the module automatically. It will still try to build the module if it normally would have tried anyways.
```

According to [documentation for command line options](https://docs.kde.org/trunk5/en/kdesrc-build/kdesrc-build/supported-cmdline-params.html), the `--no-svn` is an equivalent to the `--no-svn`.

I tried the following in the config:
```
options kio
    no-src true
end options
```
and also:
```
options kio
     no-svn true
end options
```
Unfortunately, this is completely ignored in both cases.

The build process switches branch to master every time it is built. (I am building ark, and kio is its dependency). But if I specify `branch` with my local branch name, it will fail, because it tries to download that from remote (that does not exist).
Comment 9 Andrew Shark 2024-01-28 21:29:08 UTC
Git commit d8104fa8e9defa5b25f7eab538a7b0f2fc652e1d by Andrew Shark.
Committed on 28/01/2024 at 21:24.
Pushed by ashark into branch 'master'.

Support phase selection individually for modules and module-sets

Previously we could only select phases globally from command line. They were applied to all modules.

Sometimes user want to control phase selection for individual module.

The clone is happening from the remote/origin by default. This becomes a problem when user is working with a local branch that is not presented in remote. For example, user may not have a developer account, or just does not want to upload his work even in work/user branch yet.

He just wants kdesrc-build to not touch the sources of that module (while the other modules still be updated), and does not want to exclude module from build phase.

Let's say user wants to work with `kio`, and testing it with `ark`.
Previously, user could achieve this task by running `kdesrc-build` several times. Different quirks were needed. Example:
- `kdesrc-build ark --include-dependencies` - build ark with dependencies (including kio) as normal
- `...` - make changes to the kio project
- `kdesrc-build kio --no-src --no-include-dependencies`
- `kdesrc-build ark --include-dependencies --ignore-modules kio`

After this commit user can specify the `no-src` option for the `kio` module, and then just run `kdesrc-build ark --include-dependencies`. The `kio` will not be updated in this process, but will not be excluded from build phase.

M  +88   -14   doc/conf-options-table.docbook
M  +2    -1    modules/ksb/Application.pm
M  +0    -1    modules/ksb/BuildContext.pm
M  +13   -9    modules/ksb/Cmdline.pm
M  +47   -1    modules/ksb/Module.pm

https://invent.kde.org/sdk/kdesrc-build/-/commit/d8104fa8e9defa5b25f7eab538a7b0f2fc652e1d
Comment 10 Andrew Shark 2024-05-10 09:17:00 UTC
Git commit 68dbc8f847165e08fcd7559df8eefd7971d8a68b by Andrew Shark.
Committed on 28/01/2024 at 21:24.
Pushed by ashark into branch 'docbook_historied_per_file'.

Support phase selection individually for modules and module-sets

Previously we could only select phases globally from command line. They were applied to all modules.

Sometimes user want to control phase selection for individual module.

The clone is happening from the remote/origin by default. This becomes a problem when user is working with a local branch that is not presented in remote. For example, user may not have a developer account, or just does not want to upload his work even in work/user branch yet.

He just wants kdesrc-build to not touch the sources of that module (while the other modules still be updated), and does not want to exclude module from build phase.

Let's say user wants to work with `kio`, and testing it with `ark`.
Previously, user could achieve this task by running `kdesrc-build` several times. Different quirks were needed. Example:
- `kdesrc-build ark --include-dependencies` - build ark with dependencies (including kio) as normal
- `...` - make changes to the kio project
- `kdesrc-build kio --no-src --no-include-dependencies`
- `kdesrc-build ark --include-dependencies --ignore-modules kio`

After this commit user can specify the `no-src` option for the `kio` module, and then just run `kdesrc-build ark --include-dependencies`. The `kio` will not be updated in this process, but will not be excluded from build phase.

Original commit: d8104fa8
https://invent.kde.org/sdk/kdesrc-build/-/commit/d8104fa8e9defa5b25f7eab538a7b0f2fc652e1d

M  +88   -14   doc/kdesrc-buildrc/conf-options-table.docbook

https://invent.kde.org/sdk/kdesrc-build/-/commit/68dbc8f847165e08fcd7559df8eefd7971d8a68b