hack/module.sh: sort modules for deterministic runs

find(1) seems to look at directory entries in the order in which they exist
in the directory fs entry. Let's sort these so that we get the same results
regardless of the order of the directory entries.

Signed-off-by: Andrew Keesler <akeesler@vmware.com>
This commit is contained in:
Andrew Keesler 2020-08-12 09:36:33 -04:00
parent 4cb0fd3949
commit ed9fdce6a8
No known key found for this signature in database
GPG Key ID: 27CE0444346F9413

View File

@ -49,7 +49,7 @@ function with_modules() {
cmd="$(${cmd_function})" cmd="$(${cmd_function})"
pushd "${root_dir}" pushd "${root_dir}"
for mod_file in $(find . -maxdepth 4 -name go.mod); do for mod_file in $(find . -maxdepth 4 -name go.mod | sort); do
mod_dir="$(dirname "${mod_file}")" mod_dir="$(dirname "${mod_file}")"
( (
echo "=> " && \ echo "=> " && \