Commit Graph

221 Commits

Author SHA1 Message Date
Sergei Trofimovich
b3b672d5a1 setup-hooks/separate-debug-info.sh: don't inhibit strip hook
Before the change separate-debug-info.sh did the stripping itself.
This scheme has a few problems:
1. Stripping happens only on ELF files. *.a and *.o files are skipped.
   Derivations have to do it manually. Usually incorrectly
   as they don't run $RANLIB (true for `glibc` and `musl`).
2. Stripping happens on all paths. Ideally only `stripDebugList` paths
   should be considered.
3. Host strip is called on Target files.

This change offloads stripping logic to strip hook. This strips more
files for `glibc` and `musl`. Now we can remove most $STRIP calls
from individual derivations.

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2022-08-07 12:49:37 +01:00
Sandro
7b270bf098
firefox-unwrapped: use pname+version 2022-08-02 14:22:42 +02:00
Martin Weinelt
a168249ddc
firefox-unwrapped: 102.0.1 -> 103.0
https://www.mozilla.org/en-US/firefox/103.0/releasenotes/
https://www.mozilla.org/en-US/security/advisories/mfsa2022-28/

Fixes: CVE-2022-36319, CVE-2022-36317, CVE-2022-36318, CVE-2022-36314,
       CVE-2022-36315, CVE-2022-36316, CVE-2022-36320, CVE-2022-2505
2022-07-26 15:05:04 +02:00
github-actions[bot]
6eeef3eaa8
Merge master into staging-next 2022-06-13 00:02:20 +00:00
Martin Weinelt
d5a87edeab
buildMozillaMach: allow PGO on all Linux platforms
Tested on the aarch64 community builder and it didn't get stuck like
back when we first tried to enable PGO.
2022-06-12 12:42:14 +02:00
Martin Weinelt
299b9a1b59
buildMozillaMach: add patch for rust-cbindgen 0.24 compat
Fixes a regression caused by an update to rust-cbindgen 0.24.x, where
the definition for ROOT_CLIP_CHAIN is now autogenerated and causes the
build to abort with a redefinition error.

https://bugzilla.mozilla.org/show_bug.cgi?id=1773259

Patch by Ollivier Tilloy from Canonical

5622734942
2022-06-08 22:03:31 +02:00
Sergei Trofimovich
4b88d42f51 firefox: disable 'MOZILLA_OFFICIAL=1' on i686
Without the change firefox build on i686 fails at configure time:

    $ NIXPKGS_ALLOW_BROKEN=1 nix build -f. --argstr system "i686-linux" firefox
    ...
    mozbuild.configure.options.InvalidOptionError:
      '--enable-release' implied by 'MOZILLA_OFFICIAL' conflicts with '--disable-release' from the command-line

The change uses the same 32-bit guard for both. It still does not allow
i686 build to succeed for other toolchain misconfiguration, but it's a
step forward.
2022-06-05 08:44:41 -05:00
Martin Weinelt
c5e0d57cdd
Merge pull request #173738 from mweinelt/firefox-mls 2022-05-24 20:08:46 +02:00
Martin Weinelt
2d97db7873
buildMozillaMach: set geo.provider.network.url for new profiles.
Use Mozilla Location Service as geolocation provider for new profiles,
since our Google API key does not seem to work for geolocation at this
time.

Related: https://github.com/NixOS/nixpkgs/issues/173758
2022-05-22 14:49:17 +02:00
Martin Weinelt
0750e47a4d
buildMozillaMach: Clean up Google API key configuration
Use a proper filename that and add the URL where information about
requesting API keys can be found.
2022-05-22 01:51:07 +02:00
Martin Weinelt
1ba9dfbd97
buildMozillaMach: add support for MLS
We have received our very own API key for Mozilla Location Services and
have been recognized as a Public Interest Project, implying a rate limit
of 100k daily requests¹, which should be sufficient for our population.

N.B: This key belongs to the NixOS project, please don't use ours, but
instead request your own.

