Skip to content
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

Meson should not (try to) modify jarfiles #4844

Open
rom1v opened this issue Jan 29, 2019 · 5 comments
Open

Meson should not (try to) modify jarfiles #4844

rom1v opened this issue Jan 29, 2019 · 5 comments

Comments

@rom1v
Copy link

rom1v commented Jan 29, 2019

Commit c70a051 modify jar files to remove Class-Path entry from its manifest.

In scrcpy, an application composed of an Android "application" and a desktop application, I provide a prebuilt server as a jar file, so that users may build the application (the client part) without setting a whole Android build environment.

This jarfile is the Android "application" in itself, it is not a build dependency of the client app.

As a consequence of meson trying to modify the jar file, building scrcpy requires the jar executable, hence the whole openjdk-8-jdk package: Genymobile/scrcpy#404 (comment).

This is a useless annoyance, even if the problem is quite harmless.

In addition, in theory, such a .jar could require a Class-Path entry, and removing it would break its expected behavior.

So IMO, meson should not modify jarfiles.

@rom1v rom1v changed the title Meson (may) modify provided jarfile Meson should not (try to) modify jarfiles Jan 29, 2019
@rom1v
Copy link
Author

rom1v commented Jan 29, 2019

cc @noverby

@noverby
Copy link
Contributor

noverby commented Jan 29, 2019

My original commit did not change the jar file: #3736

@jpakkane
Copy link
Member

You can set a custom classpath with the install_rpath entry. For jars it is interpreted as the classpath.

@rom1v
Copy link
Author

rom1v commented Aug 8, 2019

So IMO, meson should not modify jarfiles.

Do you agree with this?

@jpakkane I'm not sure to understand what you suggested.

@jpakkane
Copy link
Member

Looking through the code it seems that the problem is that Meson changes the jar classpath even if it has not built the jar itself with the jar command. Is this correct? If yes, then that is a bug, we should only modify jarfiles we build ourselves.

rom1v added a commit to Genymobile/scrcpy that referenced this issue Oct 30, 2019
The server name ending with .jar has several drawbacks:
 - meson requires the jar executable to attempt to modify it:
     <#404 (comment)>
     <mesonbuild/meson#4844>
 - meson warns during "ninja install"
     <#458>
 - some users try to execute it on the computer as a java executable

Removing the extension solves all these problems.
rom1v added a commit to Genymobile/scrcpy that referenced this issue Oct 31, 2019
The server name ending with .jar has several drawbacks:
 - meson requires the jar executable to attempt to modify it:
     <#404 (comment)>
     <mesonbuild/meson#4844>
 - meson warns during "ninja install"
     <#458>
 - some users try to execute it on the computer as a java executable

Removing the extension solves all these problems.
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

No branches or pull requests

3 participants