Bug 15954

Summary: `do_compile[network] = "1"` does not forward PROXY environment variables
Product: [Build System, Metadata & Runtime] BitBake Reporter: Alex Merkle <Alexander.Merkle>
Component: bitbakeAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED NOTABUG QA Contact:
Severity: normal    
Priority: Medium CC: JPEWhacker, poky.bs.watcher, poky.watcher, randy.macleod
Version: unspecified   
Target Milestone: 5.3   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

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)