[1] https://location.services.mozilla.com/terms
2022-05-22 01:50:56 +02:00
Jan Tojnar
b8b9f52393 Merge branch 'master' into staging-next
Conflicts:
- pkgs/applications/networking/browsers/firefox/common.nix between 318fae87c0 and f6c5761935.
2022-05-21 17:52:39 +02:00
Martin Weinelt
318fae87c0
buildMozillaMach: Add distribution identifier and distribution.ini
Adds a distribution id useful for aggregation of crash statistics.

Also creates a NixOS flavor, visible through the About window, that is
also exposed through telemetry data, if enabled.
2022-05-19 23:12:47 +02:00
Shea Levy
7456be85db
Merge branch 'staging-next' into staging 2022-05-18 06:40:21 -04:00
squalus
4a1f7f8472 buildMozillaMach: fix builds with crash reporting disabled
- only try to build and copy crash reporting symbols when crash
  reporting is enabled
- fixes the librewolf build
2022-05-16 13:52:15 -07:00
Jan Tojnar
d1b77f990f Merge branch 'staging-next' into staging
Conflicts:
	pkgs/applications/networking/browsers/firefox/common.nix between f6c5761935 and a373324120.
2022-05-15 07:08:29 +02:00
Martin Weinelt
a179998a06
buildMozillaMach: Update native python env var
With Firefox 100.0 the following deprecation warning comes up:

> The "MACH_USE_SYSTEM_PYTHON" environment variable is deprecated,
> please unset it or replace it with either
> "MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system" or
> "MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none"

And since we want to continue using our own python we're going for the
system value when the version is at least 100.0.
2022-05-13 17:31:40 +02:00
Martin Weinelt
a373324120
buildMozillaMach: create symbols output
Thie zip bundle in this output is used in the dumps sent by the
crashreporter. For this to happen we need to upload this zip file to
https://symbols.mozilla.org, which is a separate effort.
2022-05-13 17:31:39 +02:00
Nick Cao
f6c5761935
firefox-unwrapped: fix cross compilation 2022-05-13 13:28:52 +08:00
davidak
a2c863ce2f
Merge pull request #171900 from kevincox/firefox-crashreporter
firefox: Enable crash reporter by default.
2022-05-11 16:50:20 +02:00
S. Nordin Abouzahra
0bafb3baa7 firefox: support JACK and sndio audio backends
You can set `media.cubeb.backend` in `about:config` to force a specific
backend.
2022-05-07 18:36:06 -04:00
Kevin Cox
4206661e5d
firefox: Enable crash reporter by default.
This makes it easier to report bugs upstream and ensures that NixOS user crashes are fixed.

Based on my testing these reports weren't automatically submitted anyways so the privacy concern is minimal. For my crashes it both asked my if a crash report should be produced after a crash, and required manual sending. Although possibly the report world eventually be sent automatically.

Fixes https://github.com/NixOS/nixpkgs/issues/107889
2022-05-06 22:24:42 -04:00
Martin Weinelt
3f2a09af84
firefox: 99.0.1 -> 100.0
https://www.mozilla.org/en-US/firefox/100.0/releasenotes/
https://www.mozilla.org/en-US/security/advisories/mfsa2022-16/

Fixes: CVE-2022-29914, CVE-2022-29909, CVE-2022-29911, CVE-2022-29912,
       CVE-2022-29910, CVE-2022-29915, CVE-2022-29917, CVE-2022-29918
