erlware / relx

Sane, simple release creation for Erlang
http://erlware.github.io/relx
Apache License 2.0
697 stars 232 forks source link

Add ERTS_LIB_DIR applications path to code server in console_clean #721

Closed Kuroneer closed 5 years ago

Kuroneer commented 5 years ago

When starting the release with console_clean, the applications are assumed to be in ROOTDIR/lib, and this may not be the case with applications included from the ERTS if the ERTS itself is not included.

This PR makes console_clean check the ERTS_LIB_DIR for the included applications too to add their paths to the code server.

tsloughter commented 5 years ago

Thanks, this looks like it is likely good. But I'm surprised we building up a code path like this finding each individual app instead of just using the entire lib dir... I guess to keep exact version of apps in the path in case multiple releases are installed.

tsloughter commented 5 years ago

Actually, maybe the boot script should be responsible for this. I'll get this merged this weekend whether I figure out this code path/boot script stuff or not.

Kuroneer commented 5 years ago

I don't know if it's better to maintain the start_clean or create another boot file for the console_clean command. If you're keen to set up a different boot file, how about something like WIP snippet? I think this would make the relx_get_code_paths unneeded (and I'd need to test a little if none is enough or it would be better to use load and what happens with IncApps in either case)

tsloughter commented 5 years ago

Yup, that is what I did. But had given up because none still loads the code and we do not want that to happen, it would mean being unable to bring up the clean console if a NIF was broken for instance since they use on_load. But Jose pointed out this morning that it works in interactive mode. So I'm modifying my patch to also update the start script to set code loading mode to interactive and then this works :).

Kuroneer commented 5 years ago

Great! I'll close this PR and comment on the other. Thanks a lot!