https://pantsbuild.org/ logo
#general
Title
# general
b

better-sunset-63499

02/15/2022, 5:17 PM
Is there a version of
file
or
resource
that allows pulling from a URL? I see
jvm_artifact
has a
url=
option for pulling third-party jars, and in a plugin you are given
DownloadFile
https://www.pantsbuild.org/docs/rules-api-file-system#downloadfile if you write a custom plugin
h

hundreds-father-404

02/15/2022, 5:18 PM
Hi! We'd be very happy to help out if you wanted to take a crack at implementing https://github.com/pantsbuild/pants/issues/13589
🤔 1
b

better-sunset-63499

02/15/2022, 5:18 PM
For more context: during a
package
step I have a mapping file generated by another team that needs to be included in the final artifact, but I don't want it committed my team's repo. They currently have it available at a URL (yay!) and today it's downloaded in a bash script
👍 1
h

hundreds-father-404

02/15/2022, 5:19 PM
You could also use
experimental_shell_command
, I believe: https://www.pantsbuild.org/v2.10/docs/run-shell-commands
b

better-sunset-63499

02/15/2022, 5:19 PM
gotcha - so basically no it's not "supported" in the sense there's a way to do it
That's what
experimental_*
means right?
h

happy-kitchen-89482

02/15/2022, 5:24 PM
experimental_
stuff is usable, it just might not have a stable API yet, or it might be missing features or documentation.
h

hundreds-father-404

02/15/2022, 5:24 PM
The "experimental" part is solely to give us time to hear feedback from users before we stabilize the mechanism, like if we end up needing to redesign certain parts. We aren't obligated to follow the normal deprecation policy: https://www.pantsbuild.org/v2.10/docs/deprecation-policy, although we do make a best-effort attempt to still do so Several users have been using
experimental_shell_command
in production fine. Re
experimental_shell_command
vs the proposal at https://github.com/pantsbuild/pants/issues/13589, that ticket would give you a more first class way to do things. No need for you to define the
experimental_shell_command
logic which would probably need to do something like use
curl
, then would be good to use
shasum
to validate that the file is expected (supply chain attacks). Pants would do all that heavy lifting for you. Both work, but latter is more convenient
👍 1
h

happy-kitchen-89482

02/15/2022, 5:25 PM
So it's supported in the practical sense of the word. We on Slack will provide support for it :)
b

better-sunset-63499

02/15/2022, 5:33 PM
gotcha, thanks for the clarification