Skip to content

Conversation

Eng-Fouad
Copy link
Contributor

No description provided.

@gsmet
Copy link
Member

gsmet commented Sep 16, 2025

@Eng-Fouad CI is all red with:

Error:  io.quarkus.fs.util.ZipUtilsTest.testCreateNewReproducibleZipFileSystem -- Time elapsed: 0.003 s <<< ERROR!
java.lang.UnsupportedOperationException
	at java.base/java.nio.file.Files.setPosixFilePermissions(Files.java:2166)
	at io.quarkus.fs.util.ZipUtils$ReproducibleZipFileSystem.lambda$close$1(ZipUtils.java:406)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1845)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at io.quarkus.fs.util.ZipUtils$ReproducibleZipFileSystem.close(ZipUtils.java:393)
	at io.quarkus.fs.util.ZipUtilsTest.testCreateNewReproducibleZipFileSystem(ZipUtilsTest.java:188)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

So I think there's probably something wrong going on :).

@Eng-Fouad
Copy link
Contributor Author

Eng-Fouad commented Sep 16, 2025

According to the javadocs, we need to enable it:

In addition to the "zip" view, a Zip file system optionally supports the PosixFileAttributeView ("posix"). This view extends the "basic" view with type safe access to the owner, group-owner, and permissions attributes. The "posix" view is only supported when the Zip file system is created with the provider property "enablePosixFileAttributes" set to "true". The following creates a file system with this property and reads the access permissions of a file:

    var env = Map.of("enablePosixFileAttributes", "true");
    try (FileSystem fs = FileSystems.newFileSystem(file, env) {
        Path entry = fs.getPath("entry");
        Set<PosixFilePermission> perms = Files.getPosixFilePermissions(entry);
    }

or alternatively:

The default permissions can be configured with the "defaultPermissions" property described below.

@gsmet
Copy link
Member

gsmet commented Sep 16, 2025

OK, maybe try that and we can get another CI run, we are testing on quite a lot of platforms so things should be relatively safe if CI is green.

That being said, maybe we should add macOS to the testing.

@Eng-Fouad Eng-Fouad force-pushed the fixed-permission-zip-entry branch from 1c6bd25 to cb88b04 Compare September 16, 2025 14:03
@Eng-Fouad
Copy link
Contributor Author

Added effectiveEnv.put("enablePosixFileAttributes", "true");.

@gsmet gsmet force-pushed the fixed-permission-zip-entry branch from cb88b04 to 623a659 Compare September 16, 2025 14:16
@gsmet
Copy link
Member

gsmet commented Sep 16, 2025

I rebased to also get macOS testing on CI.

@gsmet gsmet merged commit 046764b into quarkusio:main Sep 16, 2025
10 checks passed
@Eng-Fouad Eng-Fouad deleted the fixed-permission-zip-entry branch September 16, 2025 14:19
@gsmet
Copy link
Member

gsmet commented Sep 16, 2025

Thanks, I'll ship a release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants