Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nix] use 'nix build --keep-failed' for vcs sim profile flow #895

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 8 additions & 15 deletions nix/t1/run/run-vcs-emu.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,6 @@ stdenvNoCC.mkDerivation (rec {

passthru = {
caseName = testCase.pname;

# to open 'profileReport.html' in firefox,
# set 'security.fileuri.strict_origin_policy = false' in 'about:config'
profile = writeShellScriptBin "runSimProfile" ''
${emuDriver} \
${lib.escapeShellArgs emuDriverArgs} \
-simprofile time \
2> ${testCase.pname}-rtl-event.jsonl
'';
};

emuDriver = "${emulator}/bin/${emulator.mainProgram}";
Expand All @@ -55,12 +46,6 @@ stdenvNoCC.mkDerivation (rec {
];

buildCommand = ''
${lib.optionalString emulator.enableProfile ''
echo "ERROR: 'enableProfile = true' is inherently nondetermistic"
echo " use 'nix run <...>.profile --impure' instead"
exit 1
''}

mkdir -p "$out"

emuDriverArgs="${lib.escapeShellArgs emuDriverArgs}"
Expand All @@ -82,6 +67,13 @@ stdenvNoCC.mkDerivation (rec {

echo "[nix] VCS run done"

${lib.optionalString emulator.enableProfile ''
# we do not want to cache profile results, it's nondetermistic intentionally
echo "ERROR: 'enableProfile = true' fails intentionally"
echo " use 'nix run <...> --impure --keep-failed' to see results"
exit 1
''}

if [ ! -r "$rtlEventOutPath" ]; then
echo -e "[nix] \033[0;31mInternal Error\033[0m: no $rtlEventOutPath found in output"
exit 1
Expand Down Expand Up @@ -111,6 +103,7 @@ stdenvNoCC.mkDerivation (rec {
printf "$?" > $out/offline-check-status
if [ "$(cat $out/offline-check-status)" != "0" ]; then
echo "[nix] Offline check FAIL"
exit 1
else
echo "[nix] Offline check PASS"
fi
Expand Down
Loading