-
Notifications
You must be signed in to change notification settings - Fork 296
Drop shared
PLTs support and change PLT name to <OTP-VSN>.plt
#504
Conversation
Where were you when I asked whether we should remove We can also remove all plt location options and add it later, if there's a feature request. Alternatively we could turn it into a full path option, but that would complicate if and how we embed the OTP release string in the filename. If we support only project-local PLTs and no option to copy it around (embedded beam paths), I'm okay with dropping the app-name. |
Hehe, I didn't notice this until porting rebar3 to be compatible, sorry.
In rebar3 there is direct support for an Could we add an option |
What's included from the local projects in the rebar3 PLT? Do you have multiple PLTs for the top-level project? Where does rebar3 store the PLT by default? |
The rebar2 PLT model is that you have a single project with rebar deps and what's configured in the .app file. These are included in the PLT. Your |
Once erlang/rebar3#502 is merged it will include the same files as a rebar2 PLT with the caveat that
The rebar3 PLT is stored in
rebar3 handles this situation perfectly. Lets stop worrying about what rebar3 does, it actually has tests to prove all these situations work correctly. |
Adding kernel, stdlib, and crypto by default may work most of the time, but it's not a good idea, as you can build erlang apps with only erts. Somebody will request a feature to exclude apps from the hard-coded set.
Is it one PLT for each profile, or one for each app in each profile?
I've tried to explain what rebar2's build-plt does, given how rebar2 projects work, trying to figure out whether the models and supported projects are different enough that unifying the naming schemes is pointless. Also, from what I understand, with rebar3 custom PLT locations, you have to use extra sub-dirs to differentiate between app1's 18.0.plt and app2's 18.0.plt. |
Quite the opposite, it means rebar3 can do a lot less work (saving a couple of minutes on build time) and has always been fully configurable.
It's one per profile per project. If a project contains multiple applications it is still one per profile.
Rebar3 only builds the PLT in a different way, if it does not create the same PLT and analyse the same files it is a bug.
With a simple rebar3 project (structured the same as rebar projects):
With a release structured project:
The application name can't be used in the release structured project because there could be multiple applications. The reason for a unifying naming scheme is so that |
It is possible to fix this caveat if required for compatibility. |
You didn't say so, and I could have assumed it, but it's fine if the default set can be overridden.
That's my point. rebar3 works without a master (aka top) project, and treats all apps equally. This is not the case in rebar2, and hence the possibility of including the app name for simple custom location dirs.
Same reason the filename is generated in rebar2 and why I called it "location" (not "dir"). I've read your comments twice, but I cannot see an explanation for how plt1 and plt2 are stored in a shared location, without extra sub-dirs. If not app name (which is the top project name in rebar2), you surely have a project name, don't you? |
To not block 2.6.0, perhaps we should reduce the patch to a simple |
Rebar 2.x can totally be made to ignore a top-project by specifying additional directories or running commands with |
Ah, I was confused, I thought we were talking about when used in an @ferd can you think of naming scheme that works for both that allows a global directory to contain PLTs from multiple projects? |
{ok, Pwd} = file:get_cwd(), %% or use project root dir
integer_to_list(erlang:phash2(Pwd)) ++ "-" ++ OTPVsn ++ ".plt" Then it becomes invalid if you move directories around I guess. Rebar3 would need to add the profile (or a different directory) to that seed. Not sure I like it. |
So requiring sub-dirs for global PLTs is not an option for rebar2? If so I will remove the naming scheme change and accept the incompatibly. |
I have force pushed to only remove Rebar3 can switch the PLT name to |
Thanks, can you append your name in |
Amended. |
Thanks. Do we actually still need |
|
Oh dear, I've just realised I used |
Okay, let's keep |
Can we please merge this? |
Drop `shared` PLTs support and change PLT name to <OTP-VSN>.plt
I am worried about supporting the
shared
PLT location option because it will be very easy to use a PLT which is not suitable or has slightly different files than a project's dependencies. If there are two branches of an application with different versions of dependencies the same PLT probably should not be used.I think it would be better to require a user to be specific about how they are sharing PLTs using the explicit directory location. Otherwise someone unfamiliar with dialyzer might think
shared
is an optimisation and end up using dialyzer incorrectly or in a sub-optimal fashion. That is, we should definitely make the optimisation available for those who need it (with the directory name option) but we should not make it too easy to do the wrong thing.I also took this opportunity to change to the default PLT name to match that used (currently) by rebar3. It is very awkward to include the application name in the PLT's name because there can be multiple applications in a rebar3 release project. Without the
shared
option the PLT does not need to include the application name.