Skip to content

meson: 1.0.0 -> 1.1.0#226265

Merged
alyssais merged 2 commits intoNixOS:stagingfrom
alyssais:meson-1.1.0
Apr 19, 2023
Merged

meson: 1.0.0 -> 1.1.0#226265
alyssais merged 2 commits intoNixOS:stagingfrom
alyssais:meson-1.1.0

Conversation

@alyssais
Copy link
Member

@alyssais alyssais commented Apr 15, 2023

Description of changes

Tested with the "simple" NixOS test.

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 rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.05 Release Notes (or backporting 22.11 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.

@alyssais alyssais requested a review from NickCao April 15, 2023 11:08
Copy link
Member

@NickCao NickCao left a comment

Choose a reason for hiding this comment

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

Changelog: https://mesonbuild.com/Release-notes-for-1-1-0.html, nothing particular.

@alyssais
Copy link
Member Author

Also tested a full system cross compile:

with import ./. { crossSystem = "aarch64-linux"; };
(nixos {
  fileSystems."/" = {
    device = "/dev/sda";
  };

  # GRUB has never cross compiled
  boot.loader.systemd-boot.enable = true;
}).toplevel

And a fairly complex static build, pkgsStatic.connmanMinimal.

@ofborg ofborg bot requested review from AndersonTorres and jtojnar April 15, 2023 12:59
@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 Apr 15, 2023
@jtojnar
Copy link
Member

jtojnar commented Apr 15, 2023

Sounds like these hacks might no longer be necessary:

preInstall = ''
# We have pkexec on PATH so Meson will try to use it when installation fails
# due to being unable to write to e.g. /etc.
# Let’s pretend we already ran pkexec –
# the pkexec on PATH would complain it lacks setuid bit,
# obscuring the underlying error.
# https://github.com/mesonbuild/meson/blob/492cc9bf95d573e037155b588dc5110ded4d9a35/mesonbuild/minstall.py#L558
export PKEXEC_UID=-1
'';

This isn't needed since Meson 1.1.0.
@alyssais
Copy link
Member Author

Sounds like these hacks might no longer be necessary:

Yep, the two packages with that hack build fine without them. I've pushed a second commit removing it.

@ofborg ofborg bot requested review from AndersonTorres and mvnetbiz April 15, 2023 21:02
@jtojnar
Copy link
Member

jtojnar commented Apr 15, 2023

Those hacks are not there to fix builds but to provide useful error messages when upgrading them and they try to install new files to other store paths.

But can confirm it is not necessary – with Meson 1.0.0:

[0/1] Installing files.
Installing src/power-profiles-daemon to /nix/store/dr7n7iv00ydz10p6dmnh6zvgmcnhfayl-power-profiles-daemon-0.12/libexec
Installing /build/source/build/src/powerprofilesctl to /nix/store/dr7n7iv00ydz10p6dmnh6zvgmcnhfayl-power-profiles-daemon-0.12/bin
Installation failed due to insufficient permissions.
Attempting to use polkit to gain elevated privileges...
pkexec must be setuid root
FAILED: meson-internal__install 
/nix/store/vs8pgydqp4jrmm0hy0lblaxd2rzph91v-meson-1.0.0/bin/meson install --no-rebuild

With Meson 1.1.0:

Installing /build/source/data/net.hadess.PowerProfiles.policy to /nix/store/p9phjbr3scmlhzm521rp79axd9k84013-polkit-122/share/polkit-1/actions
Installation failed due to insufficient permissions.
Traceback (most recent call last):
  File "/nix/store/q86dqxx6fh7f19zv865iicwf13pvn3fm-meson-1.1.0/lib/python3.10/site-packages/mesonbuild/minstall.py", line 547, in do_install
    self.install_data(d, dm, destdir, fullprefix)
  File "/nix/store/q86dqxx6fh7f19zv865iicwf13pvn3fm-meson-1.1.0/lib/python3.10/site-packages/mesonbuild/minstall.py", line 620, in install_data
    if self.do_copyfile(fullfilename, outfilename, makedirs=(dm, outdir)):
  File "/nix/store/q86dqxx6fh7f19zv865iicwf13pvn3fm-meson-1.1.0/lib/python3.10/site-packages/mesonbuild/minstall.py", line 422, in do_copyfile
    self.copy2(from_file, to_file)
  File "/nix/store/q86dqxx6fh7f19zv865iicwf13pvn3fm-meson-1.1.0/lib/python3.10/site-packages/mesonbuild/minstall.py", line 322, in copy2
    shutil.copy2(*args, **kwargs)
  File "/nix/store/fdqpyj613dr0v1l1lrzqhzay7sk4xg87-python3-3.10.10/lib/python3.10/shutil.py", line 434, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/nix/store/fdqpyj613dr0v1l1lrzqhzay7sk4xg87-python3-3.10.10/lib/python3.10/shutil.py", line 256, in copyfile
    with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: '/nix/store/p9phjbr3scmlhzm521rp79axd9k84013-polkit-122/share/polkit-1/actions/net.hadess.PowerProfiles.policy'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/nix/store/q86dqxx6fh7f19zv865iicwf13pvn3fm-meson-1.1.0/lib/python3.10/site-packages/mesonbuild/mesonmain.py", line 194, in run
    return options.run_func(options)
  File "/nix/store/q86dqxx6fh7f19zv865iicwf13pvn3fm-meson-1.1.0/lib/python3.10/site-packages/mesonbuild/minstall.py", line 835, in run
    installer.do_install(datafilename)
  File "/nix/store/q86dqxx6fh7f19zv865iicwf13pvn3fm-meson-1.1.0/lib/python3.10/site-packages/mesonbuild/minstall.py", line 568, in do_install
    s.register(sys.stdin, selectors.EVENT_READ)
  File "/nix/store/fdqpyj613dr0v1l1lrzqhzay7sk4xg87-python3-3.10.10/lib/python3.10/selectors.py", line 360, in register
    self._selector.register(key.fd, poller_events)
PermissionError: [Errno 1] Operation not permitted

ERROR: Unhandled python OSError. This is probably not a Meson bug, but an issue with your build environment.
FAILED: meson-internal__install 
/nix/store/q86dqxx6fh7f19zv865iicwf13pvn3fm-meson-1.1.0/bin/meson install --no-rebuild
Patch used to test this
diff --git a/pkgs/development/tools/build-managers/meson/default.nix b/pkgs/development/tools/build-managers/meson/default.nix
index fb0c5d45fb9..846c45ba139 100644
--- a/pkgs/development/tools/build-managers/meson/default.nix
+++ b/pkgs/development/tools/build-managers/meson/default.nix
@@ -13,15 +13,16 @@
 , AppKit
 , Cocoa
 , libxcrypt
+, version ? "1.0.0"
+, hash ? "sha256-qlCkukVXwl59SERqv96FeVfc31g4X/++Zwug6O+szgU="
 }:
 
 python3.pkgs.buildPythonApplication rec {
   pname = "meson";
-  version = "1.1.0";
+  inherit version;
 
   src = python3.pkgs.fetchPypi {
-    inherit pname version;
-    hash = "sha256-2WFsRM1sU2if+PBfxpWKaT8uF8NHKo2vg87lXav/gp8=";
+    inherit pname version hash;
   };
 
   patches = [
@@ -72,6 +73,14 @@ python3.pkgs.buildPythonApplication rec {
         "docs/yaml/objects/dep.yaml"
       ];
     })
