boundless-monitor-67068
06/28/2023, 2:42 PMrefined-addition-53644
06/28/2023, 2:46 PMpants.ci.toml
to run CI specific stuff.boundless-monitor-67068
06/28/2023, 2:59 PMboundless-monitor-67068
06/28/2023, 3:00 PMaverage-breakfast-91545
06/28/2023, 3:54 PMcurved-television-6568
06/28/2023, 4:18 PM# BUILD
pex_binary(name="bin", environment=parametrize("local", "linux"), ...)
local_environment(name="local", ...)
docker_environment(name="docker", ...)
docker_image(name="image", dependencies=[":bin@linux"], ...)
# pants.toml
[environments-preview.names]
local = "//:local"
linux = "//:docker"
# pants.ci.toml
[environments-preview.names.add]
linux = "//:local"
that is, locally you use two environments while in CI you short circuit the linux env to be the same as the local one.
Not tested this myself, so pls share how it turns out if you try this šaverage-breakfast-91545
06/28/2023, 4:19 PMcurved-television-6568
06/28/2023, 4:20 PM# .pants.rc
[environments-preview.names.add]
linux = "//:local"
to mimic the ci setup and not use docker at all.. šaverage-breakfast-91545
06/28/2023, 4:20 PMboundless-monitor-67068
06/29/2023, 7:41 AMboundless-monitor-67068
06/29/2023, 7:49 AMboundless-monitor-67068
06/29/2023, 10:50 AMcurved-television-6568
06/29/2023, 1:29 PMenvironment=parametrize(*env("ENVIRONMENTS").split())
also, I think thereās an open issue wrgt parametrizing with only a single arg, so this may not even work, I realizeā¦
ah, yes https://github.com/pantsbuild/pants/issues/16978curved-television-6568
06/29/2023, 1:31 PM2 environments (local and linux) that are compatible and doesnāt know which one to choose.when the two environments refers to the same actual target, I think it should be smart enough to use it, so this is a bug/feature request I think.
boundless-monitor-67068
06/29/2023, 2:18 PMAmbiguousEnvironmentError: MultipleI think I got it working by having the docker environment fall back to local. Could also disable docker execution in the CI? Overall, it feels like there's some work to be done with respect to environments, but you know this alreadytargets fromlocal_environment
are compatible with the current platform[environments-preview].names
, so it is ambiguous which to use: ['//:local_linux', '//:local_linux']linux_x86_64
curved-television-6568
06/29/2023, 2:44 PM