Skip to content

Commit

Permalink
Merge branch 'release/0.7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
overheadhunter committed Mar 21, 2024
2 parents 325b4c3 + 79aedba commit 8e5a31d
Show file tree
Hide file tree
Showing 328 changed files with 31,997 additions and 23,032 deletions.
9 changes: 9 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json
language: "en"
reviews:
path_filters:
- "!**/extr/**"
auto_review:
enabled: true
chat:
auto_reply: true
23 changes: 21 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,30 @@ updates:
interval: "weekly"
day: "monday"
time: "06:00"
timezone: "UTC"
timezone: "Etc/UTC"
groups:
maven-dependencies:
java-test-dependencies:
patterns:
- "org.junit.jupiter:*"
- "org.mockito:*"
maven-build-plugins:
patterns:
- "org.apache.maven.plugins:*"
- "org.jacoco:jacoco-maven-plugin"
- "io.github.coffeelibs:jextract-maven-plugin"
- "org.sonatype.plugins:nexus-staging-maven-plugin"
- "org.codehaus.mojo:exec-maven-plugin"
java-production-dependencies:
patterns:
- "*"
exclude-patterns:
- "org.junit.jupiter:*"
- "org.mockito:*"
- "org.apache.maven.plugins:*"
- "org.jacoco:jacoco-maven-plugin"
- "io.github.coffeelibs:jextract-maven-plugin"
- "org.sonatype.plugins:nexus-staging-maven-plugin"
- "org.codehaus.mojo:exec-maven-plugin"

- package-ecosystem: "github-actions"
directory: "/" # even for `.github/workflows`
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
java-version: 21
java-version: 22
distribution: 'zulu'
cache: 'maven'
- name: Setup fuse
Expand All @@ -21,7 +21,7 @@ jobs:
sudo apt-get install fuse3 libfuse3-dev
- name: Maven build
run: mvn -B verify -Dfuse.lib.path="/lib/x86_64-linux-gnu/libfuse3.so.3"
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: coverage-linux-amd64
path: jfuse-tests/target/site/jacoco-aggregate/jacoco.xml
Expand All @@ -33,9 +33,9 @@ jobs:
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
java-version: 21
java-version: 22
distribution: 'zulu'
cache: 'maven'
- name: Setup fuse
Expand All @@ -45,7 +45,7 @@ jobs:
brew install fuse-t
- name: Maven build
run: mvn -B verify -Dfuse.lib.path="/usr/local/lib/libfuse-t.dylib"
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: coverage-mac
path: jfuse-tests/target/site/jacoco-aggregate/jacoco.xml
Expand All @@ -57,17 +57,17 @@ jobs:
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
java-version: 21
java-version: 22
distribution: 'zulu'
cache: 'maven'
- name: Setup fuse
run: choco install winfsp --version 1.12.22339 -y
- name: Maven build
shell: bash # surprise, running maven in pwsh is crappy, see https://stackoverflow.com/q/6347985/4014509
run: mvn -B verify -Dfuse.lib.path="C:\Program Files (x86)\WinFsp\bin\winfsp-x64.dll"
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: coverage-win
path: jfuse-tests/target/site/jacoco-aggregate/jacoco.xml
Expand All @@ -81,26 +81,26 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
java-version: 21
java-version: 22
distribution: 'zulu'
cache: 'maven'
- name: Cache SonarCloud packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: coverage-linux-amd64
path: coverage/linux-amd64
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: coverage-mac
path: coverage/mac
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: coverage-win
path: coverage/win
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-central.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
- uses: actions/checkout@v4
with:
ref: "refs/tags/${{ github.event.inputs.tag }}"
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
java-version: 21
java-version: 22
distribution: 'zulu'
cache: 'maven'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
if: startsWith(github.ref, 'refs/tags/') # only allow publishing tagged versions
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
java-version: 21
java-version: 22
distribution: 'zulu'
cache: 'maven'
gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
Expand Down
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/HelloWorldFileSystem.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/HelloWorldFileSystem__Windows_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/PosixMirrorFileSystem__Linux_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/PosixMirrorFileSystem__fuse_t_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/RandomFileSystem.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/WindowsMirrorFileSystem.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

# jFUSE

