fast-nail-55400
12/06/2021, 10:41 PMfast-nail-55400
12/06/2021, 10:41 PMfast-nail-55400
12/06/2021, 10:42 PM3rdparty/(jvm|tool)/${name}.lockfile
fast-nail-55400
12/06/2021, 10:43 PM3rdparty/jvm/tool/${TOOL}.lockfile
?fast-nail-55400
12/06/2021, 10:43 PM3rdparty/jvm
subpaths as we see fitwitty-crayon-22786
12/06/2021, 10:44 PM(jvm|tool)
was sortof meant to suggest either-or… i think the question there is whether there is any benefit to namespacing lockfiles by platform… there may not bewitty-crayon-22786
12/06/2021, 10:45 PM3rdparty/tool/black.lockfile
is fine too. there will be subsystem naming helping to hundreds-father-404
12/06/2021, 10:45 PMsrc/.../lint/black/lockfile.txt
The 3rdparty/
pattern is only for when we use a custom lockfile different than the default. Which iiuc should never happen in pantsbuild/pants - no reason to not use the default given how little JVM code we havewitty-crayon-22786
12/06/2021, 10:46 PMfast-nail-55400
12/06/2021, 10:46 PMresource
target for the lockfile being next to the same code it is for.fast-nail-55400
12/06/2021, 10:47 PM<default>
witty-crayon-22786
12/06/2021, 10:47 PMhundreds-father-404
12/06/2021, 10:47 PM"<default>"
or you choose whatever arbitrary path you want
I don't want to be imposing a default location on folksfast-nail-55400
12/06/2021, 10:47 PM<default>
witty-crayon-22786
12/06/2021, 10:47 PMTheis exactly the relevant case here. this option comes into play when an end user needs to actually generate a lockfilepattern is only for when we use a custom lockfile different than the default.3rdparty/
fast-nail-55400
12/06/2021, 10:48 PMhundreds-father-404
12/06/2021, 10:48 PMwitty-crayon-22786
12/06/2021, 10:48 PMfast-nail-55400
12/06/2021, 10:48 PMhundreds-father-404
12/06/2021, 10:48 PM"<default>"
. Otherwise, we have to assume it's a custom lockfilewitty-crayon-22786
12/06/2021, 10:49 PMhundreds-father-404
12/06/2021, 10:49 PMfast-nail-55400
12/06/2021, 10:49 PMwitty-crayon-22786
12/06/2021, 10:49 PMhundreds-father-404
12/06/2021, 10:49 PMhundreds-father-404
12/06/2021, 10:50 PMyou have to set two things whenever you change the version: you change the version, and then we say “ah ah ah! you forgot to choose a lockfile location.”Yep! That's exactly what we want imo! You are opting out of the defaults
witty-crayon-22786
12/06/2021, 10:50 PMfast-nail-55400
12/06/2021, 10:50 PMJvmToolBase
currently. Just going to have the paths be the existing resource file locations. If we want to make further changes, they can be a separate PR.witty-crayon-22786
12/06/2021, 10:50 PMhundreds-father-404
12/06/2021, 10:51 PMhundreds-father-404
12/06/2021, 10:51 PMwitty-crayon-22786
12/06/2021, 10:51 PMwitty-crayon-22786
12/06/2021, 10:51 PMwitty-crayon-22786
12/06/2021, 10:52 PMhundreds-father-404
12/06/2021, 10:52 PMancient-vegetable-10556
12/06/2021, 10:53 PMwitty-crayon-22786
12/06/2021, 10:53 PMhundreds-father-404
12/06/2021, 10:53 PMwitty-crayon-22786
12/06/2021, 10:54 PMAsher set up Toolchain to never use the defaults. Now that that’s done, he never needs to worry about ithm, no: only half of them are. i made changes to more of them, and some tools still remain as defaults
ancient-vegetable-10556
12/06/2021, 10:54 PMwitty-crayon-22786
12/06/2021, 10:54 PMhundreds-father-404
12/06/2021, 10:54 PM3rdparty/
convention, I don't want people to misunderstand in thinking they need to because that's what Pants defaulted towitty-crayon-22786
12/06/2021, 10:55 PMhundreds-father-404
12/06/2021, 10:56 PMhelp
message saying something like "A good convention is to put this lockfile in a folder named `3rdparty/jvm`". But making it the default behavior makes it seem like we are forcing you into it imo, and you might not realize it's even an option because why would you bother with it?witty-crayon-22786
12/06/2021, 10:58 PMpants.toml
, and boilerplate in the helpwitty-crayon-22786
12/06/2021, 10:59 PMwitty-crayon-22786
12/06/2021, 11:00 PMhundreds-father-404
12/06/2021, 11:00 PMwitty-crayon-22786
12/06/2021, 11:00 PMhundreds-father-404
12/06/2021, 11:01 PM(not to mention that we can delete a lot of handling code for “you forgot to set option X”)Almost all the code is checking whether the lockfile is valid or not. It's not checking if the option is set. I don't think that argument is very compelling tbh
witty-crayon-22786
12/06/2021, 11:04 PMDEFAULT_TOOL_LOCKFILE
is mentioned 19 times in 5 files (and hardcoded in 2 more)fast-nail-55400
12/06/2021, 11:05 PMhundreds-father-404
12/06/2021, 11:07 PM<default>
as a magic stringwitty-crayon-22786
12/06/2021, 11:08 PM<default>
magic stringfast-nail-55400
12/06/2021, 11:08 PMstr | None
and used None
as a defaultfast-nail-55400
12/06/2021, 11:09 PM<none>
fast-nail-55400
12/06/2021, 11:10 PM<none>
witty-crayon-22786
12/06/2021, 11:10 PM<none>
case is actually necessary i thinkwitty-crayon-22786
12/06/2021, 11:10 PMNone
fast-nail-55400
12/06/2021, 11:11 PMfast-nail-55400
12/06/2021, 11:11 PM<none>
!= None (i.e., <default>
)fast-nail-55400
12/06/2021, 11:12 PM<none>
means don’t use a lockfile whatsoever and re-resolve each timewitty-crayon-22786
12/06/2021, 11:24 PMwitty-crayon-22786
12/06/2021, 11:24 PMwitty-crayon-22786
12/06/2021, 11:25 PMhundreds-father-404
12/06/2021, 11:27 PMhundreds-father-404
12/06/2021, 11:31 PM"default"
as the name of the default resolve is a non-starter when we merge Python and Java to use the same resolve universe
We could use default names like py-default
and jvm-default
, although I continue to lean a bit more in favor of approach #2 that you have to give an explicit namehundreds-father-404
12/06/2021, 11:31 PMfast-nail-55400
12/06/2021, 11:32 PMWant me to handle merging the two goals? I’m now working on lockfiles as my main project so the context switch isn’t bad for meyes. I don’t have the context across both JVM and Python lockfiles to figure out what we want here and I don’t have a particular viewpoint, other than having an easy way to make JVM lockfiles which is what I built thus far.
fast-nail-55400
12/06/2021, 11:33 PMwitty-crayon-22786
12/06/2021, 11:34 PMI do recognize that naming things is really hard, so asking you to come up with a name for a lockfile when you just want to try out Pants is an additional barrier to adoption.yea. and i think that even if the default name is more awkward, we should not ask users to do this. as mentioned before, i think that 98% of users will be fine with a default, and never think twice about changing it (as evidenced by lockfiles in ~all of the other tools)
hundreds-father-404
12/06/2021, 11:36 PMgenerate-lockfiles
2) hooking up compatible_resolves
3) switching to pex for lockfile generation
4) Stu's proposal for disambiguating dep inferencehundreds-father-404
12/16/2021, 11:27 PM<default>
or you set a custom path. That has worked really well for Python it seems
But for user lockfiles, I agree that we should set a default like {"jvm": "3rdparty/jvm/artifacts.lockfile"}
. That's necessary for Pants to work out-of-the-box
--
What should that default path be? I don't know what's idiomatic in JVMwitty-crayon-22786
12/16/2021, 11:28 PMwitty-crayon-22786
12/16/2021, 11:28 PMwitty-crayon-22786
12/16/2021, 11:30 PMhundreds-father-404
12/16/2021, 11:31 PM3rdparty/jvm
part, but any opinion artifacts.lockfile
part? In Python, we're using .txt
-- also why are we doing .lockfile
instead of .json
?witty-crayon-22786
12/16/2021, 11:31 PM3rdparty/jvm/artifacts.lockfile
should be fine.witty-crayon-22786
12/16/2021, 11:32 PMjson
, but since it’s not actually meant for hand-editting, the need for syntax highlighting is reduced a bithundreds-father-404
12/16/2021, 11:34 PM{jvm: 3rdparty/jvm/lockfile.json, py: 3rdparty/py/lockfile.txt}
?witty-crayon-22786
12/16/2021, 11:34 PMancient-vegetable-10556
12/16/2021, 11:34 PMhundreds-father-404
12/16/2021, 11:35 PM.json
?ancient-vegetable-10556
12/16/2021, 11:35 PM.json
if it’s not arbitrary JSONhundreds-father-404
12/16/2021, 11:37 PM.lock
. Sg
But 3rdparty/jvm/lockfile.lock
is redudant. Any suggestions? artifacts.lock
seems fine other than upsetting non-American English speakers 🙈ancient-vegetable-10556
12/16/2021, 11:38 PM.pantslock
or .jvmlock
ancient-vegetable-10556
12/16/2021, 11:38 PMartifacts.lock
is not correct, as it also contains dependencies of artifacts 😄witty-crayon-22786
12/16/2021, 11:38 PMdefault
in the name might make sense. so default.lock
maybe. because users using multiple resolves will need to choose other names for the restancient-vegetable-10556
12/16/2021, 11:38 PMhundreds-father-404
12/16/2021, 11:39 PMjvm-default
or just jvm
?hundreds-father-404
12/16/2021, 11:39 PMjvm-default