2022-05-03 15:34:02 +02:00
Martin Weinelt
849242b667
Merge pull request #171312 from SuperSandro2000/firefox 2022-05-03 01:21:07 +02:00
Sandro Jäckel
fddfaa3b72
firefox: remove unused option 2022-05-02 22:15:56 +02:00
Ben Siraphob
259fa13d53 treewide: remove nativeBuildInputs that are in stdenv 2022-04-16 21:46:46 +03:00
ajs124
f3d301ab81 thunderbird{-bin}|firefox|librewolf: use nss_latest for regular releases
and nss_esr for esr releases
2022-04-03 13:14:07 +01:00
Bernardo Meurer
a158af0b1b
Merge pull request #165964 from mweinelt/firefox-hwdec 2022-03-29 09:16:18 -07:00
Martin Weinelt
6cdf69546b
firefox: allow RDD sandbox access to gpu drivers
Firefox uses a sandboxing model that only allows access to paths that
were previously explicitly granted. We can only add granular permissions
to a specific sandbox by patching, because setting LD_LIBRARY_PATH would
affect all of them.

To use hardware decoding via VA-API with Firefox 98.0.2 one needs to
head to `about:config` and enable `media.ffmpeg.vaapi.enabled`.

Closes: #157061
2022-03-29 15:44:06 +02:00
Bernardo Meurer
0e3d0d844e
Merge pull request #166078 from mweinelt/firefox-drm
firefox: fix drmSupport flag
2022-03-28 12:49:42 -07:00
Martin Weinelt
2cb9593cad firefox: always build with clang
Both LTO and PGO require the use of clang so I think its easier to just
stick with clang for all builds, so PGO and LTO could in theory be used
without each other.
2022-03-28 21:42:49 +02:00
Martin Weinelt
4cf4a7b848 firefox: add pname to throw message
https://github.com/NixOS/nixpkgs/pull/164646#discussion_r835879348
2022-03-28 21:42:49 +02:00
Martin Weinelt
0d3772f645 firefox: add profile-guided optimization
Lo and behold, we're finally catching up with Mozillas very own firefox
build in terms of speed.

PGO is an optimization technique in which in a first step we create a
build that supports instrumentation, meaning we can use it to create a
profile of how the browser behaved during usage. Then in a second pass
we create the final build that uses the acquired profiling data to
optimize the browser for the workload it actually received during
profiling.

The downside is that with PGO we now need to build Firefox twice, which
increases the build time from around 20 minutes to roughly 50 minutes.

In the Speedometer 2.0 benchmark multiple tests could see a
responsiveness improvemeant around 20-25%, which makes the increased
build time well worth it.

Sadly this benefit seems limited to x86_64-linux, builds on
aarch64-linux get stuck during profiling and I haven't found out why.

Finally, after a long time, we can say:

