Skip to content

Comments

meson: 0.57.1 -> 0.60.3, gst-plugins-base 1.18.4 -> 1.18.5#144779

Closed
Princemachiavelli wants to merge 15 commits intoNixOS:stagingfrom
Princemachiavelli:meson-0.60
Closed

meson: 0.57.1 -> 0.60.3, gst-plugins-base 1.18.4 -> 1.18.5#144779
Princemachiavelli wants to merge 15 commits intoNixOS:stagingfrom
Princemachiavelli:meson-0.60

Conversation

@Princemachiavelli
Copy link
Contributor

@Princemachiavelli Princemachiavelli commented Nov 5, 2021

Motivation for this change

Replaces #140545 and this can be looked at after the current ZHF cycle.

https://mesonbuild.com/Release-notes-for-0-60-0.html

Updated meson for compatibility with newer packages such as wlroots 0.16
Updated gst-plugins-base for compatibility with meson >= 0.58

I just stumbled upon the meson version issue when building gamescope since it requires wlroots 0.16. https://github.com/Plagman/gamescope

nixpkgs-review is in progress although it might end up being more than practical to run on a single machine. i.e it seems this will trigger a rebuild of >40,000 packages just looking at nixpkgs-review now. :/

I have built meson itself & gst-plugins-base without issue.

Closes #150486.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 21.11 Release Notes (or backporting 21.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@ofborg ofborg bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Nov 5, 2021
@cdunster
Copy link

Hey, I'm very new to Nix but I'm currently trying to move my dev environment over to use Nix packages. However, I need meson ~v0.59.1 which is how I came across this PR. I thought it would just be a matter of changing the version in the buildPythonApplication section but there is a lot more to it. Do you mind explaining why? Is it because other packages depend on meson? Just trying to learn more about Nix, thanks 🙂.

Also, is there anything I can do to help with this PR?

@KenMacD
Copy link
Contributor

KenMacD commented Nov 10, 2021

Hi @cdunster, you probably want to ask this on IRC/Matrix/discourse. In short through Nix lets you have multiple versions of any package in the store, and for development it's not uncommon to want different versions between projects.

I'm using NixOS, so what I typically do for development is create a shell.nix per project. In that shell.nix you could specify your version. One example that might work:

{ pkgs ? import <nixpkgs> {} }:

with pkgs.lib;

pkgs.mkShell {
  buildInputs = with pkgs; [
    python3
    (meson.overrideAttrs (old: {
      version = "0.59.1";
      src = python3.pkgs.fetchPypi {
        pname = "meson";
        version = "0.59.1";
        sha256 = "0v9m0bazhj48kwc8x3gkxg5c3kcvknvqfjlq22z6pm2h2r2nln6v";
      };
      patches = (take 2 old.patches) ++ [ ./gir-fallback-path.patch ]
        ++ (drop 3 old.patches);
    }))
    # keep this line if you use bash
    pkgs.bashInteractive
  ];
}

git-fallback-path.patch from the old version doesn't apply, which is why it's replaced. For it I used:

--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -913,6 +913,14 @@ class GnomeModule(ExtensionModule):
         if fatal_warnings:
             scan_command.append('--warn-error')
 
+        if len(set([girtarget.get_custom_install_dir()[0] for girtarget in girtargets])) > 1:
+            raise MesonException('generate_gir tries to build multiple libraries with different install_dir at once: {}'.format(','.join([str(girtarget) for girtarget in girtargets])))
+
+        fallback_libpath = girtargets[0].get_custom_install_dir()[0]
+        if fallback_libpath is not None and isinstance(fallback_libpath, str) and len(fallback_libpath) > 0 and fallback_libpath[0] == "/":
+            scan_command += ['--fallback-library-path=' + fallback_libpath]
+
+
         generated_files = [f for f in libsources if isinstance(f, (GeneratedList, CustomTarget, CustomTargetIndex))]
 
         scan_target = self._make_gir_target(state, girfile, scan_command, generated_files, depends, kwargs)

Doing something like this would allow you to use this version just for your code. If you add a package that is built with an older meson (like the other files in the PR) then that package will continue to work as expected.

