Skip to content
This repository has been archived by the owner on Apr 2, 2023. It is now read-only.

Remove GraalVM debug flags #167

Merged
merged 8 commits into from
Aug 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions google-cloud-graalvm-samples/graalvm-samples-quarkus/pom.xml
Expand Up @@ -25,6 +25,13 @@

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>${libraries.bom.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-universe-bom</artifactId>
Expand Down
7 changes: 7 additions & 0 deletions google-cloud-graalvm-support/pom.xml
Expand Up @@ -18,5 +18,12 @@
<version>${graalvm.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty-shaded</artifactId>
<version>${grpc.netty.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,56 @@
/*
* Copyright 2020-2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.cloud.graalvm.features.substitutions;

import com.oracle.svm.core.annotate.Substitute;
import com.oracle.svm.core.annotate.TargetClass;
import io.grpc.netty.shaded.io.netty.util.internal.logging.InternalLoggerFactory;
import io.grpc.netty.shaded.io.netty.util.internal.logging.JdkLoggerFactory;
import java.util.function.BooleanSupplier;

/**
* Substitutions for {@link InternalLoggerFactory} which are needed to avoid dynamic loading
* of logging library.
*/
@TargetClass(
className = "io.grpc.netty.shaded.io.netty.util.internal.logging.InternalLoggerFactory",
onlyWith = NettyInternalLoggerFactorySubstitutions.OnlyIfInClassPath.class
)
final class NettyInternalLoggerFactorySubstitutions {

@Substitute
private static InternalLoggerFactory newDefaultFactory(String name) {
return JdkLoggerFactory.INSTANCE;
}

static class OnlyIfInClassPath implements BooleanSupplier {

@Override
public boolean getAsBoolean() {
try {
// Note: Set initialize = false to avoid initializing the class when looking it up.
Class.forName(
"io.grpc.netty.shaded.io.netty.util.internal.logging.InternalLoggerFactory",
false,
Thread.currentThread().getContextClassLoader());
return true;
} catch (ClassNotFoundException e) {
return false;
}
}
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

@@ -1,8 +1,13 @@
Args = -H:+AllowIncompleteClasspath --report-unsupported-elements-at-runtime \
Args = --allow-incomplete-classpath \
--initialize-at-build-time=org.conscrypt \
--initialize-at-run-time=io.grpc.netty.shaded.io.netty.handler.ssl.OpenSsl,\
io.grpc.netty.shaded.io.netty.handler.ssl.OpenSslContext,\
io.grpc.netty.shaded.io.netty.handler.ssl.ReferenceCountedOpenSslEngine,\
io.grpc.netty.shaded.io.netty.handler.ssl.JdkNpnApplicationProtocolNegotiator,\
io.grpc.netty.shaded.io.netty.handler.ssl.JettyAlpnSslEngine,\
io.grpc.netty.shaded.io.netty.handler.ssl.JettyAlpnSslEngine$ClientEngine,\
io.grpc.netty.shaded.io.netty.handler.ssl.JettyAlpnSslEngine$ServerEngine,\
io.grpc.netty.shaded.io.netty.handler.ssl.JettyNpnSslEngine,\
io.grpc.netty.shaded.io.netty.internal.tcnative.SSL,\
io.grpc.netty.shaded.io.netty.internal.tcnative.CertificateVerifier,\
io.grpc.netty.shaded.io.netty.internal.tcnative.SSLPrivateKeyMethod,\
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Expand Up @@ -8,6 +8,7 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<graalvm.version>21.2.0</graalvm.version>
<grpc.netty.version>1.39.0</grpc.netty.version>
</properties>

<name>Google Cloud GraalVM Support Parent</name>
Expand Down