!PbcQeaWcgMyjVfeGQN:nixos.org

Nix Mozilla 🦊🐦🐒

165 Members
A room about a number of weird animals (also known as Mozilla products): Firefox, Thunderbird, Spidermonkey, NSS, cacert. Also a little bit of fun times, small amounts of extreme, when building weird animals. But for bugs please file GitHub issues. | Release Schedule: https://whattrainisitnow.com | Crash-Stats: https://crash-stats.mozilla.org/search/?distribution_id=%3Dnixos&product=Firefox&product=Thunderbird47 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
6 Mar 2024
@zeorin:matrix.orgXandor Schiefer * Hey all, long time FF user on Nix. For the longest time it's been difficult to install different versions of FF side-by-side, as the binary names collide. I'm a web dev, so early on in my Nix journey I switched to using https://github.com/mozilla/nixpkgs-mozilla, so I could use Nightly ✨07:25:51
@zeorin:matrix.orgXandor Schiefer I still had issues with installing different versions side-by-side, so I opened an issue with them: https://github.com/mozilla/nixpkgs-mozilla/issues/296. The response was that Mozilla just uses the same wrapFirefox wrapper from Nixpkgs, but their own firefox-bin-unwrapped (and variants). 07:26:58
@zeorin:matrix.orgXandor Schiefer I worked around this with my own wrapper that renamed the binaries. I see that in nixpkgs-unstable this is now effectively also done for the nixpkgs versions of FF 07:27:43
@zeorin:matrix.orgXandor Schiefer(I finally moved my config to flakes, so can't use the Mozilla overlay anymore).07:28:04
@zeorin:matrix.orgXandor SchieferAnd this does work fine in NixOS.07:28:25
@zeorin:matrix.orgXandor Schiefer But not for standalone Home Manager, because it's buildEnv call disallows collisions, while NixOS's allows them. 07:28:50
@zeorin:matrix.orgXandor Schiefer While the wrapper names are now different, the unwrapped names are still not, for the non-bin variants 07:29:55
@zeorin:matrix.orgXandor Schiefer So there's still collisions on .firefox-old in a standalone Home Manager install. 07:31:01
@zeorin:matrix.orgXandor SchieferSince the Mozilla overlay's (and also the nixpkgs -bin variants) do have different unwrapped binary names, they don't have this issue.07:31:57
@zeorin:matrix.orgXandor SchieferBut the nixpkgs non-bin versions do. The only fix I've been able to find is to actually build FF with different binary names07:32:29
@zeorin:matrix.orgXandor Schiefer

I.e. something like this:

modified   pkgs/applications/networking/browsers/firefox/packages.nix
@@ -33,6 +33,7 @@
 
   firefox-beta = buildMozillaMach rec {
     pname = "firefox-beta";
+    binaryName = "firefox-beta";
     version = "124.0b2";
     applicationName = "Mozilla Firefox Beta";
     src = fetchurl {
@@ -40,6 +41,8 @@
       sha512 = "a98bedcf2bb6e58a20b4ab49d53db0899ed7c6589b20266522521c3db5c583807be1d536a580a1b42dd5783c0d81d95c4f42be6a157fb08a588447ca4fa21dde";
     };
 
+    extraConfigureFlags = [ "--with-app-name=${binaryName}" ];
+
     meta = {
       changelog = "https://www.mozilla.org/en-US/firefox/${lib.versions.majorMinor version}beta/releasenotes/";
       description = "A web browser built from Firefox Beta Release source tree";
@@ -51,7 +54,7 @@
                                              # not in `badPlatforms` because cross-compilation on 64-bit machine might work.
       maxSilent = 14400; # 4h, double the default of 7200s (c.f. #129212, #129115)
       license = lib.licenses.mpl20;
-      mainProgram = "firefox";
+      mainProgram = binaryName;
     };
     tests = [ nixosTests.firefox-beta ];
     updateScript = callPackage ./update.nix {
@@ -62,6 +65,7 @@
 
   firefox-devedition = buildMozillaMach rec {
     pname = "firefox-devedition";
+    binaryName = "firefox-developer-edition";
     version = "124.0b2";
     applicationName = "Mozilla Firefox Developer Edition";
     requireSigning = false;
@@ -71,6 +75,8 @@
       sha512 = "a65a522130d95ef5ffd4ee351c79a64517abdd60a80a74e66b147f6b179613240ab2abd6eb9cd939dfe31dd5b971773e882eb234a358e9546ab0272d8ed94145";
     };
 
+    extraConfigureFlags = [ "--with-app-name=${binaryName}" ];
+
     meta = {
       changelog = "https://www.mozilla.org/en-US/firefox/${lib.versions.majorMinor version}beta/releasenotes/";
       description = "A web browser built from Firefox Developer Edition source tree";
@@ -82,7 +88,7 @@
                                              # not in `badPlatforms` because cross-compilation on 64-bit machine might work.
       maxSilent = 14400; # 4h, double the default of 7200s (c.f. #129212, #129115)
       license = lib.licenses.mpl20;
-      mainProgram = "firefox";
+      mainProgram = binaryName;
     };
     tests = [ nixosTests.firefox-devedition ];
     updateScript = callPackage ./update.nix {
@@ -94,6 +100,7 @@
 
   firefox-esr-115 = buildMozillaMach rec {
     pname = "firefox-esr-115";
+    binaryName = "firefox-esr";
     version = "115.8.0esr";
     applicationName = "Mozilla Firefox ESR";
     src = fetchurl {
@@ -101,6 +108,8 @@
       sha512 = "4b8c06b5eb3617700a72aaad8831d703a537fe600740f1acb8377bd0ce198a199938603fd7e6b2007671a578dfb24aa8f5c031c6c1ccf15d4a34562679eaa883";
     };
 
+    extraConfigureFlags = [ "--with-app-name=${binaryName}" ];
+
     meta = {
       changelog = "https://www.mozilla.org/en-US/firefox/${lib.removeSuffix "esr" version}/releasenotes/";
       description = "A web browser built from Firefox Extended Support Release source tree";
07:35:22
@vcunat:matrix.orgvcunatYou can always create a tiny package that produces just a set of symlinks named exactly like you want them, pointing to firefoxes that you want. 07:35:27
@zeorin:matrix.orgXandor SchieferNope, I have to change the build, this is—as far as I can tell—fundamentally unfixable in the wrapper stage.07:35:57
@zeorin:matrix.orgXandor Schiefer *

I.e. something like this:

modified   pkgs/applications/networking/browsers/firefox/packages.nix
@@ -33,6 +33,7 @@
 
   firefox-beta = buildMozillaMach rec {
     pname = "firefox-beta";
+    binaryName = "firefox-beta";
     version = "124.0b2";
     applicationName = "Mozilla Firefox Beta";
     src = fetchurl {
@@ -40,6 +41,8 @@
       sha512 = "a98bedcf2bb6e58a20b4ab49d53db0899ed7c6589b20266522521c3db5c583807be1d536a580a1b42dd5783c0d81d95c4f42be6a157fb08a588447ca4fa21dde";
     };
 
+    extraConfigureFlags = [ "--with-app-name=${binaryName}" ];
+
     meta = {
       changelog = "https://www.mozilla.org/en-US/firefox/${lib.versions.majorMinor version}beta/releasenotes/";
       description = "A web browser built from Firefox Beta Release source tree";
@@ -51,7 +54,7 @@
                                              # not in `badPlatforms` because cross-compilation on 64-bit machine might work.
       maxSilent = 14400; # 4h, double the default of 7200s (c.f. #129212, #129115)
       license = lib.licenses.mpl20;
-      mainProgram = "firefox";
+      mainProgram = binaryName;
     };
     tests = [ nixosTests.firefox-beta ];
     updateScript = callPackage ./update.nix {
@@ -62,6 +65,7 @@
 
   firefox-devedition = buildMozillaMach rec {
     pname = "firefox-devedition";
+    binaryName = "firefox-developer-edition";
     version = "124.0b2";
     applicationName = "Mozilla Firefox Developer Edition";
     requireSigning = false;
@@ -71,6 +75,8 @@
       sha512 = "a65a522130d95ef5ffd4ee351c79a64517abdd60a80a74e66b147f6b179613240ab2abd6eb9cd939dfe31dd5b971773e882eb234a358e9546ab0272d8ed94145";
     };
 
+    extraConfigureFlags = [ "--with-app-name=${binaryName}" ];
+
     meta = {
       changelog = "https://www.mozilla.org/en-US/firefox/${lib.versions.majorMinor version}beta/releasenotes/";
       description = "A web browser built from Firefox Developer Edition source tree";
@@ -82,7 +88,7 @@
                                              # not in `badPlatforms` because cross-compilation on 64-bit machine might work.
       maxSilent = 14400; # 4h, double the default of 7200s (c.f. #129212, #129115)
       license = lib.licenses.mpl20;
-      mainProgram = "firefox";
+      mainProgram = binaryName;
     };
     tests = [ nixosTests.firefox-devedition ];
     updateScript = callPackage ./update.nix {
@@ -94,6 +100,7 @@
 
   firefox-esr-115 = buildMozillaMach rec {
     pname = "firefox-esr-115";
+    binaryName = "firefox-esr";
     version = "115.8.0esr";
     applicationName = "Mozilla Firefox ESR";
     src = fetchurl {
@@ -101,6 +108,8 @@
       sha512 = "4b8c06b5eb3617700a72aaad8831d703a537fe600740f1acb8377bd0ce198a199938603fd7e6b2007671a578dfb24aa8f5c031c6c1ccf15d4a34562679eaa883";
     };
 
+    extraConfigureFlags = [ "--with-app-name=${binaryName}" ];
+
     meta = {
       changelog = "https://www.mozilla.org/en-US/firefox/${lib.removeSuffix "esr" version}/releasenotes/";
       description = "A web browser built from Firefox Extended Support Release source tree";

(and then also not setting nameSuffix for these in the wrapFirefox call)

07:36:50
@vcunat:matrix.orgvcunatThen I'm missing the nature of the collision.07:36:51
@vcunat:matrix.orgvcunatI thought it's the usual thing about env having files with the same path.07:37:08
@zeorin:matrix.orgXandor Schiefer When a file is wrapped, its pre-wrapped version is usually moved to ".${name}.old", and that's still part of the package's /bin output. 07:38:30
@zeorin:matrix.orgXandor Schiefer Because the original binary names for the nixpkgs non-bin versions are all just firefox, they all get a .firefox-old file, too 07:39:26
@vcunat:matrix.orgvcunatThe tiny package that I suggested would only contain files that you want with names that you want, nothing else.07:39:26
@zeorin:matrix.orgXandor SchieferAnd those collide07:39:29
@zeorin:matrix.orgXandor Schiefer * When a file is wrapped, its pre-wrapped version is usually moved to ".${name}-old", and that's still part of the package's /bin output. 07:39:38
@zeorin:matrix.orgXandor SchieferOr we could just fix the root issue 🤷07:39:48
@vcunat:matrix.orgvcunat * The tiny package that I suggested would only contain files (links) that you want with names that you want, nothing else.07:39:51
@zeorin:matrix.orgXandor SchieferAFK for a few, have to handle something07:40:53
@zeorin:matrix.orgXandor SchieferBack07:49:35

Show newer messages


Back to Room ListRoom Version: 9