ancient-vegetable-10556
02/18/2022, 6:11 PMClasspathEntry, which is not true for file targets. As I go through and break this assumption, I’m wondering if I should be silently ignoring all non-classpath dependencies when assembling the classpath, or if I should have some way of affirmatively opting into this behaviour. (@witty-crayon-22786 @fast-nail-55400)witty-crayon-22786
02/18/2022, 6:12 PMwitty-crayon-22786
02/18/2022, 6:13 PMTo fix this, we add support tofor “root only” requests, which allow for requesting a classpath for a target when it is a root, but failing when the target type is used as an inner node (since we don’t want `deploy_jar`s to be used as dependencies of JVM compile targets anytime soon).ClasspathEntryRequest
ancient-vegetable-10556
02/18/2022, 6:14 PMwitty-crayon-22786
02/18/2022, 6:17 PMAs I go through and break this assumption, I’m wondering if I should be silently ignoring all non-classpath dependencies when assembling the classpath, or if I should have some way of affirmatively opting into this behaviour.good question. so far, confirming that we should ignore is mostly a precautionary measure to make sure that we don’t miss cases. but it will rule out some cases that we can’t imagine, so loosening it over time, or removing the requirement entirely might be reasonable.
ancient-vegetable-10556
02/18/2022, 6:18 PMFileSourceFieldwitty-crayon-22786
02/18/2022, 6:18 PMfast-nail-55400
02/18/2022, 6:19 PMFileSourceField since relocated_files is implemented that way.)witty-crayon-22786
02/18/2022, 6:19 PMClasspathEntryRequestwitty-crayon-22786
02/18/2022, 6:21 PMfiles, per-se… an approach based on installing a “noop” ClasspathEntryRequest type would be good. then, if there was going to be a warning, it would be something like “there are no ClasspathEntryRequest types for `$target`” (which wouldn’t trigger for files, because we’d have a noop installed)…?ancient-vegetable-10556
02/18/2022, 6:23 PMClasspathEntry in placesancient-vegetable-10556
02/18/2022, 6:23 PMwitty-crayon-22786
02/18/2022, 6:26 PMfast-nail-55400
02/18/2022, 6:27 PMwitty-crayon-22786
02/18/2022, 6:27 PMancient-vegetable-10556
02/18/2022, 6:27 PMfast-nail-55400
02/18/2022, 6:28 PMancient-vegetable-10556
02/18/2022, 6:28 PMancient-vegetable-10556
02/18/2022, 7:17 PMancient-vegetable-10556
02/18/2022, 10:28 PMfile targets from relocated_files appear?ancient-vegetable-10556
02/18/2022, 10:28 PMRelocatedFiles target, which seems brittle)hundreds-father-404
02/18/2022, 10:30 PMfile targets. we generate a Snapshot of files that "look like" the sources of file targets
(this is actively being investigated for JVM to support compiled languages)witty-crayon-22786
02/18/2022, 10:31 PMancient-vegetable-10556
02/18/2022, 10:31 PMrelocated_files, I copied the golang code almost directly and my relevant snapshot was emptyancient-vegetable-10556
02/18/2022, 10:31 PMgolang tests too?)witty-crayon-22786
02/18/2022, 10:33 PMfiles target, code that wants to consume FilesSources should be making a `SourcesRequest`… the target that gets passed to the SourcesRequest needs to be one that has a SourcesField subclass which is convertible-to FilesSources.hundreds-father-404
02/18/2022, 10:34 PMfiles is limited to go/goals/test.py. Implemented at lines 284-294, key detail being enable_codegen=Trueancient-vegetable-10556
02/18/2022, 10:34 PMancient-vegetable-10556
02/18/2022, 10:34 PMancient-vegetable-10556
02/18/2022, 10:35 PMrelocated_files, per the tests in therehundreds-father-404
02/18/2022, 10:35 PMand my relevant snapshot was emptyWhat, in a test? You have to make sure
core/target_types.py rules() is activated for codegen rule of relocated_files to happenancient-vegetable-10556
02/18/2022, 10:36 PMhundreds-father-404
02/18/2022, 10:37 PMrelocated_files for Go test support. That's an oversight we aren't doing soancient-vegetable-10556
02/18/2022, 10:37 PMancient-vegetable-10556
02/18/2022, 10:38 PMrules() from core/target_types.py does not appear to do anything eitherancient-vegetable-10556
02/18/2022, 10:47 PMwitty-crayon-22786
02/18/2022, 10:49 PMrelocated_files for the purposes of your current change should be fine, because it’s very overlapped with Eric’s codegen workancient-vegetable-10556
02/18/2022, 10:50 PMwitty-crayon-22786
02/18/2022, 10:51 PMrelocated_files for go and jvm and marking it blocked by https://github.com/pantsbuild/pants/issues/14258 would be reasonable.ancient-vegetable-10556
02/18/2022, 10:58 PM