<#18114 go: environment-specific dependencies due ...
# github-notifications
q
#18114 go: environment-specific dependencies due to conditional compilation Issue created by tdyas Once #18113 lands,
go_binary
will support non-local environments but there is a bug, however: Dependencies for packages in the Go SDK (and Go packages in general) can vary between local and non-local environments due to conditional compilation of sources . For example, the
runtime
package in the Go SDK only uses the
runtime/internal/syscall
package on Linux but not macOS. Currently, those dependencies are setup statically based on the local environment while creating the
//:default_go_sdk
synthetic target. (Dependency inference is not used since it would result in a rule graph cycle.) Potential solutions: 1. Keep the synthetic target for now to avoid exposing
go_sdk
target type to users before we are ready. The code in
build_pkg_target.py
will lookup Go SDK dependencies dynamically without relying on dependency inference or the static setup of the synthetic target and its generated targets. 2. Explore whether introducing a
go_sdk
target type and enabling dependency inference would solve the problem. If
go_sdk
is not a synthetic target, then this might avoid the rule graph error which I encountered previously. pantsbuild/pants