-
Notifications
You must be signed in to change notification settings - Fork 785
feat(bindings/java): Add musl platform support #7087
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
48a8af3
feat(bindings/java): Add musl platform support
Xuanwo e465a2f
Revert not needed changes
Xuanwo e91a723
try fix musl build
Xuanwo f7751e1
format code
Xuanwo 378bef4
fix
Xuanwo 034370d
refactor
Xuanwo 729ced3
Build dyn lib via docker
Xuanwo 7e26316
Fix CI
Xuanwo 5f838f7
Merge branch 'main' into xuanwo/java-alpine-v1
Xuanwo 48bd0ae
Merge remote-tracking branch 'origin/main' into xuanwo/java-alpine-v1
Xuanwo 3333798
ci(bindings/java): use multi-arch alpine for musl smoke
Xuanwo 36e4199
ci(bindings/java): skip nexus staging on pull requests
Xuanwo 275a017
ci(bindings/java): install musl runtime dependency
Xuanwo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
67 changes: 67 additions & 0 deletions
67
bindings/java/src/test/java/org/apache/opendal/EnvironmentTest.java
This file contains hidden or 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,67 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you 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 | ||
| * | ||
| * http://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 org.apache.opendal; | ||
|
|
||
| import static org.assertj.core.api.Assertions.assertThat; | ||
|
|
||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| public class EnvironmentTest { | ||
| @Test | ||
| public void testBuildClassifierLinuxGnuX8664() { | ||
| assertThat(Environment.buildClassifier("linux", "x86_64", false)).isEqualTo("linux-x86_64"); | ||
| } | ||
|
|
||
| @Test | ||
| public void testBuildClassifierLinuxMuslX8664() { | ||
| assertThat(Environment.buildClassifier("linux", "x86_64", true)).isEqualTo("linux-x86_64-musl"); | ||
| } | ||
|
|
||
| @Test | ||
| public void testBuildClassifierLinuxMuslAarch64() { | ||
| assertThat(Environment.buildClassifier("linux", "aarch64", true)).isEqualTo("linux-aarch_64-musl"); | ||
| } | ||
|
|
||
| @Test | ||
| public void testBuildClassifierNonLinuxIgnoreMusl() { | ||
| assertThat(Environment.buildClassifier("mac os x", "x86_64", true)).isEqualTo("osx-x86_64"); | ||
| assertThat(Environment.buildClassifier("windows", "x86_64", true)).isEqualTo("windows-x86_64"); | ||
| } | ||
|
|
||
| @Test | ||
| public void testIsMuslOverride() { | ||
| final String key = "org.apache.opendal.libc"; | ||
| final String previous = System.getProperty(key); | ||
| try { | ||
| System.setProperty(key, "musl"); | ||
| assertThat(Environment.isMusl("x86_64")).isTrue(); | ||
|
|
||
| System.setProperty(key, "gnu"); | ||
| assertThat(Environment.isMusl("x86_64")).isFalse(); | ||
| } finally { | ||
| if (previous == null) { | ||
| System.clearProperty(key); | ||
| } else { | ||
| System.setProperty(key, previous); | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you test this line works?
I suspect that with bundled jar the file doesn't exist on
/libbut in the JAR package.