As for the why, I'm not sure, but I know wlroots couldn't be updated until meson was updated. This led me to use an overlay to be able to do some bug hunting with sway.

@Princemachiavelli Princemachiavelli marked this pull request as ready for review November 12, 2021 20:55
@Princemachiavelli
Copy link
Contributor Author

Sorry for the delay on this, I got distracted and there was an upstream change to meson that required updating one of the patches (I'll annotate that in case anyone wants to review that).

Also, there is a pretty big change in meson 0.60; unknown options passed to meson configure and meson setup are not fatal. Options that are intended to be deprecated now should be configured as such in the meson_options.txt.

Practically this means that a lot more projects are going to break because it's been a common problem that packages accumulate meson build options more than we remove old/non-existent options. This means that this change will help us clean up a lot of packages but it also is going to be more hydra failures to fix even if the process is straightforward.

@github-actions github-actions bot added the 6.topic: systemd Software suite that provides an array of system components for Linux operating systems. label Nov 12, 2021
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upstream added type hinting to the get_custom_install_dir function so now it is a optional type containing a tupple (str,bool). This change also changed the default/null case; previously the default return value would be [None] but now the default case is simple an empty list [].

If a python-guru knows how to handle a empty set within a list comprehension, we could certainly make this less verbose. Also if anyone has any preference on how the patch is written such as how the empty list check is done or anything like that, I'm all ears.

Copy link
Member

@jtojnar jtojnar Nov 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use [girtarget.get_custom_install_dir()[0] for girtarget in girtargets if girtarget.get_custom_install_dir() is not None]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not even need the square brackets as Python supports set comprehensions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks I forgot a clause could be added to the end of the list/set comprehension. I went with just set(girtarget.get_custom_install_dir()[0] for girtarget in girtargets if girtarget.get_custom_install_dir()).

Copy link
Contributor Author

@Princemachiavelli Princemachiavelli Nov 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example case where we had an incorrect/outdated name of a meson option. What's difficult to know in this case is whether the two options are actually identical in function. It's also pretty common for software to have a lot of similar options (look at the EFI related settings below... some could easily be confused with each other).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't look like systemd ever had a "cryptsetup" option, only "libcryptsetup".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Case where we had a non-existent build option. What is hard to know is whether we needed that build option in for compatibility on Nix. i.e. did systemd start hard coding the path to kill or did they implement kill inside of systemd?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They implemented kill inside systemd.

Identified with git log -pG kill-path in the systemd repo.

@alyssais
Copy link
Member

Could you separate the Meson and Gstreamer changes into separate commits, and give 23dbcfc0cf59260b51fd16e8cb905c27979d9a96 a Nixpkgs-style commit message please?

@alyssais
Copy link
Member

Actually, the Meson stuff should probably all be squashed into a single commit anyway.

@alyssais alyssais mentioned this pull request Nov 24, 2021
13 tasks
@alyssais
Copy link
Member

shared-mime-info fails to build with Meson ≥0.60.0. There's a fix in progress upstream, but it's quite a big change and difficult to backport, so I think we should wait and see what happens. Last activity was only a couple of days ago anyway.

@alyssais
Copy link
Member

@vcunat could we maybe get a Hydra jobset for this? There are a bunch of incompatible changes that are breaking packages, and it's going to be hard to find them all otherwise.

@Princemachiavelli Princemachiavelli force-pushed the meson-0.60 branch 3 times, most recently from da8f786 to 6bcdb7c Compare November 24, 2021 22:12
@vcunat
Copy link
Member

vcunat commented Nov 25, 2021

Yes in principle, but it's a matter of priorities / time. I know of two similar feature-jobsets that were paused in the past couple weeks due to Hydra being overloaded a bit. (It's quite common at periods around forking a release.)

@Mindavi
Copy link
Contributor

Mindavi commented Nov 27, 2021

I cherry-picked these commits on top of nixpkgs, but cross-compiling e.g. iputils fails:

nix build -f default.nix pkgsCross.aarch64-multiplatform.iputils

