Bug 15954 - `do_compile[network] = "1"` does not forward PROXY environment variables
Summary: `do_compile[network] = "1"` does not forward PROXY environment variables
Status: RESOLVED NOTABUG
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: unspecified
Hardware: All Multiple
: Medium normal
Target Milestone: 5.3
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2025-08-14 13:35 UTC by Alex Merkle
Modified: 2025-08-14 14:53 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Merkle 2025-08-14 13:35:43 UTC
Hi,
while working with a bitbake/yocto based project I noticed a build fail while the `do_compile` phase of a `go` based project. According to my observation the `go.bbclass` sets `do_compile[network] = "1"` as go downloads the pkgs while the compile step. This works fine if NO corporate proxy is in place.

I noticed that the proxy environment variables
  http_proxy/https_proxy/no_proxy (as well as the uppercase variants)
were not part of the environment of the compile phase. Thus it fails to downloads the go pkgs.

I handed in a patch
  https://lists.openembedded.org/g/bitbake-devel/message/17809
that uses the existing `export_proxies` routine to forward the proxy related variables (among others https://git.yoctoproject.org/poky/tree/bitbake/lib/bb/fetch2/__init__.py#n873)
Comment 1 Joshua Watt 2025-08-14 14:49:20 UTC
The proxies being set is a property of the do_fetch task, not the network flag. We don't really want to associate the proxy support to the network flag. However, correct fix should be pretty simple: add a prefunc to your do_compile task that explicitly calls  bb.utils.export_proxies(d)