Fix multiple build failures for different projects (#10055)

Fix issues in g-http-java-client, closure-compiler and opencensus-java.
This commit is contained in:
Henry Lin 2023-04-11 06:49:14 +02:00 committed by GitHub
parent 3d7db74ff4
commit fbc3b3452b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 21 additions and 18 deletions

View File

@ -57,7 +57,7 @@ else
$MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2
cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/
RUNTIME_CLASSPATH_ABSOLUTE="$(cat fuzz-targets/cp.txt):$OUT/test-classes:$(echo $ALL_JARS | xargs printf -- "$OUT/%s:")."
RUNTIME_CLASSPATH_RELATIVE=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed "s|$OUT|.|g")
RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed "s|$OUT|\$this_dir|g")
for fuzzer in $(find $SRC/project-parent/fuzz-targets -name '*Fuzzer.java'); do
fuzzer_basename=$(basename -s .java $fuzzer)
@ -65,12 +65,13 @@ else
# Create an execution wrapper for every fuzztarget
echo "#!/bin/bash
# LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure.
this_dir=\$(dirname \"\$0\")
if [[ \"\$@\" =~ (^| )-runs=[0-9]+($| ) ]]; then
mem_settings='-Xmx1900m -Xss900k'
else
mem_settings='-Xmx2048m -Xss1024k'
fi
java -cp $RUNTIME_CLASSPATH_RELATIVE \
java -cp $RUNTIME_CLASSPATH \
\$mem_settings \
com.code_intelligence.jazzer.Jazzer \
--target_class=com.example.$fuzzer_basename \

View File

@ -20,7 +20,7 @@
<dependency>
<groupId>com.code-intelligence</groupId>
<artifactId>jazzer-junit</artifactId>
<version>0.16.0</version>
<version>0.15.0</version>
</dependency>
<dependency>

View File

@ -11,5 +11,4 @@ vendor_ccs:
- "glendowne@code-intelligence.com"
- "patrice.salathe@code-intelligence.com"
- "hlin@code-intelligence.com"
- "bug-disclosure@code-intelligence.com"
run_tests: False
- "bug-disclosure@code-intelligence.com"

View File

@ -24,8 +24,12 @@ MAVEN_ARGS="-Djavac.src.version=15 -Djavac.target.version=15 -Denforcer.skip=tru
function set_project_version_in_fuzz_targets_dependency {
PROJECT_VERSION=$(cd $PROJECT && $MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)
# set dependency project version in fuzz-targets
(cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID:$PROJECT_ARTIFACT_ID -DdepVersion=$PROJECT_VERSION -DforceVersion=true)
FUZZ_TARGET_DEPENDENCIES=":google-http-client :google-http-client-gson"
for dependency in $FUZZ_TARGET_DEPENDENCIES; do
# set dependency project version in fuzz-targets
(cd fuzz-targets && $MVN versions:use-dep-version -Dincludes=$PROJECT_GROUP_ID$dependency -DdepVersion=$PROJECT_VERSION -DforceVersion=true)
done
}
cd project-parent
@ -55,7 +59,7 @@ else
# build classpath
$MVN -pl fuzz-targets dependency:build-classpath -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2
cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/test-classes
cp -r $SRC/project-parent/fuzz-targets/target/test-classes/ $OUT/
RUNTIME_CLASSPATH_ABSOLUTE="$(cat fuzz-targets/cp.txt):$OUT/test-classes"
# replace dirname with placeholder $this_dir that will be replaced at runtime
RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed "s|$OUT|\$this_dir|g")

View File

@ -39,13 +39,13 @@
<dependency>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client</artifactId>
<version>1.43.2-SNAPSHOT</version>
<version>Fuzzing-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client-gson</artifactId>
<version>1.43.2-SNAPSHOT</version>
<version>Fuzzing-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@ -20,7 +20,7 @@
<dependency>
<groupId>com.code-intelligence</groupId>
<artifactId>jazzer-junit</artifactId>
<version>0.16.0</version>
<version>0.15.0</version>
</dependency>
<dependency>
@ -41,7 +41,7 @@
<artifactId>opencensus-api</artifactId>
<version>${env.OPENCENSUS_JAVA_VERSION}</version>
<scope>system</scope>
<systemPath>${basedir}/../opencensus-java/api/build/libs/opencensus-api-0.32.0-SNAPSHOT.jar</systemPath>
<systemPath>${basedir}/../opencensus-java/api/build/libs/opencensus-api-${env.OPENCENSUS_JAVA_VERSION}.jar</systemPath>
</dependency>
<dependency>
@ -49,7 +49,7 @@
<artifactId>opencensus-impl</artifactId>
<version>${env.OPENCENSUS_JAVA_VERSION}</version>
<scope>system</scope>
<systemPath>${basedir}/../opencensus-java/impl/build/libs/opencensus-impl-0.32.0-SNAPSHOT.jar</systemPath>
<systemPath>${basedir}/../opencensus-java/impl/build/libs/opencensus-impl-${env.OPENCENSUS_JAVA_VERSION}.jar</systemPath>
</dependency>
<dependency>
@ -57,7 +57,7 @@
<artifactId>opencensus-impl-core</artifactId>
<version>${env.OPENCENSUS_JAVA_VERSION}</version>
<scope>system</scope>
<systemPath>${basedir}/../opencensus-java/impl_core/build/libs/opencensus-impl-core-0.32.0-SNAPSHOT.jar</systemPath>
<systemPath>${basedir}/../opencensus-java/impl_core/build/libs/opencensus-impl-core-${env.OPENCENSUS_JAVA_VERSION}.jar</systemPath>
</dependency>
<dependency>
@ -65,7 +65,7 @@
<artifactId>opencensus-exporter-trace-util</artifactId>
<version>${env.OPENCENSUS_JAVA_VERSION}</version>
<scope>system</scope>
<systemPath>${basedir}/../opencensus-java/exporters/trace/util/build/libs/opencensus-exporter-trace-util-0.32.0-SNAPSHOT.jar</systemPath>
<systemPath>${basedir}/../opencensus-java/exporters/trace/util/build/libs/opencensus-exporter-trace-util-${env.OPENCENSUS_JAVA_VERSION}.jar</systemPath>
</dependency>
<dependency>
@ -73,7 +73,7 @@
<artifactId>opencensus-contrib-resource-util</artifactId>
<version>${env.OPENCENSUS_JAVA_VERSION}</version>
<scope>system</scope>
<systemPath>${basedir}/../opencensus-java/contrib/resource_util/build/libs/opencensus-contrib-resource-util-0.32.0-SNAPSHOT.jar</systemPath>
<systemPath>${basedir}/../opencensus-java/contrib/resource_util/build/libs/opencensus-contrib-resource-util-${env.OPENCENSUS_JAVA_VERSION}.jar</systemPath>
</dependency>
<dependency>

View File

@ -11,5 +11,4 @@ vendor_ccs:
- "glendowne@code-intelligence.com"
- "patrice.salathe@code-intelligence.com"
- "hlin@code-intelligence.com"
- "bug-disclosure@code-intelligence.com"
run_tests: False
- "bug-disclosure@code-intelligence.com"