bitter-ability-32190
05/26/2022, 4:48 PMfile and just use resource everywhere.
Google Doc: https://docs.google.com/document/d/1pGib2ZJiyltfij0aZMm81S2XbATa8s6_ghuLnf2Xr_k/edit?usp=sharingbitter-ability-32190
05/26/2022, 4:49 PMbitter-ability-32190
05/26/2022, 4:49 PMbitter-ability-32190
05/26/2022, 8:20 PMhundreds-father-404
05/26/2022, 9:25 PMwitty-crayon-22786
05/26/2022, 9:26 PMwitty-crayon-22786
05/26/2022, 9:26 PMhappy-kitchen-89482
05/26/2022, 10:00 PMbitter-ability-32190
05/27/2022, 12:32 AMbitter-ability-32190
05/27/2022, 4:01 PMbitter-ability-32190
05/31/2022, 1:27 PMfile and resource will be deprecated for a single unambiguous type asset.bitter-ability-32190
05/31/2022, 1:27 PMhundreds-father-404
05/31/2022, 4:37 PMasset and clarify what's going in: this is about not forcing specific functionality into a target typebitter-ability-32190
05/31/2022, 6:53 PMfile sitting outside our main code tree into our main code tree as a resource. It's impossible today, but would be trivially supported by relocated_assets in the propsal.curved-television-6568
06/01/2022, 3:22 PMassets target ought to be able to cover the use cases for files and resources, but I see all the nuances presented in the comments in that google doc, it makes my (granted, somewhat tired 𼹠) head spin. đwitty-crayon-22786
06/01/2022, 6:21 PMhundreds-father-404
06/01/2022, 6:23 PMgo_package depending on an `asset`:
⢠at compilation time, we include the asset in the sandbox. Go will need it if the user is using embed. Otherwise, it will just be ignored by the compiler
⢠at test time, we include the asset in the sandbox. The user might access it via Filesystem APIs. Otherwise, ignoredbitter-ability-32190
06/01/2022, 6:23 PMwitty-crayon-22786
06/01/2022, 6:23 PMhundreds-father-404
06/01/2022, 6:24 PMwitty-crayon-22786
06/01/2022, 6:25 PMbitter-ability-32190
06/01/2022, 6:26 PMi canât avoid both packing a huge file into my app and placing it in the sandboxIs that true? would the asset not be a dependency of the test, and therefore be place din the sandbox?
witty-crayon-22786
06/01/2022, 6:27 PMbitter-ability-32190
06/01/2022, 6:27 PMwitty-crayon-22786
06/01/2022, 6:28 PMwitty-crayon-22786
06/01/2022, 6:29 PMasset as a loose file? i.e., a test target depending on an asset would always get it as loose?hundreds-father-404
06/01/2022, 6:29 PMfoo_sourceGo only has a single target type:
go_package. So when you add a dep to it, it might be because the "source" code uses the embed (resources) API at compilation time. Or it could be because tests are reading it as a loose file w/ Filesystem API. By getting rid of file vs resource, Pants loses the ability to distinguish intent
Other than the performance concern, I think That Is Just Fine thoughbitter-ability-32190
06/01/2022, 6:30 PMOr it could be because tests are reading it as a loose file w/ Filesystem API.Help me understand why it'd be a dependency of the
go_package if it is a test-time dependencyhundreds-father-404
06/01/2022, 6:31 PMgo_package includes both the source files & test files. There is no go_tests, it is just go_packagewitty-crayon-22786
06/01/2022, 6:31 PMbitter-ability-32190
06/01/2022, 6:35 PMbitter-ability-32190
06/01/2022, 6:35 PMwitty-crayon-22786
06/01/2022, 6:36 PMbitter-ability-32190
06/01/2022, 6:37 PMwitty-crayon-22786
06/01/2022, 6:37 PMdata dependencies is for requests like this: https://github.com/pantsbuild/pants/issues/15500 ⌠i need to better understand why Alonso wanted transitive file dependencies there.
The only alternative now is making thedependencies being direct, which is not optimal as it forces downstream targets knowing about all of their upstream potentialfiledependencies.file
witty-crayon-22786
06/01/2022, 6:38 PMbitter-ability-32190
06/01/2022, 6:39 PMbitter-ability-32190
06/01/2022, 6:40 PMwitty-crayon-22786
06/01/2022, 6:40 PMFor that ticket it seems like a cheating shortcut to include a dependency on the source so that all test environments inherit the asset.i mean, thatâs what the distinction between
resources and files iswitty-crayon-22786
06/01/2022, 6:41 PMwitty-crayon-22786
06/01/2022, 6:41 PMbitter-ability-32190
06/01/2022, 6:43 PMwitty-crayon-22786
06/01/2022, 6:44 PMbitter-ability-32190
06/01/2022, 6:46 PMwitty-crayon-22786
06/01/2022, 6:48 PMdeploy_jar, go_binary, or pex_binary and a test ⌠rather, between an `archive`/`docker_image` and a test.
but i think that that is orthogonal to the transitive-or-not discussionbitter-ability-32190
06/01/2022, 6:50 PMpex_binary, when we build the archive we throw away the files for the pex_binary but then transitvely inherit them back for the archive itself?!
Talk about nuanced đľbitter-ability-32190
06/01/2022, 6:53 PMwitty-crayon-22786
06/01/2022, 6:54 PMwitty-crayon-22786
06/01/2022, 6:55 PMwitty-crayon-22786
06/01/2022, 6:57 PMthe other is some consuming targets actually caring about the distinction between the types&&
In places where the usage is ambiguous (should hopefully be be rare. I can only think of tests which themselves must be compiled).âŚwe have https://www.pantsbuild.org/docs/reference-python_tests#coderuntime_package_dependenciescode already as an âedge metadataâ case.
witty-crayon-22786
06/01/2022, 6:58 PMbitter-ability-32190
06/01/2022, 7:06 PMwitty-crayon-22786
06/01/2022, 7:08 PMOn the asset consumption side theres no ambiguity on what the user desired because they told us.âŚis already supposed to be the case. to the extent that we currently have unclear docs on this subject, we probably still will⌠but perhaps being contextualized on a target by target basis would help.
bitter-ability-32190
06/01/2022, 7:10 PMpython_source depends on a file is meaningless (especially when packaging) unless you consider a python_test or an archive which is depended on by a pex_binary.witty-crayon-22786
06/01/2022, 7:12 PMdata_dependency equivalent is transitivehundreds-father-404
06/01/2022, 7:12 PMbitter-ability-32190
06/01/2022, 7:15 PMbitter-ability-32190
06/01/2022, 7:15 PMbitter-ability-32190
06/04/2022, 12:53 AMruntime_dependencies can be avoided and we can enjoy a simple target harmony.
I have thoughts on our rollout/deprecation too, so stay tunedbitter-ability-32190
06/04/2022, 3:37 PMbitter-ability-32190
06/07/2022, 2:23 PMhundreds-father-404
06/07/2022, 2:32 PMwitty-crayon-22786
06/07/2022, 6:41 PMwitty-crayon-22786
06/07/2022, 6:42 PMbitter-ability-32190
06/07/2022, 6:45 PMwitty-crayon-22786
06/07/2022, 6:47 PMwitty-crayon-22786
06/07/2022, 7:06 PMwitty-crayon-22786
06/07/2022, 7:07 PMhappy-kitchen-89482
06/07/2022, 7:35 PMwitty-crayon-22786
06/07/2022, 7:36 PMwitty-crayon-22786
06/08/2022, 5:36 PMhundreds-father-404
06/08/2022, 5:51 PMwitty-crayon-22786
06/08/2022, 5:52 PMbitter-ability-32190
06/08/2022, 5:52 PMhappy-kitchen-89482
06/09/2022, 6:51 AMbitter-ability-32190
06/09/2022, 5:56 PM