Login  Register

Re: Jogamp-fat.jar not deploying on a Windows 7 64bits machine ?

Posted by Sven Gothel on Mar 22, 2019; 11:34am
URL: https://forum.jogamp.org/Jogamp-fat-jar-not-deploying-on-a-Windows-7-64bits-machine-tp4039604p4039644.html

I glanced over the implementation of OpenJDK 8's
'java.nio.file.Files.isExecutable(Path)',
which eventually issues java.nio.file.spi.FileSystemProvider.checkAccess(..)
and on 'Unix' it will test the files via:
"
NAME
       access, faccessat - check user's permissions for a file

SYNOPSIS
       #include <unistd.h>

       int access(const char *pathname, int mode);
"

This should be sufficient for the executable test, as we do nothing else :)

However, the problem arises that we need to bootstrap this test with a file
in the first place. This task of extracting and placing the file
in said folder potentially causes the virus scanner to freeze the process.

On all platforms but Windows, we use a simple empty file to test.
We (?)may find time to test with same empty file on Windows.
This test requires one to set the ACL permissions to non executable,
on GNU/Linux you would need to mount the temp folder non-executable or also
use said ACLs if supported.

Cheers, Sven

On 3/22/19 10:57 AM, Sven Gothel [via jogamp] wrote:

> Yes, to make sure that the user is capable to execute files on a given path
> one sadly to test today.
> (execute == native lib loading)
>
> The filesystem's executable mount option or advanced attributes differs from
> out old 'directory is executable' to simply enter/read the directories content.
>
>> Files.isExecutable(Path) (available since Java 1.8) should work.
>> java.nio.files.Files.getPosixFilePermissions()
>
> If the above can replace the 'intrusive' exe-test on all platforms,
> we simply can use it where available via reflection.
> If so .. great stuff.
>
> +++
>
> Here is a commit in one branch, which I will merge to master w/ the javafx
> branch, disabling the exe test altogether. This of course will render
> the whole automatic library loading void.
>
> https://jogamp.org/git/?p=gluegen.git;a=commit;h=e7ac6b284eb3515f552cba491c43efe75f0a4eba
>
> On 3/22/19 10:39 AM, gouessej [via jogamp] wrote:
>
>> The pitfall with File.canExecute() (available since Java 1.6) is that it might
>> tell that a file is executable whereas its permissions indicate that it isn't
>> :s whereas Files.isExecutable(Path) (available since Java 1.8) should work.
>> java.nio.files.Files.getPosixFilePermissions() would work too:
>> https://jogamp.org/bugzilla/show_bug.cgi?id=1219#c71
>>
>> Do you want me to provide a patch?
>> Julien Gouesse | Personal blog <http://gouessej.wordpress.com> | Website
>> <http://tuer.sourceforge.net>
>>
>
>
> ------------------------------------------------------------------------------
> If you reply to this email, your message will be added to the discussion below:
> http://forum.jogamp.org/Jogamp-fat-jar-not-deploying-on-a-Windows-7-64bits-machine-tp4039604p4039643.html