pantsbuild / pants

The Pants Build System
https://www.pantsbuild.org
Apache License 2.0
3.32k stars 636 forks source link

Optional pants modules need a way to register pantsbuild source roots for targets they export #1370

Closed jsirois closed 9 years ago

jsirois commented 9 years ago

Right now source roots are registered globally (via contrib/BUILD instead of via plugin - which is a secondary issue). Since they are registered globally, any invocation of pants using the checked-in pants.ini will need to have all contrib plugins loaded that define source roots for the targets they export. This conflicts with the goals of - for example - the self-publish CI check which tries to verify all plugins are publishable and consumable independently of one another. Devise and deploy a means to achieve both simple contrib addition and separation for the purposes of certain tests.

patricklaw commented 9 years ago

Strawman proposal: we should be able to declare source roots by dropping a specially named text or JSON file in the source root. +@ericzundel who I think was also interested in this idea back in the day.

jsirois commented 9 years ago

I think the mechanism is neither here nor there. The real issue is being able to turn on or off contrib plugin source root registrations dependening on what we want to test. Yes source_root in BUILD files is bad, but it has nothing to do with the current issue.

ericzundel commented 9 years ago

Getting rid of having to register a target type at all in a source root might be one way to go. I know that foursquare tells me that they do not register specific targets in their SourceRoot() declarations, which I think would get around this issue.

On Mon, Apr 6, 2015 at 2:26 PM John Sirois notifications@github.com wrote:

I think the mechanism is neither here nor there. The real issue is being able to turn on or off contrib plugin source root registrations dependening on what we want to test. Yes source_root in BUILD files is bad, but it has nothing to do with the current issue.

— Reply to this email directly or view it on GitHub https://github.com/pantsbuild/pants/issues/1370#issuecomment-90185960.

jsirois commented 9 years ago

That would certainly solve the pantsbuild issue. I'm still noodling on this a bit.

jsirois commented 9 years ago

https://rbcommons.com/s/twitter/r/2249/

jsirois commented 9 years ago

This has been addressed in a less-than-ideal but workable way in the RB above - now submitted @ https://github.com/pantsbuild/pants/commit/238143038b99eb087b513e7052a494bc3de6db75