mill icon indicating copy to clipboard operation
mill copied to clipboard

Use Zinc-independent main class discovery everywhere

Open lefou opened this issue 1 year ago • 3 comments

Instead we use the compilation-task independent discovery of main classes.

lefou avatar Aug 29 '24 15:08 lefou

This might also fix the issue described in https://github.com/com-lihaoyi/mill/pull/3432, since it uses a main-class discovery independent of the used compiler. @AnthonyGrod could you please verify?

lefou avatar Aug 29 '24 15:08 lefou

@lefou I've also tried this approach earlier but it does not work unfortunately. Discovering the main test class (which zincWorker fails to do - the main test class is always mill.testrunner.entrypoint.TestRunnerMain and I think the actual testing suite that needs to be run is somehow resolved with main test class arguments) itself is not the biggest issue - it's discovering main test class arguments and it's corresponding classpath for the local Java application launching. I don't think it's possible to resolve all of it without the TestModule logic.

AnthonyGrod avatar Aug 29 '24 16:08 AnthonyGrod

I see. I think the BSP spec is misleading here, as we aren't interested in any local main class but in the test runner itself. And the actual test runner isn't in the local classpath (compiler output) but the provided dependencies. Although the spec mentions, that this endpoint is also supposed to launch a custom main class.

lefou avatar Aug 29 '24 19:08 lefou