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

Fix robolectric test runtime failures due to x-large classpath #15487

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,18 @@ if [ -z "$CLASSPATH_LIMIT" ]; then
fi

if (("${#CLASSPATH}" > ${CLASSPATH_LIMIT})); then
export JACOCO_IS_JAR_WRAPPED=1
create_and_run_classpath_jar
java_ver=$(JAVABIN --version 2>&1) | head -1
if [[ "$java_ver" =~ [^.0-9]1[.][1-8] ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

This regex will accept versions 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8. Just want to double-check that this is the expected behavior. Do you care about version 1.0?

# Arguments file is not supported by Java SDK version 1.8 and earlier, use classpath jar as fallback
export JACOCO_IS_JAR_WRAPPED=1
create_and_run_classpath_jar
else
# Using argument file is more robust and efficient than Classpath jar
ARGS_FILE="$(mktemp -t XXXXXXXX.args)"
ted-xie marked this conversation as resolved.
Show resolved Hide resolved
echo "-cp "$CLASSPATH >> $ARGS_FILE
exec $JAVABIN @$ARGS_FILE "${ARGS[@]}"
rm $ARGS_FILE
fi
else
exec $JAVABIN -classpath $CLASSPATH "${ARGS[@]}"
fi