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
Runresolution should consider loglevel set via -resolvedebug #6117
base: master
Are you sure you want to change the base?
Conversation
previously resolving used the ResolverLogger() default constructor. This commit checks if -resolvedebug instruction has been set e.g. in a .bndrun file and if yes it uses the value from it and initializes the ResolveLogger with it. also we now print the resolvedebug log to the resolutionFailurePanel. This also shows the logfile location on disk if the log is too large for display. Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
the default impl in the inherited base class is empty. Thus nothing was logged. Overriding this impl and actually logging something here now. Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
before this change the logfile containing the Uses Constraint violation was closed too early so that manually opening wasn't possible anymore. since it is a tmp file anyway which gets removed when JVM / Eclipse exits, this should be better and a bit longer. still not ideal, since I don't know exactly how this would work with the resolver being triggered e.g. via maven. Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
For Maven, log output should IMHO either go into a debug-level logger (which can be made visible using the |
@pkriens any thoughts on that? To me it sounds like the caller (maven plugin which calls bnd resolve) should be able to control this somehow. Don't think that is the case right now. But I'm not familiar with the maven plugin |
I think it makes sense to make a Maven Logger that is given to the resolver and uses the Maven logging system. You might even use standard SLF4J logging on debug level. I assume maven will capture this. |
Just confirming: Is the whole Maven story starting here? and here? I will dig deeper later, but just need some pointers where to hook in. Because I think at the moment there are not enough hooks to hook in from outside. Regarding
This sounds tempting. Which Logger would I need to log to? Just something like this?
and then And then Maven magically can capture this with this |
The Maven |
Ok will try and push something later. |
allow e.g. maven (which also uses Slf4j) to see / capture resolver debug log output e.g. when running mvn -X clean install Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
@reckart I added slf4j debug logging in 1db5a87 @pkriens I think the MavenLogger is a good idea but I think it requires deeper changes, so that a logger can be passed. I think the slf4j approach would be a more lightweight way to find out if we / @reckart is satisfied with the logging output (if it is helpful). Once we know that we could think about refactoring. But at the moment I think also the maven bnd plugin needs to be adjusted since it currently only calles into At least we now have a unit test which triggers a |
not sure why, but since I set this to true at this place, the build fails. maybe something gets too big. We keep keepLogFileTillJvmExit=true only in the bndtools UI, where take care of cleanup ourselves. Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
men, you're amazing ... It all looks good to me, I am ok to merge |
@pkriens give me until EOB, I'll try if I can have a look at the debug output. |
@pkriens I am sorry, I didn't manage to test this yesterday as I repeatedly ran into failing tests during the build... |
@reckart Not sure if it helps (at least for testing), but you might try downloading the latest built artifact from github while you have trouble with the local build. You find this e.g. in the section "Upload dist/bundles" of https://github.com/bndtools/bnd/actions/runs/9069124930/job/24917977286?pr=6117 |
@chrisrueger thanks for the pointer. I can look at it again mid next week. Wrt. the failing builds - I have a feeling that it might be related to concurrency. After the "Address in use" issues in several tests, I am not running into locking problems. Does grade build/test bnd using multiple parallel threads? |
Btw. the artifacts are also listed here: https://github.com/bndtools/bnd/actions/runs/9069124930?pr=6117 |
Maybe @pkriens knows more? |
Based on https://bnd.discourse.group/t/memory-usage-explosion-with-bnd-resolver-plugin/307/6 by @reckart
It seems the -resolvedebug instruction is not considered in a few places where it would make sense.
This PR tries to improve this.
In this PR
ResolverLogger
) should respect the loglevel set via-resolvedebug
Update: Note that 53a0eae now
InternalResolverLogger.logUsesConstraintViolation()
actually logs something.If I interpret it correctly that is exactly the logging output Richard wants to have and mentions in the forum post
Unfortunately I could not verify the output yet as I haven't found a testcase which triggers logUsesConstraintViolation(). Pointers are welcome.
@reckart could you try it out if this would have helped in your case?
@pkriens do you see any concerns?