Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds Graal hints for the shaded dependencies (#4832)
* Adds Graal hints for the shaded dependencies * Moved the file to the proper location * Added Graal VM Github Action build * Polish * Updated graal plugin * Updated graal plugin to 0.9.14 * Updated graal native plugin * Applied changes following the review
- Loading branch information
1 parent
db1d065
commit 9a1996c
Showing
6 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: GraalVM Community Edition build | ||
on: [push, pull_request] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: graalvm/setup-graalvm@v1 | ||
with: | ||
version: 'latest' | ||
java-version: '11' | ||
components: 'native-image' | ||
- name: Running test | ||
run: | | ||
echo "GRAALVM_HOME: $GRAALVM_HOME" | ||
echo "JAVA_HOME: $JAVA_HOME" | ||
java --version | ||
gu --version | ||
native-image --version | ||
./gradlew nativeTest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
plugins { | ||
id("otel.java-conventions") | ||
id("org.graalvm.buildtools.native") | ||
} | ||
|
||
description = "OpenTelemetry Graal Integration Tests" | ||
otelJava.moduleName.set("io.opentelemetry.graal.integration.tests") | ||
|
||
sourceSets { | ||
main { | ||
// We need to ensure that we have the shadowed classes on the classpath, without this | ||
// we will get the <:sdk:trace-shaded-deps> classes only, without the shadowed ones | ||
val traceShadedDeps = project(":sdk:trace-shaded-deps") | ||
output.dir(traceShadedDeps.file("build/extracted/shadow"), "builtBy" to ":sdk:trace-shaded-deps:extractShadowJar") | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation(project(path = ":sdk:trace-shaded-deps")) | ||
} | ||
|
||
graalvmNative { | ||
binaries { | ||
named("main") { | ||
verbose.set(true) | ||
} | ||
} | ||
toolchainDetection.set(false) | ||
} |
2 changes: 2 additions & 0 deletions
2
integration-tests/graal/src/main/resources/simplelogger.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
org.slf4j.simpleLogger.defaultLogLevel=info | ||
org.slf4j.simpleLogger.log.org.eclipse.jetty=warn |
26 changes: 26 additions & 0 deletions
26
...ration-tests/graal/src/test/java/io/opentelemetry/integrationtests/graal/JcToolsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.integrationtests.graal; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import io.opentelemetry.sdk.trace.internal.JcTools; | ||
import java.util.Queue; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.condition.EnabledInNativeImage; | ||
|
||
class JcToolsTest { | ||
|
||
@Test | ||
@EnabledInNativeImage | ||
void insert_oneElementToTheQueue() { | ||
Queue<Object> objects = JcTools.newFixedSizeQueue(10); | ||
|
||
objects.add(new Object()); | ||
|
||
assertThat(objects).hasSize(1); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...ources/META-INF/native-image/io.opentelemetry/opentelemetry-sdk-trace/reflect-config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
[ | ||
{ | ||
"condition": { | ||
"typeReachable": "io.opentelemetry.internal.shaded.jctools.queues.MpscArrayQueueConsumerIndexField" | ||
}, | ||
"name": "io.opentelemetry.internal.shaded.jctools.queues.MpscArrayQueueConsumerIndexField", | ||
"fields": [ | ||
{ | ||
"name": "consumerIndex" | ||
} | ||
] | ||
}, | ||
{ | ||
"condition": { | ||
"typeReachable": "io.opentelemetry.internal.shaded.jctools.queues.MpscArrayQueueProducerIndexField" | ||
}, | ||
"name": "io.opentelemetry.internal.shaded.jctools.queues.MpscArrayQueueProducerIndexField", | ||
"fields": [ | ||
{ | ||
"name": "producerIndex" | ||
} | ||
] | ||
}, | ||
{ | ||
"condition": { | ||
"typeReachable": "io.opentelemetry.internal.shaded.jctools.queues.MpscArrayQueueProducerLimitField" | ||
}, | ||
"name": "io.opentelemetry.internal.shaded.jctools.queues.MpscArrayQueueProducerLimitField", | ||
"fields": [ | ||
{ | ||
"name": "producerLimit" | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters