-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add support for generating native libraries for Linux and macOS aarch64 platforms (fixes #46). #50
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
19e7bca
Add workflow steps to build and include ARM64 binaries for macOS and …
kirkrodrigues 42581d3
Make jar build job depend on Linux ARM lib build job.
kirkrodrigues 0b3f557
Add missing native lib generation command.
kirkrodrigues e583618
Lint fix.
kirkrodrigues 3ead593
Download Linux arm64 lib; Package after downloading artifacts.
kirkrodrigues aa1fe3c
Use ubuntu:20.04 to build ARM native-lib.
kirkrodrigues 63bd3cc
Use DEBIAN_FRONTEND=noninteractive to handle jdk install.
kirkrodrigues 7b667c7
Set JAVA_HOME
kirkrodrigues a52b818
Switch back to eclipse-temurin:11-jdk-focal.
kirkrodrigues 42a1405
Make script more robust.
kirkrodrigues cf88262
Add integration test to test loading native lib.
kirkrodrigues 04ccdd7
Add new test tasks to the README.
kirkrodrigues 1f3704a
Replace arm64 instances with aarch64 where possible.
kirkrodrigues 171ca70
Install jar to a local repo properly rather than copying it hackily.
kirkrodrigues 5db55e3
Make integration test print nothing on success and error on failure.
kirkrodrigues bfc991f
Run unit tests when building native lib in GH workflows.
kirkrodrigues 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 was deleted.
Oops, something went wrong.
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
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
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
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,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>com.yscope.clp</groupId> | ||
<artifactId>jar-load-native-lib</artifactId> | ||
<version>0.1.0</version> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.yscope.clp</groupId> | ||
<artifactId>clp-ffi</artifactId> | ||
<version>0.4-SNAPSHOT</version> | ||
</dependency> | ||
</dependencies> | ||
</project> |
37 changes: 37 additions & 0 deletions
37
integration-tests/jar-load-native-lib/src/main/java/com/yscope/clp/Main.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,37 @@ | ||
package com.yscope.clp; | ||
|
||
import com.yscope.clp.compressorfrontend.BuiltInVariableHandlingRuleVersions; | ||
import com.yscope.clp.compressorfrontend.EncodedMessage; | ||
import com.yscope.clp.compressorfrontend.MessageDecoder; | ||
import com.yscope.clp.compressorfrontend.MessageEncoder; | ||
|
||
import java.io.IOException; | ||
import java.nio.charset.StandardCharsets; | ||
|
||
public class Main { | ||
public static void main(String[] args) { | ||
// To trigger loading the native library, we do a basic encode-decode test. | ||
MessageEncoder messageEncoder = new MessageEncoder( | ||
BuiltInVariableHandlingRuleVersions.VariablesSchemaV2, | ||
BuiltInVariableHandlingRuleVersions.VariableEncodingMethodsV1 | ||
); | ||
EncodedMessage encodedMessage = new EncodedMessage(); | ||
MessageDecoder messageDecoder = | ||
new MessageDecoder(BuiltInVariableHandlingRuleVersions.VariablesSchemaV2, | ||
BuiltInVariableHandlingRuleVersions.VariableEncodingMethodsV1); | ||
try { | ||
String message = "Static text, dictVar1, 123, 456.7, dictVar2, 987, 654.3"; | ||
messageEncoder.encodeMessage(message, encodedMessage); | ||
String decodedMessage = messageDecoder.decodeMessage( | ||
encodedMessage.getLogTypeAsString(), | ||
encodedMessage.getDictionaryVarsAsStrings(), | ||
encodedMessage.encodedVars | ||
); | ||
if (false == message.equals(decodedMessage)) { | ||
throw new RuntimeException("Failed to encode message."); | ||
} | ||
} catch (IOException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
tools/scripts/ubuntu-focal/install-deps-build-test-package-native-lib.sh
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,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Exit on error | ||
set -e | ||
|
||
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
project_dir="${script_dir}/../../../" | ||
|
||
apt-get update | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake maven | ||
|
||
cd "$project_dir" | ||
mvn --batch-mode validate generate-resources test assembly:single@assemble-lib-dir | ||
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.
I moved
validate
beforegenerate-resources
to match the order that Maven executes them in (seemvn buildplan:list
).