Commit bf63690b authored by Andrew Marshall's avatar Andrew Marshall
Browse files

bitwarden-desktop: fix build and guard against breakage

`dbus-run-session` execs, so does not carry-over shell functions.
Previously, we had explicitly exported just the functions we needed.
However, what is needed has recently changed due to changes in
`cargoCheckHook`. Instead, export all functions so we are not so coupled
to the implementation. Do this in a subshell to avoid polluting the rest
of the build.
parent a3c0b3b2
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -146,14 +146,17 @@ in buildNpmPackage rec {
  checkPhase = ''
    runHook preCheck

    pushd ${cargoRoot}
    (
      cd ${cargoRoot}
      export HOME=$(mktemp -d)
    export -f cargoCheckHook runHook _eval _callImplicitHook _logHook
      export cargoCheckType=release
      for function in $(declare -F | awk '{print $3}'); do
        export -f "$function"
      done
      dbus-run-session \
        --config-file=${dbus}/share/dbus-1/session.conf \
        -- bash -e -c cargoCheckHook
    popd
    )

    runHook postCheck
  '';