Skip to content

podman-desktop: add darwin to platforms for non darwin platforms - #412303

Closed
mio-aotearoa wants to merge 2 commits into
NixOS:masterfrom
mio-aotearoa:patch-1
Closed

mio-aotearoa wants to merge 2 commits into
NixOS:masterfrom
mio-aotearoa:patch-1

Conversation

@mio-aotearoa

@mio-aotearoa mio-aotearoa commented May 30, 2025 •

Copy link
Copy Markdown
Contributor

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • 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/)
  • Nixpkgs 25.11 Release Notes (or backporting 24.11 and 25.05 Nixpkgs Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
  • NixOS 25.11 Release Notes (or backporting 24.11 and 25.05 NixOS Release notes)
    • (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.

Add a 👍 reaction to pull requests you find important.

podman-desktop builds and runs on my darwin device
@ofborg ofborg Bot added the 6.topic: darwin Running or building packages on Darwin label May 30, 2025
@mio-aotearoa
mio-aotearoa changed the base branch from nixos-unstable to master May 30, 2025 10:47
@nixpkgs-ci nixpkgs-ci Bot closed this May 30, 2025
@nixpkgs-ci nixpkgs-ci Bot reopened this May 30, 2025
@NixOSInfra NixOSInfra added the 12.first-time contribution This PR is the author's first one; please be gentle! label May 30, 2025
@github-actions github-actions Bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels May 30, 2025
@booxter

booxter commented Jun 10, 2025

Copy link
Copy Markdown
Contributor

What am I missing?

$ nix eval .#podman-desktop.meta --json | jq
{
  "available": true,
  "broken": false,
  "changelog": "https://github.com/containers/podman-desktop/releases/tag/v1.19.1",
  "description": "Graphical tool for developing on containers and Kubernetes",
  "homepage": "https://podman-desktop.io",
  "insecure": false,
  "license": {
    "deprecated": false,
    "free": true,
    "fullName": "Apache License 2.0",
    "redistributable": true,
    "shortName": "asl20",
    "spdxId": "Apache-2.0",
    "url": "https://spdx.org/licenses/Apache-2.0.html"
  },
  "mainProgram": "podman-desktop",
  "maintainers": [
    {
      "email": "[email protected]",
      "github": "booxter",
      "githubId": 90200,
      "name": "Ihar Hrachyshka"
    },
    {
      "email": "[email protected]",
      "github": "panda2134",
      "githubId": 7239200,
      "name": "panda2134"
    }
  ],
  "maintainersPosition": {
    "column": 5,
    "file": "/nix/store/imwsb25d173724pw8rwhymmk8vci0r78-source/pkgs/by-name/po/podman-desktop/package.nix",
    "line": 155
  },
  "name": "podman-desktop-1.19.1",
  "outputsToInstall": [
    "out"
  ],
  "platforms": [
    "x86_64-darwin",
    "x86_64-linux",
    "armv7l-linux",
    "aarch64-linux",
    "aarch64-darwin"
  ],
  "position": "/nix/store/imwsb25d173724pw8rwhymmk8vci0r78-source/pkgs/by-name/po/podman-desktop/package.nix:151",
  "unfree": false,
  "unsupported": false
}

@booxter

booxter commented Jun 10, 2025

Copy link
Copy Markdown
Contributor

With this PR, I see:

$ nix eval .#podman-desktop.meta --json | jq
{
...
  "platforms": [
    "x86_64-darwin",
    "x86_64-linux",
    "armv7l-linux",
    "aarch64-linux",
    "aarch64-darwin",
    "x86_64-darwin",
    "aarch64-darwin"
  ],
...
}

which doesn't seem right?

@mio-aotearoa

Copy link
Copy Markdown
Contributor Author

NixOS/nixos-search#942

@mio-aotearoa

Copy link
Copy Markdown
Contributor Author

The challenge is that we pick electron.source or electron-bin depending on the platform

The results of the command nix eval .#podman-desktop.meta --json | jq are different on my mac and linux machines

#412304 (comment)

@mio-aotearoa mio-aotearoa changed the title podman-desktop: add darwin to platforms podman-desktop: add darwin to platforms for non darwin platforms Jun 10, 2025
@booxter

booxter commented Jun 11, 2025

Copy link
Copy Markdown
Contributor

I see. Wouldn't it make sense to meld the two lists for electron and electron-bin, instead of explicitly adding darwin unconditionally?

@mio-aotearoa

Copy link
Copy Markdown
Contributor Author

Wouldn't it make sense to meld the two lists for electron and electron-bin, instead of explicitly adding darwin unconditionally?

It is a more correct way to do it. Do you know how to do it in nix code?

@booxter

booxter commented Jun 20, 2025 •

Copy link
Copy Markdown
Contributor

@mio-19 it doesn't make the lists of platforms identical but it should make it so that evals on both platforms list darwin targets: booxter@cd1f47f

A more proper fix would have to go deeper, into electron package.


on darwin:

"platforms": [
    "x86_64-darwin",
    "x86_64-linux",
    "armv7l-linux",
    "aarch64-linux",
    "aarch64-darwin"
  ],

on linux:

"platforms": [
    "aarch64-linux",
    "armv5tel-linux",
    "armv6l-linux",
    "armv7a-linux",
    "armv7l-linux",
    "i686-linux",
    "loongarch64-linux",
    "m68k-linux",
    "microblaze-linux",
    "microblazeel-linux",
    "mips-linux",
    "mips64-linux",
    "mips64el-linux",
    "mipsel-linux",
    "powerpc64-linux",
    "powerpc64le-linux",
    "riscv32-linux",
    "riscv64-linux",
    "s390-linux",
    "s390x-linux",
    "x86_64-linux",
    "x86_64-darwin",
    "aarch64-darwin"
  ],

@booxter

booxter commented Jun 20, 2025 •

Copy link
Copy Markdown
Contributor

@NixOS/darwin-core perhaps our core team would have a better idea on how to make meta list darwin platforms when evaluated on Linux - where electron_36 is electron-source.*, not electron-bin_36?

@emilazy

emilazy commented Jun 21, 2025

Copy link
Copy Markdown
Member

This is another symptom of the thing where Hydra and other infra only evaluates in x86_64-linux to gather attribute paths. I don't know a particularly great solution other than "avoid if darwin then pkg1 else pkg2 and get source builds working on Darwin". It shouldn't be too hard since we already build a Chromium as part of Qt WebEngine, but it is work.

I think in this case the most general hack would be to add Darwin to the Electron source package platform list, with the understanding that it won't actually build but will tell Hydra the right thing. That means that explicit builds of the source package wouldn't give a good error though, unfortunately.

@nixpkgs-ci nixpkgs-ci Bot removed the 12.first-time contribution This PR is the author's first one; please be gentle! label Jun 25, 2025
@nixpkgs-ci nixpkgs-ci Bot added the 9.needs: reviewer This PR currently has no reviewers requested and needs attention. label Jul 4, 2025
@fugidev

fugidev commented Jul 18, 2025 •

Copy link
Copy Markdown
Member

Maybe something like this would be good? This is imo the logical place to do it. No impacted packages according to nixpkgs-review (applied to the other electron versions too).

diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index d5a5df1edd29..a0f82862cae6 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -6835,10 +6835,15 @@ with pkgs;
   electron_33 = electron_33-bin;
   electron_34 = electron_34-bin;
   electron_35 =
-    if lib.meta.availableOn stdenv.hostPlatform electron-source.electron_35 then
-      electron-source.electron_35
-    else
-      electron_35-bin;
+    (if lib.meta.availableOn stdenv.hostPlatform electron-source.electron_35 then
+        electron-source.electron_35
+      else
+        electron_35-bin
+    ).overrideAttrs (old: {
+      meta = old.meta // {
+        platforms =
+          electron-source.electron_35.meta.platforms
+          ++ electron_35-bin.meta.platforms;
+      };
+    });
   electron_36 =
     if lib.meta.availableOn stdenv.hostPlatform electron-source.electron_36 then
       electron-source.electron_36

Or maybe make it some sort of meta package

@booxter

booxter commented Dec 15, 2025

Copy link
Copy Markdown
Contributor

@mio-19 do you plan to refresh this based on the latest comments maybe? Please let us know if you are still interested in pursuing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: darwin Running or building packages on Darwin 9.needs: reviewer This PR currently has no reviewers requested and needs attention. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants