From bcd139c12552c1c2c394b0cc636cdd4d4db9da1d Mon Sep 17 00:00:00 2001 From: Alexander Williams Date: Wed, 2 Aug 2023 17:30:40 -0700 Subject: [PATCH] [ci] Copy ROM artifacts from correct targets The ELF and BIN outputs were not looked up from the correct targets. Adjust the publishing script to retrieve files by starting from the opentitan_rom_binary, crossing the transition through the graph, and querying for all unique output files. Signed-off-by: Alexander Williams --- azure-pipelines.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f44e29a558736..0bc9582b14da3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -262,14 +262,17 @@ jobs: # copy the rom to a specific location ROM_TARGET="${BIN_DIR}/sw/device/silicon_creator/rom" mkdir -p "${ROM_TARGET}" - AUTHENTICITY=(fake real) - for authenticity in "${AUTHENTICITY[@]}"; do - ROM=$(ci/scripts/target-location.sh "//sw/device/silicon_creator/rom:rom_with_${authenticity}_keys_fpga_cw310_scr_vmem") - cp $ROM "${ROM_TARGET}/$(basename "${ROM}")" - ROM_DIR=$(dirname $ROM) - cp "${ROM_DIR}/rom_with_${authenticity}_keys_fpga_cw310.elf" "${ROM_TARGET}/" - cp "${ROM_DIR}/rom_with_${authenticity}_keys_fpga_cw310.bin" "${ROM_TARGET}/" - done + # To make the correct query to get the ELF output file, we have to start + # from a node that is built for our usual target platform (the host) and + # follow the edges in the graph across the configuration transition (to + # riscv32). The deps 2 levels down from the opentitan_rom_binary include + # all the important files. + ROM_REAL_TARGETS="deps(//sw/device/silicon_creator/rom:rom_with_real_keys_from_src_fpga_cw310, 2)" + ROM_FAKE_TARGETS="deps(//sw/device/silicon_creator/rom:rom_with_fake_keys_fpga_cw310, 2)" + QUERY_CMD_ARGS=(outquery-all --noinclude_aspects --noimplicit_deps) + ROM_REAL_FILES=($(./bazelisk.sh "${QUERY_CMD_ARGS[@]}" "${ROM_REAL_TARGETS}" | sort | uniq)) + ROM_FAKE_FILES=($(./bazelisk.sh "${QUERY_CMD_ARGS[@]}" "${ROM_FAKE_TARGETS}" | sort | uniq)) + cp -Lvt "${ROM_TARGET}" "${ROM_FAKE_FILES[@]}" "${ROM_REAL_FILES[@]}" - template: ci/upload-artifacts-template.yml parameters: includePatterns: