rhythmic-morning-87313
05/24/2022, 3:24 PMhundreds-father-404
05/24/2022, 3:26 PMProtoc works
I think it'd be cool if we supported this via BUILD files. I'm not sure what an ideal design would look like. Any thoughts?
--
In the meantime, are you blocked? We can help w/ writing a little pluginrhythmic-morning-87313
05/24/2022, 3:27 PMrhythmic-morning-87313
05/24/2022, 3:28 PMrhythmic-morning-87313
05/24/2022, 3:28 PMrhythmic-morning-87313
05/24/2022, 3:29 PMrhythmic-morning-87313
05/24/2022, 3:31 PM<http://MANIFEST.in|MANIFEST.in> to selectively include binary resources for a specific target architecture.hundreds-father-404
05/24/2022, 3:37 PMIf I could run a specific shell script before/after specific build targetsHave you seen this page? https://www.pantsbuild.org/docs/run-shell-commands
rhythmic-morning-87313
05/24/2022, 3:38 PMhundreds-father-404
05/24/2022, 3:38 PMrhythmic-morning-87313
05/24/2022, 3:38 PMrhythmic-morning-87313
05/24/2022, 3:38 PMrhythmic-morning-87313
05/24/2022, 3:38 PMrhythmic-morning-87313
05/24/2022, 3:40 PMhundreds-father-404
05/24/2022, 3:42 PMwould there be any possibility to hook into the MANIFEST (or something like package-data section) generation steps of the setup-py generator?How is that working? Generally, you would likely create a new target type, maybe like this:
platform_specific_resource(
linux_x86_source="linux.ext",
macos_x86_source="mac.ext",
)
Then, you will use "codegen". It looks similar to https://github.com/pantsbuild/pants/blob/main/src/python/pants/backend/docker/util_rules/dockerfile.py, where you create a GenerateSourcesRequest. But it would be input=MyCustomSourceField and output=ResourceSourceField. You'll request the type Platform in the rule and figure out which file to load based on thatrhythmic-morning-87313
05/24/2022, 3:42 PMplatform_specific_resources() target which resembles the vanilla resources() target? (where I can control the target platform using a CLI argument or environment variable)hundreds-father-404
05/24/2022, 3:47 PMWhere I can control the target platform using a CLI argument or environment variableYou could do that too if you want. For CLI arguments, you would set up a subsystem and then consume it in your rule https://www.pantsbuild.org/docs/rules-api-subsystems For env variable, https://www.pantsbuild.org/docs/rules-api-process#environment-variables
hundreds-father-404
05/24/2022, 3:47 PMyou would likely create a new target typehttps://www.pantsbuild.org/docs/target-api-new-targets general codegen guide: https://www.pantsbuild.org/docs/plugins-codegen
rhythmic-morning-87313
05/24/2022, 3:49 PMrhythmic-morning-87313
05/25/2022, 6:10 AMlinux_x86_source and macos_x86_source for a single file. But in this case I need to declare custom fields for all possible combinations of the platforms. How could I avoid that?rhythmic-morning-87313
05/25/2022, 6:11 AMrhythmic-morning-87313
05/25/2022, 8:38 AM