Closes: #76484
Supersedes: #129503
2022-03-28 21:42:49 +02:00
Martin Weinelt
2a32474802
firefox: fix drmSupport flag
In #109133 @alyssais discovered that the drmSupport flag stopped
working. This is because Mozilla decided around Firefox 51
(mozbz#1289634) to swap the default values and our flag was asking for
the wrong thing all along.

Since this flag has now been enabled for multiple years, disabling it
would mean a regression for our users. Leaving it enabled should be
unproblematic since it only controls whether Firefox shows the EME nagbar,
that allows to enable Widevine CDM, when a site requests it. The choice is
therefore completely up to the enduser.

Disabling this nagbar is still possible at runtime by setting
`browser.eme.ui.enabled` to `false`. If Widevine CDM was inadvertently
enabled it can be disabled at `media.gmp-widevinecdm.enabled`.

Supersedes: #109133
2022-03-28 18:12:02 +02:00
Martin Weinelt
b3529accfb
firefox: reformat, sort, cleanup
It is normal for such a large derivation to accumulate mixed codestyles
over all those years making it harder to maintain.

By splitting up dependencies to one per line I noticed two unused
dependencies (hunspell, sqlite) that were removed in this change.

Also most lists are now sorted alphabetically, so reasoning about them
has become much easier.

Lists now use the same style for indentation and concat, and environment
variables are all defined in preConfigure as opposed to bare in the
derivation.

The object dir, firefox build directory, is now in a predictable
directory at ${pwd}/mozobj as opposed to ${pwd}/obj-@CONFIG_GUESS@,
saving us one wildcard expansion. This is also a good prepration for the
PGO build where we need to reference bits inside this directory.

Added a few comments and clarified others from what I've learned how the
firefox build works.
2022-03-23 17:03:42 +01:00
Martin Weinelt
178d447610
firefox: pass pciutils via wrapper instead of patching it 2022-03-23 17:03:42 +01:00
Martin Weinelt
51e5f33899
firefox: fix system libffi usage
Since Firefox 51 the --enable-system-ffi flag was renamed to
--with-systemd-ffi when it moved to the javascript toolkit parts. Rename
the flag accordingly and reintroduce the dependency.

mozbz#1294803
2022-03-23 17:03:41 +01:00
Martin Weinelt
08ea534e67
firefox: drop darwin support
Darwin support was marked broken in 2019 with Firefox 69 and has missed
therefore missed out and not been tested on the following 29 major
releases since.

It cannot be supported again without a darwin user stepping up to take
care and work on and test every major release, which hasn't happened
since I took over maintainership.

The recommendation of the people that tend to the firefox source build
is for darwin users to use firefox-bin instead.
2022-03-23 17:03:41 +01:00
Martin Weinelt
71d879b16b
firefox: drop pipewire from build inputs
Firefox does not support passing pipewire as a system library and
instead relies on a vendored copy it ships. We keep the flag because it
is tied into the wrapper, because we still need to have access to its
libraries at runtime.
2022-03-23 17:03:41 +01:00
Martin Weinelt
48eabf6838
firefox: drop hint regarding system cairo
Building with system cairo has been unsupported since Firefox 60
(mozbz#1432751) and the flag was removed in 2021 with Firefox 92
(mozbz#1722653).
2022-03-23 17:03:41 +01:00
Martin Weinelt
25e22d96ba
firefox: enable necko wifi scanner
Tied to the geolocation support flag. On Linux this uses the DBus
interface of NetworkManager to query visible accesspoints and relay them
to Mozilla location service in return for position approximation.
2022-03-23 17:03:41 +01:00
Martin Weinelt
e921e84e9d
firefox: don't set BUILD_OFFICIAL
It was removed in 2009 in favor of MOZILLA_OFFICIAL

mozbz#435923
2022-03-23 17:03:40 +01:00
Martin Weinelt
cfcc611cb4
firefox: use our own libwebp 2022-03-23 17:03:40 +01:00
Martin Weinelt
2f31fe95fd
firefox: rename patches arg to extraPatches
This is for consistency with other extra arguments that can be handed to
firefox common.nix.

Also pull the patch phase of the derivation closer together and use the
same list concat style as elsewhere.
2022-03-23 17:03:40 +01:00
Martin Weinelt
350f1345a7
firefox: unpin autoconf & icu, drop yasm
Let's not be the package that is stuck on arbitrarily old dependency
versions that should be removed anyway.
2022-03-23 17:03:40 +01:00
Martin Weinelt
3ec7f8d487
firefox: set consistent remoting name
With Firefox 98.0 the remoting name now depends on the update channel
(mozbz#1752418), which resulted in a weird app_id/wmclass of
`firefox-default`, which broke window association in GNOME and likely
other desktops.

Fixes: #165107
2022-03-23 02:13:20 +01:00
Martin Weinelt
1530477650
firefox: enable RLBox sandboxing
https://hacks.mozilla.org/2021/12/webassembly-and-back-again-fine-grained-sandboxing-in-firefox-95/

Co-authored-by: Jörg Thalheim <joerg@thalheim.io>
2022-03-14 00:17:28 +01:00
Guillaume Girol
e60782c7fa firefox: use rustPlatform.bindgenHook 2022-02-22 19:41:32 +01:00
squalus
82a7fac5af librewolf: init at 97.0-2 2022-02-12 10:31:25 -08:00
Martin Weinelt
38219f7cc7
firefox-esr-91: 91.5.1esr -> 91.6.0esr 2022-02-07 18:12:54 +01:00