After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 781938 - meson should automatically delete build dir
meson should automatically delete build dir
Status: RESOLVED OBSOLETE
Product: jhbuild
Classification: Infrastructure
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Jhbuild maintainers
Jhbuild QA
Depends on:
Blocks:
 
 
Reported: 2017-04-29 11:22 UTC by Alberts Muktupāvels
Modified: 2021-05-17 16:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
meson: remove builddir when meson version has changed (2.49 KB, patch)
2017-06-14 16:41 UTC, Alberts Muktupāvels
needs-work Details | Review
meson: remove builddir when meson version has changed (2.63 KB, patch)
2017-06-20 10:53 UTC, Alberts Muktupāvels
none Details | Review

Description Alberts Muktupāvels 2017-04-29 11:22:29 UTC
*** Building nautilus *** [124/208]
ninja
[0/1] Regenerating build files

Meson encountered an error:
Build directory has been generated with Meson version 0.40.0, which is incompatible with current version 0.40.1.
Please delete this build directory AND create a new one.
FAILED: build.ninja 
'/usr/bin/python3' '/mnt/wd20ezrx-00dc0b0/JHBuild/3.26/install/bin/meson' --internal regenerate '/mnt/wd20ezrx-00dc0b0/JHBuild/3.26/checkout/nautilus' '/mnt/wd20ezrx-00dc0b0/JHBuild/3.26/checkout/nautilus/build' --backend ninja
ninja: error: rebuilding 'build.ninja': subcommand failed

Manual action seems unacceptable... :( Is there automatic way to delete build dir when meson version has changed?
Comment 1 Michael Catanzaro 2017-04-30 17:30:51 UTC
I can't think of any way to handle this, but that doesn't mean it's impossible... perhaps it's just a failure of imagination.

Note: pretty much the same situation occurs with Autotools, but you don't notice because they almost never get new releases anymore.
Comment 2 Alberts Muktupāvels 2017-04-30 17:47:00 UTC
How does meson knows that directory was generated with older version? Maybe jhbuild could do same thing to get that version and compare it with `meson --version`?
Comment 3 Alberts Muktupāvels 2017-06-14 16:41:42 UTC
Created attachment 353755 [details] [review]
meson: remove builddir when meson version has changed

Here is idea how to fix this, seems to work... Most likely someone with better python knowledge could come up with better patch.
Comment 4 Michael Catanzaro 2017-06-15 04:21:34 UTC
Review of attachment 353755 [details] [review]:

Um....

Why do you need to generate a new Python script at runtime? There's got to be a better way.
Comment 5 Michael Catanzaro 2017-06-15 04:22:10 UTC
I would normally approve a hacky patch too, if it works, but this is a bit too much IMO.
Comment 6 Alberts Muktupāvels 2017-06-15 08:56:23 UTC
That patch was meant as an idea... I don't know python and I have no time to learn it. :(

Feel free to update patch to put generated file in ~/.cache or whatever feels better. The idea is to get version from coredata and compare it with current meson version. If versions does not match then it will fail:
https://github.com/mesonbuild/meson/blob/master/mesonbuild/coredata.py#L252

Extra script is needed, generated or installed, because meson is python3, but jhbuild is still python2 which does not know how to load that file.

Even better idea could be to open bug / feature request for meson. Meson could have extra command line option that could check if existing buildir is compatible with current version (generated with same version)... Then jhbuild could parse this output and decide it buildir should be deleted or not.
Comment 7 Alberts Muktupāvels 2017-06-20 10:53:05 UTC
Created attachment 354090 [details] [review]
meson: remove builddir when meson version has changed
Comment 8 Michael Catanzaro 2017-06-23 18:10:52 UTC
Probably time to investigate porting JHBuild to Python 3....
Comment 9 John Ralls 2017-06-23 18:38:43 UTC
(In reply to Michael Catanzaro from comment #8)
> Probably time to investigate porting JHBuild to Python 3....

If you do that please keep it working with Py2 as well. After a brief flirtation with Py3 in 10.6 Apple has shipped only Py2.
Comment 10 Michael Catanzaro 2017-06-23 19:01:43 UTC
I'm surprised macOS users are using JHBuild! I think that's fine, so long as it's not holding back the core codebase. Maintaining support for Python 2 would be too much IMO. We've already ported most of the rest of GNOME to Python 3 without maintaining Python 2 compatibility.

Anyway, let's move further discussion on this to bug #688070, and focus here on meson builddir deletion.
Comment 11 GNOME Infrastructure Team 2021-05-17 16:06:11 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/jhbuild/-/issues/262.