From 354b731b63ba1ca5fbd5faf1291c314d3d31d9cd Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 11 May 2022 23:38:15 +0200 Subject: [PATCH 1/3] dump_syms: init at unstable-2022-05-05 --- pkgs/development/tools/dump_syms/default.nix | 46 ++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 48 insertions(+) create mode 100644 pkgs/development/tools/dump_syms/default.nix 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 8fe1c79cf7e..98d943b716a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5306,6 +5306,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 { }; From a373324120a271fdbff202b61895e06aecf98923 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 12 May 2022 14:40:21 +0200 Subject: [PATCH 2/3] 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. --- .../networking/browsers/firefox/common.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/applications/networking/browsers/firefox/common.nix b/pkgs/applications/networking/browsers/firefox/common.nix index 9321e491099..5fda096ee1d 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 @@ -408,7 +415,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 ''; From a179998a0609adb6bd92cfc5d5f4324b99ce2871 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 12 May 2022 15:16:44 +0200 Subject: [PATCH 3/3] 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. --- .../networking/browsers/firefox/common.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/networking/browsers/firefox/common.nix b/pkgs/applications/networking/browsers/firefox/common.nix index 5fda096ee1d..25eb34c95e8 100644 --- a/pkgs/applications/networking/browsers/firefox/common.nix +++ b/pkgs/applications/networking/browsers/firefox/common.nix @@ -238,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