Skip to content

DAOS-19345 build: propagate no_proxy/NO_PROXY through SCons MINIMAL_ENV#18696

Open
knard38 wants to merge 1 commit into
masterfrom
ckochhof/fix/master/daos-19345/patch-001
Open

DAOS-19345 build: propagate no_proxy/NO_PROXY through SCons MINIMAL_ENV#18696
knard38 wants to merge 1 commit into
masterfrom
ckochhof/fix/master/daos-19345/patch-001

Conversation

@knard38

@knard38 knard38 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

When a build host has an HTTP proxy configured (http_proxy/https_proxy) together with a no_proxy/NO_PROXY bypass list for hosts that should be reached directly, scons --build-deps=yes can fail to reach those bypassed hosts.

SConstruct's MINIMAL_ENV allow-list — used by _copy_env() to build the ENV dict passed to build subprocesses (see site_scons/prereq_tools/base.py) — forwards http_proxy/https_proxy but not no_proxy/NO_PROXY. Subprocesses such as pip/uv therefore inherit the proxy with no bypass exemption at all, and route requests for hosts that should be reached directly through a proxy that may not be able to reach them.

Add no_proxy and NO_PROXY to MINIMAL_ENV to SConstruct, mirroring the existing http_proxy/https_proxy entries:

-MINIMAL_ENV = ('HOME', 'TERM', 'SSH_AUTH_SOCK', 'http_proxy', 'https_proxy', 'PKG_CONFIG_PATH',
-               'MODULEPATH', 'MODULESHOME', 'MODULESLOADED', 'I_MPI_ROOT', 'COVFILE')
+MINIMAL_ENV = ('HOME', 'TERM', 'SSH_AUTH_SOCK', 'http_proxy', 'https_proxy',
+               'no_proxy', 'NO_PROXY', 'PKG_CONFIG_PATH',
+               'MODULEPATH', 'MODULESHOME', 'MODULESLOADED', 'I_MPI_ROOT', 'COVFILE')

_copy_env()'s existing if value: guard (unchanged) already skips variables that aren't set in the caller's environment, so this is a no-op for any build that doesn't configure a proxy.

Steps for the author:

  • Commit message follows the guidelines.
  • Appropriate Features or Test-tag pragmas were used.
  • Appropriate Functional Test Stages were run.
  • At least two positive code reviews including at least one code owner from each category referenced in the PR.
  • Testing is complete. If necessary, forced-landing label added and a reason added in a comment.

After all prior steps are complete:

  • Gatekeeper requested (daos-gatekeeper added as a reviewer).

@knard38 knard38 self-assigned this Jul 22, 2026
@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

Ticket title is 'SConstruct: MINIMAL_ENV does not forward no_proxy/NO_PROXY'
Status is 'Open'
https://daosio.atlassian.net/browse/DAOS-19345

@knard38
knard38 marked this pull request as ready for review July 22, 2026 08:24
@knard38
knard38 requested review from a team as code owners July 22, 2026 08:24
MINIMAL_ENV defines the whitelist of env vars forwarded into SCons's ENV
dict, used as the subprocess environment for all build commands (see
site_scons/prereq_tools/base.py):

    rc = subprocess.call(cmd, ..., env=passed_env['ENV'])

It already included 'http_proxy'/'https_proxy' so the corporate proxy
reaches build subprocesses, but 'no_proxy'/'NO_PROXY' were absent,
meaning any bypass rules set by the caller were silently stripped
before build subprocesses saw the environment, while the proxy URL
itself was preserved.

On hosts where the proxy cannot reach internal package mirrors (e.g.
an on-premises Artifactory instance), the missing no_proxy causes
pip/uv subprocesses invoked during dependency builds (e.g. rebuilding
the spdk prereq's Python bindings) to route requests for the mirror
through the proxy, which then times out.

The existing _copy_env() guard ('if value:') prevents empty strings
from being forwarded when the variables are unset in the caller's
environment, so this change is a no-op for builds that do not
configure a proxy.

Signed-off-by: Cedric Koch-Hofer <cedric.koch-hofer@hpe.com>
@knard38
knard38 force-pushed the ckochhof/fix/master/daos-19345/patch-001 branch from b35b9eb to 3d3b384 Compare July 22, 2026 08:30
@knard38 knard38 changed the title Ckochhof/fix/master/daos 19345/patch 001 DAOS-19345 build: propagate no_proxy/NO_PROXY through SCons MINIMAL_ENV Jul 22, 2026
@kjacque
kjacque removed request for a team July 22, 2026 21:58
@knard38
knard38 requested a review from a team July 23, 2026 08:52
@knard38

knard38 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

@daos-stack/daos-gatekeeper could you lend this PR with the following message:

  • title: DAOS-19345 build: propagate no_proxy/NO_PROXY through SCons MINIMAL_ENV
  • body:
Add no_proxy and NO_PROXY to SConstruct's MINIMAL_ENV, mirroring the
existing http_proxy/https_proxy entries. Without them, proxy-bypass
rules were silently stripped from build subprocesses (pip/uv), routing
bypassed hosts through a proxy that may not reach them. No-op when no
proxy is configured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants