Hi, I try to set up pantsbuild to build pex files ...
# general
b
Hi, I try to set up pantsbuild to build pex files on MacOs within a docker environment using podman. However, I get always a persmission error:
Copy code
IntrinsicError: Failed to execute: Process {
    argv: [
        "/bin/tar",
        "-xvf",
        "cpython-3.11.10+20241008-x86_64-unknown-linux-gnu-install_only.tar.gz",
    ],
    env: {
        "PATH": "/usr/bin:/bin:/usr/local/bin:/opt/homebrew/bin",
    },
    working_directory: None,
    input_digests: InputDigests {
        complete: DirectoryDigest {
            digest: Digest {
                hash: Fingerprint<1b39261139a602b99605b617ff193df4952d000c5d7d10e6526352392977683c>,
                size_bytes: 149,
            },
            tree: "Some(..)",
        },
        nailgun: DirectoryDigest {
            digest: Digest {
                hash: Fingerprint<e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855>,
                size_bytes: 0,
            },
            tree: "Some(..)",
        },
        inputs: DirectoryDigest {
            digest: Digest {
                hash: Fingerprint<1b39261139a602b99605b617ff193df4952d000c5d7d10e6526352392977683c>,
                size_bytes: 149,
            },
            tree: "Some(..)",
        },
        immutable_inputs: {},
        use_nailgun: {},
    },
    output_files: {},
    output_directories: {
        RelativePath(
            "python",
        ),
    },
    timeout: None,
    execution_slot_variable: None,
    concurrency_available: 0,
    description: "Extract Pants' execution Python",
    level: Debug,
    append_only_caches: {},
    jdk_home: None,
    cache_scope: Successful,
    execution_environment: ProcessExecutionEnvironment {
        name: Some(
            "docker",
        ),
        platform: Linux_x86_64,
        strategy: Docker(
            "sha256:93b9055430ce944e6316e724e814427c9ad63c3fb9d87577f7e8436b9aa594c3",
        ),
    },
    remote_cache_speculation_delay: 0ns,
    attempt: 0,
}

Failed to digest inputs: "Failed to open \"/private/var/folders/cp/l_x7790x5y1cgsx3lcvkt34jktdbmw/T/pants-sandbox-StVDus/python/share/terminfo/1/1178\": Permission denied (os error 13)"
I guess this is more likely related to the podman setup but maybe someone knows how to fix it. Build the pex file on my host system (MacOs) works. This is the docker environment I am using:
Copy code
docker_environment(
  name="docker",
  platform="linux_x86_64",
  image="python:3.10-slim-buster",
)
Thx
h
Normally you can run with
--keep-sandboxes=on_failure
and poke around in the sandbox to see what files are set up, which permissions they have etc. I’m not 100% sure if that works in sandboxes in environments though. But worth a try. If it does work, you’ll need to shell into the running container to poke around.
Unclear why it would be looking at a relpath
python/share/terminfo
. I would expect an abspath
/usr/share/terminfo
Is
TERMINFO
set in the relevant environment?
b
Thx Benjy. I will check if I can find a solution
Okay. I have digged a little deeper and it seems that the issue is with the cpython tar that is downloaded. It seems that the permissions for the soft links is not always set correctly. This happens only if I unpack the tar to the sand-box folder that is shared with the host (in my case MacOs). If I unpack the tar into another folder I get no permission denied error. I have the feeling that the volume mount to the host somehow screw up the permissions...
I think it has to do with the fact that linux is case-sensitive and mac is case-insensitive and when sharing the volume strange things are happening ...
h
Well, ugh
but also, there should be no need to have the sandboxes shared with the host
IIRC those should be in local tempdirs
b
hmm I can change the path of the sandbox by setting
local_execution_root_dir
but this will only accept volumes that are mounted to the container. I guess it makes kind of sense in order to be able to inspect the sandbox if the pipelines fails
h
Oh hmm, interesting. Yeah, that is a setting in the host filesystem I guess. But I don’t think it should be, makes little sense to require container sandboxes to be in mounted volumes. They are like tempdirs.