Skip to content

Commit 59af195

Browse files
author
Raul E Rangel
committed
misc-functions.sh: Sort NEEDED and NEEDED.ELF.2
I've noticed that scalelf doesn't produce deterministic output. This change adds a sort to the NEEDED and NEEDED.ELF.2 files to remove a source of non-determinism when building binpkgs. This change was cherry picked from: https://chromium-review.googlesource.com/c/chromiumos/third_party/portage_tool/+/4018820/2/bin/misc-functions.sh Bug: https://bugs.gentoo.org/914441 Signed-off-by: Raul E Rangel <[email protected]>
1 parent 08a2bc3 commit 59af195

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: bin/misc-functions.sh

+6
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,12 @@ install_qa_check() {
223223
echo "${obj} ${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED
224224
echo "${arch#EM_};${obj};${soname};${rpath};${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2
225225
done <<< ${scanelf_output}
226+
227+
# scanelf's output ordering is non-deterministic.
228+
local needed
229+
for needed in "${PORTAGE_BUILDDIR}"/build-info/NEEDED{,.ELF.2}; do
230+
sort -o "${needed}" "${needed}"
231+
done
226232
fi
227233

228234
[[ -n "${QA_SONAME_NO_SYMLINK}" ]] && \

0 commit comments

Comments
 (0)