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

setup.sh: verify that find is from findutils #177693

Closed
wants to merge 3 commits 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
9 changes: 9 additions & 0 deletions pkgs/stdenv/generic/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,15 @@ configurePhase() {
fixLibtool "$i"
done

# Make sure `find` is the full `find` from findutils, rather
# than from busybox or some other implementation. This is
# analogous to `shellcheck shell=bash` at the top of this
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shellcheck is a tool to verify if shell scripts are valid, it's unrelated to checking if the correct shell is used.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:embarrassed:

# file.
if (( $(find --version | grep -q 'GNU findutils') != 0 )); then
echo 'The find contained in $PATH is not the GNU variant from the findutils package.'
exit 1
fi

# replace `/usr/bin/file` with `file` in any `configure`
# scripts with vendored libtool code. Preserve mtimes to
# prevent some packages (e.g. libidn2) from spontaneously
Expand Down