fast-nail-55400
01/03/2023, 11:10 PMDifferingFamiliesError: Expected AddressMaps to share the same parent directory 'cgo', but received: '/BUILD._go_sdk'
I was trying to run ./pants_from_sources dependencies cgo/cgotest2::
in my Go backend testing repo https://github.com/tdyas/pants-go-testing.
It seems like the synthetic _go_sdk
target was being created in the subdirectory and not the root of the repo as expected. Thoughts?fast-nail-55400
01/03/2023, 11:11 PM/BUILD._go_sdk
to `BUILD._go_sdk`(withou the /
).curved-television-6568
01/03/2023, 11:13 PMcurved-television-6568
01/03/2023, 11:16 PMSyntheticAddressMaps.for_targets_request()
constructor?
Example: https://github.com/pantsbuild/pants/blob/2a6640cd7b0918f08ab28c28b8f3b9ee9a90c60f/src/python/pants/backend/python/goals/lockfile.py#L301-L311curved-television-6568
01/03/2023, 11:16 PMrequest
type on your generated BUILD._go_sdk
file..curved-television-6568
01/03/2023, 11:18 PMreturn SyntheticAddressMaps([
SyntheticAddressMap.create(os.path.join(request.path, "BUILD._go_sdk"), [TargetAdaptor(GoSdkTarget.alias, name="default_go_sdk")])
])
curved-television-6568
01/03/2023, 11:20 PMfast-nail-55400
01/03/2023, 11:22 PM_go_sdk
target type, not a copy of it in every directory.curved-television-6568
01/03/2023, 11:22 PMpath: str = SyntheticTargetsRequest.REQUEST_TARGETS_PER_DIRECTORY
but the other onecurved-television-6568
01/03/2023, 11:23 PMpath: str = SyntheticTargetsRequest.SINGLE_REQUEST_FOR_ALL_TARGETS
fast-nail-55400
01/03/2023, 11:23 PMcurved-television-6568
01/03/2023, 11:24 PMSyntheticTargetsRequest
in synthetic_targets.py for a minute, it goes over that in detail πcurved-television-6568
01/03/2023, 11:25 PMfast-nail-55400
01/03/2023, 11:26 PMspec_paths_request = SyntheticTargetsRequest.SINGLE_REQUEST_FOR_ALL_TARGETS
and then copy pasta'ed the other wrong line when that first attempt obviously failed to typecheck ...fast-nail-55400
01/03/2023, 11:27 PMfast-nail-55400
01/03/2023, 11:28 PMcurved-television-6568
01/03/2023, 11:32 PMfast-nail-55400
01/03/2023, 11:32 PM% ./pants_from_sources --print-stacktrace dependencies cgo/life
//:default_go_sdk#flag
//:default_go_sdk#fmt
cgo/life/pkg:pkg
cgo/life:life