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.
This commit is contained in:
Andrew Marshall 2024-10-15 15:03:22 -04:00
parent a3c0b3b215
commit bf63690b2e

View File

@ -146,14 +146,17 @@ in buildNpmPackage rec {
checkPhase = ''
runHook preCheck
pushd ${cargoRoot}
export HOME=$(mktemp -d)
export -f cargoCheckHook runHook _eval _callImplicitHook _logHook
export cargoCheckType=release
dbus-run-session \
--config-file=${dbus}/share/dbus-1/session.conf \
-- bash -e -c cargoCheckHook
popd
(
cd ${cargoRoot}
export HOME=$(mktemp -d)
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
)
runHook postCheck
'';