(Excerpt from) error log
error: builder for '/nix/store/qcnmvz869vdc887237ganpkpcklgyznw-iputils-aarch64-unknown-linux-gnu-20210722.drv' failed with exit code 1;
       last 10 log lines:
       >   File "/nix/store/kmq06b06fxrspgk24q9wz038pqwyghd6-meson-0.60.1/lib/python3.9/site-packages/mesonbuild/mesonlib/universal.py", line 1393, in Popen_safe
       >     p = subprocess.Popen(args, universal_newlines=True, close_fds=False,
       >   File "/nix/store/nqck1zi4rj8sggdwwh1y21dkq3k624fh-python3-3.9.6/lib/python3.9/subprocess.py", line 951, in __init__
       >     self._execute_child(args, executable, preexec_fn, close_fds,
       >   File "/nix/store/nqck1zi4rj8sggdwwh1y21dkq3k624fh-python3-3.9.6/lib/python3.9/subprocess.py", line 1821, in _execute_child
       >     raise child_exception_type(errno_num, err_msg, err_filename)
       > OSError: [Errno 8] Exec format error: 'ldconfig'
       > FAILED: meson-install
       > /nix/store/kmq06b06fxrspgk24q9wz038pqwyghd6-meson-0.60.1/bin/meson install --no-rebuild
       > ninja: build stopped: subcommand failed.

I don't know if this is a regression in meson or in the packaging, but this will potentially break quite some cross-compilable packages as-is. I don't really have a list of other things I tried, but I tried some other packages on another day and those resulted in similar errors.

@alyssais
Copy link
Member

alyssais commented Jan 1, 2022

There are still some references to meson_0_60 that need to be cleaned up.
pkgs/applications/misc/metadata-cleaner/default.nix:12:, meson_0_60
pkgs/applications/misc/metadata-cleaner/default.nix:38:    meson_0_60
pkgs/development/libraries/libadwaita/default.nix:8:, meson_0_60
pkgs/development/libraries/libadwaita/default.nix:42:    meson_0_60
pkgs/development/libraries/wlroots/0.15.nix:1:{ lib, stdenv, fetchFromGitLab, meson_0_60, ninja, pkg-config, wayland-scanner
pkgs/development/libraries/wlroots/0.15.nix:26:  nativeBuildInputs = [ meson_0_60 ninja pkg-config wayland-scanner ];

@AndersonTorres
Copy link
Member

AndersonTorres commented Jan 1, 2022

Since #150486 added support for multiple meson versions, do we want to continue supporting that and have this PR just change the default?

The end goal is to get rid of old Meson.

The other PR is to insert meson 0.60.x without disrupting the entire package base with unseen incompatibilities or mass rebuilds.

The next steps should be:

  • changing the default to newest version
  • fix problematic packages
  • remove old meson

I have created a new issue addressing this specifically: #153082 (closed because the changes are huge to be handled by ofborg)

@AndersonTorres AndersonTorres mentioned this pull request Jan 1, 2022
13 tasks
@jtojnar
Copy link
Member

jtojnar commented Jan 2, 2022

More meson_0_60 dependents from #152948.

@L-as
Copy link
Member

L-as commented Jan 9, 2022

Instead of this huge PR that updates a bunch of things at once, what about flipping around the meson_0_60 and meson names to meson_0_59 and meson?

@L-as
Copy link
Member

L-as commented Jan 9, 2022

Seeing that this PR is almost done I instead made #154172 to try to fix the remaining issues.

@SuperSandro2000 SuperSandro2000 added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 9, 2022
gir-fallback-path.patch: meson 0.60 added types to the get_custom_install_dir and changed the default return type
@Princemachiavelli Princemachiavelli changed the title meson: 0.57.1 -> 0.60.2, gst-plugins-base 1.18.4 -> 1.18.5 meson: 0.57.1 -> 0.60.3, gst-plugins-base 1.18.4 -> 1.18.5 Jan 10, 2022
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 10, 2022
@alyssais
Copy link
Member

Merged as #154172 since it had a history cleanup. Thanks @Princemachiavelli for all your hard work!

@alyssais alyssais closed this Jan 11, 2022
@jtojnar jtojnar mentioned this pull request Jan 13, 2022
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: systemd Software suite that provides an array of system components for Linux operating systems. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.