Zero-Dependency Java bindings for FUSE using [JEP 442](https://openjdk.org/jeps/442).
Zero-Dependency Java bindings for FUSE using [JEP 454](https://openjdk.org/jeps/454).

## Status

This is currently an experimental library requiring JDK 21. As long as the [Foreign Function & Memory API](https://openjdk.org/jeps/442) is incubating, the required JDK will increase.
Older JDK versions are *not supported*. Please refer to an older version of this lib, if you are interested in using it with an older JDK. Older versions will not receive patches or any kind of support, though!
This lib makes use of the [Foreign Function & Memory API](https://openjdk.org/jeps/454), requiring at least JDK 22.
Older JDK versions are *not supported*. Please refer to an older version of this lib, if you are interested in using it with an older JDK (with `--enable-preview`). Older versions will not receive patches or any kind of support, though!

We attempt to support libfuse 3.x on Linux and Windows while also remaining compatible with libfuse 2.x on macOS, leading to some compromises in the API.

Expand Down Expand Up @@ -97,7 +97,6 @@ During runtime, you will need to add allow native access from platform-specific
java -p path/to/mods \
-m com.example.mymodule/com.example.mymodule \
--enable-native-access=org.cryptomator.jfuse.mac \
--enable-preview
```

## Supported Platforms
Expand Down
2 changes: 1 addition & 1 deletion jfuse-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.cryptomator</groupId>
<artifactId>jfuse-parent</artifactId>
<version>0.6.3</version>
<version>0.7.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jfuse-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class MemoryUtils {

@Nullable
public static String toUtf8StringOrNull(MemorySegment string, long offset) {
return MemorySegment.NULL.equals(string) ? null : string.getUtf8String(offset);
return MemorySegment.NULL.equals(string) ? null : string.getString(offset);
}

@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class MemoryUtilsTest {
void testValidSegmentReturnsString() {
try (var arena = Arena.ofConfined()) {
var address = arena.allocate(4);
address.setUtf8String(0, "abc");
address.setString(0, "abc");
String result = MemoryUtils.toUtf8StringOrNull(address);
Assertions.assertEquals("abc", result);
}
Expand All @@ -26,7 +26,7 @@ void testValidSegmentReturnsString() {
void testValidSegmentReturnsStringAtOffset() {
try (var arena = Arena.ofConfined()) {
var address = arena.allocate(10);
address.setUtf8String(5, "abc");
address.setString(5, "abc");
String result = MemoryUtils.toUtf8StringOrNull(address, 5);
Assertions.assertEquals("abc", result);
}
Expand Down
2 changes: 1 addition & 1 deletion jfuse-examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Assuming you have built the parent project (`mvn package`), you can run these examples directly from the shell.

These examples require JDK 19 or newer. You may want to adjust paths, such as the `java.library.path`.
These examples require JDK 22 or newer. You may want to adjust paths, such as the `java.library.path`.

### Running the hello world example:

Expand Down
4 changes: 2 additions & 2 deletions jfuse-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.cryptomator</groupId>
<artifactId>jfuse-parent</artifactId>
<version>0.6.3</version>
<version>0.7.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jfuse-examples</artifactId>
Expand All @@ -24,7 +24,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.9</version>
<version>2.0.12</version>
</dependency>
</dependencies>

Expand Down
16 changes: 14 additions & 2 deletions jfuse-linux-aarch64/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>jfuse-parent</artifactId>
<groupId>org.cryptomator</groupId>
<version>0.6.3</version>
<version>0.7.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jfuse-linux-aarch64</artifactId>
Expand All @@ -25,6 +25,18 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>@{surefire.jacoco.args} -javaagent:${net.bytebuddy:byte-buddy-agent:jar} --enable-native-access=org.cryptomator.jfuse.linux.aarch64</argLine>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>jextract-linux-aarch64</id>
Expand Down Expand Up @@ -69,7 +81,7 @@
<plugin>
<groupId>io.github.coffeelibs</groupId>
<artifactId>jextract-maven-plugin</artifactId>
<version>0.3.0</version>
<version>0.4.0</version>
<configuration>
<executable>/Users/sebastian/git/github.com/openjdk/jextract/build/jextract/bin/jextract</executable>
<headerSearchPaths>${linux.headerSearchPath}</headerSearchPaths>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,13 @@
import java.lang.foreign.MemorySegment;
import java.util.function.Consumer;

record DirFillerImpl(MemorySegment buf, fuse_fill_dir_t callback, Arena arena) implements DirFiller {

DirFillerImpl(MemorySegment buf, MemorySegment callback, Arena arena) {
this(buf, fuse_fill_dir_t.ofAddress(callback, arena), arena);
}
record DirFillerImpl(MemorySegment buf, MemorySegment callback, Arena arena) implements DirFiller {

@Override
public int fill(String name, Consumer<Stat> statFiller, long offset, int flags) {
var statSegment = stat.allocate(arena);
statFiller.accept(new StatImpl(statSegment));
return callback.apply(buf, arena.allocateUtf8String(name), statSegment, offset, flags);
return fuse_fill_dir_t.invoke(callback, buf, arena.allocateFrom(name), statSegment, offset, flags);
}

}
Loading

0 comments on commit 8e5a31d

Please sign in to comment.