Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corepack Npm installation doesnt work through proxy #21491

Open
Husky22 opened this issue Oct 4, 2024 · 1 comment
Open

Corepack Npm installation doesnt work through proxy #21491

Husky22 opened this issue Oct 4, 2024 · 1 comment
Assignees
Labels
backend: JavaScript JavaScript backend-related issues bug

Comments

@Husky22
Copy link

Husky22 commented Oct 4, 2024

Describe the bug
The corepack installation process doesnt get the http_proxy or https_proxy env variables even though pants.toml has the following
settings:

[subprocess-environment]
env_vars.add = ["http_proxy", "https_proxy"]

Debug of corepack process:

10:39:47.48 [DEBUG] spawned local process as Some(275230) for Process 
{ argv: ["yarn", "install"], 
env: {
"COREPACK_HOME": "/tmp/pants-sandbox-7UwdMw/._corepack_home", 
"PATH": "/tmp/pants-sandbox-7UwdMw/_binary_shims_d71438cc82ac7616b94db5246abc83b636b9bc4e66183a6ff021d42bf26ed483:/tmp/pants-sandbox-7UwdMw/__node/._corepack:/tmp/pants-sandbox-7UwdMw/__node/./node-v16.15.0-linux-x64/bin",
"YARN_CACHE_FOLDER": "/tmp/pants-sandbox-7UwdMw/._yarn_cache", "npm_config_cache": "._npm"},
working_directory: Some(RelativePath("src/javascript/frontend")),
input_digests: InputDigests { complete: DirectoryDigest { digest: Digest { hash: Fingerprint<f2d0b73b93dc60516dbcba07a41f42122bd162ef0aba4853e85c5ca79d1e8284>, size_bytes: 312 }, tree: "Some(..)" }, 
nailgun: DirectoryDigest { digest: Digest { hash: Fingerprint<e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855>, size_bytes: 0 }, tree: "Some(..)" }, 
inputs: DirectoryDigest { digest: Digest { hash: Fingerprint<3cb7dd639d662b77a07458b306bd8fc6b72ef88c1d18372caddc9b0df200d407>, size_bytes: 77 }, tree: "Some(..)" }, 
immutable_inputs: {RelativePath("__node"): DirectoryDigest { digest: Digest { hash: Fingerprint<106533f8da8fc65cb5c71358ebf756ed99a30b24bc23ccf16555a633a30dbd74>, size_bytes: 183 }, tree: "Some(..)" }, RelativePath("_binary_shims_d71438cc82ac7616b94db5246abc83b636b9bc4e66183a6ff021d42bf26ed483"): DirectoryDigest { digest: Digest { hash: Fingerprint<d71438cc82ac7616b94db5246abc83b636b9bc4e66183a6ff021d42bf26ed483>, size_bytes: 641 }, tree: "Some(..)" }}, use_nailgun: {} }, 
output_files: {RelativePath("yarn.lock")},
output_directories: {}, 
timeout: None, 
execution_slot_variable: None, concurrency_available: 0, 
description: "generate yarn.lock for 'javascript.frontend'.", 
level: Info, 
append_only_caches: {CacheName("npm"): RelativePath("._npm"), CacheName("yarn_cache"): RelativePath("._yarn_cache")},
jdk_home: None, 
cache_scope: Successful, 
execution_environment: ProcessExecutionEnvironment { name: None, platform: Linux_x86_64, strategy: Local }, remote_cache_speculation_delay: 0ns, attempt: 0 }

Pants version
2.22.0

OS
Linux

Additional info

@Husky22 Husky22 added the bug label Oct 4, 2024
@cburroughs cburroughs added the backend: JavaScript JavaScript backend-related issues label Oct 4, 2024
@krishnan-chandra
Copy link
Contributor

You might need to set corepack_env_vars in the nodejs subsystem to pass those variables through to corepack. I think if you add the HTTP_PROXY and HTTPS_PROXY variables there, it should fix the issue.

@krishnan-chandra krishnan-chandra self-assigned this Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend: JavaScript JavaScript backend-related issues bug
Projects
None yet
Development

No branches or pull requests

3 participants