[crac] RFR: 8353243: [CRaC] Show all options in engine help [v2]

Timofei Pushkin tpushkin at openjdk.org
Mon Apr 7 11:23:11 UTC 2025


On Mon, 7 Apr 2025 09:35:55 GMT, Radim Vansa <rvansa at openjdk.org> wrote:

>> I treat `exec_location` and the whole `crexec` as a JVM's implementation detail: if JVM determines that the engine passed to `CRaCEngine` is an executable then it uses `crexec` and passes it the location of the real engine via `exec_location` — in no other case `exec_location` is used.
>> 
>> So no other engine should be able to access this usage of `exec_location`:
>> - if the engine is a library, JVM won't use `exec_location` at all (and it will allow the user to use an option with such name)
>> - if the engine is an executable, JVM will pass `exec_location` to `crexec` but it won't be passed to the engine executable itself (the user can use `args` to pass arguments to the executable)
>
> Despite `crexec` is part of JVM codebase and it allows JVM to use executable-based engine implementations, I don't consider it a part of JVM; the separation line should be drawn at CRE API level. So it should not be a "JVM's implementation detail".
> 
> In the first version of the API it was called 'library_path`: informing the engine about a place where it should load other executables/libraries from. In fact, it is non-trivial to programmatically figure out from within a shared library was loaded from (if e.g. it needs to load some extra resource that should be in the same directory) so it might be useful.

I agree with what you say about "implementation detail", looks like we just interpret these words a bit differently.

> In the first version of the API it was called 'library_path`: informing the engine about a place where it should load other executables/libraries from.

Yes, but just `library_path` is not enough, engine executable does not always come from there sines the user can provide an arbitrary absolute path. In the first version of the API `crexec` ended up using `args` instead of `library_path` for this.

We could pass `exec_location` to all engines that accept it (would be better to rename it to `engine_location` then) but I am not sure how useful this would be to other engines besides `crexec`: I've never tried to get a file address of a shared library from within itself but after some googling it doesn't seem too complicated (for a not so commonly needed thing).

-------------

PR Review Comment: https://git.openjdk.org/crac/pull/220#discussion_r2031028270


More information about the crac-dev mailing list