diff --git a/pkgs/applications/networking/browsers/firefox/common.nix b/pkgs/applications/networking/browsers/firefox/common.nix index 9321e491099..25eb34c95e8 100644 --- a/pkgs/applications/networking/browsers/firefox/common.nix +++ b/pkgs/applications/networking/browsers/firefox/common.nix @@ -23,6 +23,7 @@ # build time , autoconf , cargo +, dump_syms , makeWrapper , nodejs , perl @@ -168,6 +169,11 @@ buildStdenv.mkDerivation ({ inherit src unpackPhase meta; + outputs = [ + "out" + "symbols" + ]; + # Add another configure-build-profiling run before the final configure phase if we build with pgo preConfigurePhases = lib.optionals pgoSupport [ "configurePhase" @@ -196,6 +202,7 @@ buildStdenv.mkDerivation ({ nativeBuildInputs = [ autoconf cargo + dump_syms llvmPackages.llvm # llvm-objdump makeWrapper nodejs @@ -231,13 +238,17 @@ buildStdenv.mkDerivation ({ # Set consistent remoting name to ensure wmclass matches with desktop file export MOZ_APP_REMOTINGNAME="${binaryName}" - # Use our own python - export MACH_USE_SYSTEM_PYTHON=1 - # AS=as in the environment causes build failure # https://bugzilla.mozilla.org/show_bug.cgi?id=1497286 unset AS + '' + lib.optionalString (lib.versionAtLeast version "100.0") '' + # Use our own python + export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system + '' + lib.optionalString (lib.versionOlder version "100.0") '' + # Use our own python + export MACH_USE_SYSTEM_PYTHON=1 + '' + lib.optionalString (lib.versionAtLeast version "95.0") '' # RBox WASM Sandboxing export WASM_CC=${pkgsCross.wasi32.stdenv.cc}/bin/${pkgsCross.wasi32.stdenv.cc.targetPrefix}cc @@ -408,7 +419,13 @@ buildStdenv.mkDerivation ({ # tests were disabled in configureFlags doCheck = false; + # Generate build symbols once after the final build + # https://firefox-source-docs.mozilla.org/crash-reporting/uploading_symbol.html preInstall = '' + ./mach buildsymbols + mkdir -p $symbols/ + cp mozobj/dist/*.crashreporter-symbols.zip $symbols/ + cd mozobj ''; diff --git a/pkgs/development/tools/dump_syms/default.nix b/pkgs/development/tools/dump_syms/default.nix new file mode 100644 index 00000000000..a8c6821f27f --- /dev/null +++ b/pkgs/development/tools/dump_syms/default.nix @@ -0,0 +1,46 @@ +{ lib +, rustPlatform +, fetchFromGitHub +, pkg-config +, openssl +}: + +let + pname = "dump_syms"; + version = "unstable-2022-05-05"; +in +rustPlatform.buildRustPackage { + inherit pname version; + + src = fetchFromGitHub { + owner = "mozilla"; + repo = pname; + rev = "c2743d59b5aa321ade698f84b90f86b3d35a1b06"; + hash = "sha256-hWK9KrYqbfrF8b7i33InlTa/XkoZs+h49kUsKeSaAok="; + }; + + cargoSha256 = "sha256:0vsr867nl156wpxpw01bv9fxsp6rhj9vvpz2i2yhx4kjgr1qk1kw"; + + nativeBuildInputs = [ + pkg-config + ]; + + buildInputs = [ + openssl + ]; + + checkFlags = [ + # Disable tests that require network access + # ConnectError("dns error", Custom { kind: Uncategorized, error: "failed to lookup address information: Temporary failure in name resolution" })) }', src/windows/pdb.rs:725:56 + "--skip windows::pdb::tests::test_ntdll" + "--skip windows::pdb::tests::test_oleaut32" + ]; + + meta = with lib; { + changelog = "https://github.com/mozilla/dump_syms/releases/tag/v${version}"; + description = "Command-line utility for parsing the debugging information the compiler provides in ELF or stand-alone PDB files"; + license = licenses.asl20; + homepage = "https://github.com/mozilla/dump_syms/"; + maintainers = with maintainers; [ hexa ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c3226537e8b..eb1ed2c4b0d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5313,6 +5313,8 @@ with pkgs; autoreconfHook = buildPackages.autoreconfHook269; }; + dump_syms = callPackage ../development/tools/dump_syms { }; + dumptorrent = callPackage ../tools/misc/dumptorrent { }; duo-unix = callPackage ../tools/security/duo-unix { };