+
+  ] ++ lib.optionals (lib.versionOlder version "1.1.0") [
+    # tests: avoid unexpected failure when cmake is not installed
+    # https://github.com/mesonbuild/meson/pull/11321
+    (fetchpatch {
+      url = "https://github.com/mesonbuild/meson/commit/a38ad3039d0680f3ac34a6dc487776c79c48acf3.patch";
+      hash = "sha256-9YaXwc+F3Pw4BjuOXqva4MD6DAxX1k5WLbn0xzwuEmw=";
+    })
   ];
 
   setupHook = ./setup-hook.sh;
diff --git a/pkgs/os-specific/linux/power-profiles-daemon/default.nix b/pkgs/os-specific/linux/power-profiles-daemon/default.nix
index 648442ad757..05bbd1fc765 100644
--- a/pkgs/os-specific/linux/power-profiles-daemon/default.nix
+++ b/pkgs/os-specific/linux/power-profiles-daemon/default.nix
@@ -41,7 +41,10 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     pkg-config
-    meson
+    (meson.override {
+      version = "1.1.0";
+      hash = "sha256-2WFsRM1sU2if+PBfxpWKaT8uF8NHKo2vg87lXav/gp8=";
+    })
     ninja
     gettext
     gtk-doc
@@ -73,8 +76,6 @@ stdenv.mkDerivation rec {
     umockdev
   ];
 
-  strictDeps = true;
-
   # for cli tool
   pythonPath = [
     python3.pkgs.pygobject3
@@ -93,8 +94,6 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  PKG_CONFIG_POLKIT_GOBJECT_1_POLICYDIR = "${placeholder "out"}/share/polkit-1/actions";
-
   # Avoid double wrapping
   dontWrapGApps = true;
 

@alyssais
Copy link
Member Author

@ofborg eval

@ofborg ofborg bot requested a review from jtojnar April 17, 2023 21:23
@alyssais
Copy link
Member Author

@jtojnar, that last commit caused bubblewrap to no longer build, so I'm going to drop it, and leave that for somebody else to investigate in a different PR.

@alyssais alyssais merged commit 084a9e0 into NixOS:staging Apr 19, 2023
@alyssais alyssais deleted the meson-1.1.0 branch April 19, 2023 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

4 participants