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

IO / play precompile broken #1450

Open
JohannesBeranek opened this issue Oct 2, 2023 · 5 comments
Open

IO / play precompile broken #1450

JohannesBeranek opened this issue Oct 2, 2023 · 5 comments

Comments

@JohannesBeranek
Copy link

Play Version (1.5.x / etc)

framework/src/play/libs/IO.java
broken in d6dae44

Issue

We've been using play 1 for about 10 years now, together with lombok.

Recently tried to update to master and hit an issue where our lombok module python before() method was not executed - turned out the commands.py wasn't copied.

By going back and forth with versions and individual files I could nail down the file and revision at fault.

I don't know the exact change yet, but in
576fcc0

everything works.

Going to d6dae44
our lombok module isn't running anymore when precompile is executed.

Switching just
framework/src/play/libs/IO.java
back to the previous commit
576fcc0
everything works again.

Same with master - if I just switch that single file back, everything works again.

Reproducible Test Case

Add a module with a before(...) function in commands.py and add some print statement there. Now run play precompile and you should see the difference. Didn't test this exact case, as this is just fyi, as we're probably going to fork play going forward, as it seems there won't be much development happening anymore.

@aleksandy
Copy link
Contributor

Hi, @JohannesBeranek. I'm the author of the d6dae44. Could you provide the minimal example are reproducing the issue? Or output (stdout/stderr) of the precompile process at least.

@JohannesBeranek
Copy link
Author

@aleksandy
Besides what I wrote under "Reproducible Test Case", try the attached module
lombok-module.zip

Then just use some lombok, e.g.

import lombok.Getter;

class Whatever {
   @Getter
   private int testValue = 5;
   
   public static int test() {
    var x = new Whatever();
    return x.getTestValue();
   }
}

The precompile phase will err out due to "method getTest() does not exist" or something similar (depending on your exact java version etc).

@aleksandy
Copy link
Contributor

aleksandy commented Oct 6, 2023

I'm not too familiar with python but in my opinion the cause is here. Because your module defines javaagent in before-hook but the method does not take into account the available value of "-javaagent:".

@JohannesBeranek
Copy link
Author

@aleksandy no, it works with that code. I've put print statements in python and java code and with the latest version the before just isn't triggered anymore on precompile. It's pretty simple to reproduce probable - add a module with a before hook in commands.py that just prints some statement (e.g. print("BEFORE")) and compare the 1.7.1 release zip version to latest master when doing precompile.

@JohannesBeranek
Copy link
Author

Also @aleksandy just switching
framework/src/play/libs/IO.java
fixes the issue, so some change there broke it.

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

2 participants