All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] bitbake-worker: remove the network flag
@ 2023-09-10 19:46 rs
  2023-09-10 19:57 ` Alexander Kanavin
  2023-09-10 20:17 ` Richard Purdie
  0 siblings, 2 replies; 8+ messages in thread
From: rs @ 2023-09-10 19:46 UTC (permalink / raw)
  To: richard.purdie, alex.kanavin; +Cc: bitbake-devel, denis, reatmon, Randolph Sapp

From: Randolph Sapp <rs@ti.com>

The network flag does not currently respect proxies by default as the
fetch stage does [1]. As such it only works for some users at the whim
of the recipe writer.

This introduces an issue downstream as the build results are now
dependent on the network architecture of the builder, the recipe in
question, and the combination of proxy variables they choose to export
in addition to the normal host variables that affect builds (host tool
version, build environment, etc).

This is far more indeterminate than a build system that properly exports
proxy variables. If abuse of the network tag is an issue, then the
network tag should be removed in it's current state and networking
should depend entirely on whether the current task is 'do_fetch'.

[1] https://lists.openembedded.org/g/bitbake-devel/topic/100924096

Signed-off-by: Randolph Sapp <rs@ti.com>
---

What I feel would be the proper solution to the aforementioned issues.

Examples of layers that currently use the network flag outside of the do_fetch
stage:

	oe-core (icecc.bbclass)
	meta-openembedded (go recipes)
	meta-flutter (all flutter recipes and classes)

This is not an attempt to shame maintainers. I'm just curious why the network
task expects every maintainer to handle proxy variables (something pretty much
required if you are actually using the network in that task) independently. It
just results in needless debugging and a bunch of patches attempting to export
variables in their own way. Sorry if this comes off as antagonistic in any way.

 bin/bitbake-worker                                       | 2 +-
 doc/bitbake-user-manual/bitbake-user-manual-metadata.rst | 6 ------
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/bin/bitbake-worker b/bin/bitbake-worker
index 451e6926..f25880c1 100755
--- a/bin/bitbake-worker
+++ b/bin/bitbake-worker
@@ -270,7 +270,7 @@ def fork_off_task(cfg, data, databuilder, workerdata, extraconfigdata, runtask):
 
                 bb.utils.set_process_name("%s:%s" % (the_data.getVar("PN"), taskname.replace("do_", "")))
 
-                if not bb.utils.to_boolean(the_data.getVarFlag(taskname, 'network')):
+                if taskname != 'do_fetch':
                     if bb.utils.is_local_uid(uid):
                         logger.debug("Attempting to disable network for %s" % taskname)
                         bb.utils.disable_network(uid, gid)
diff --git a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
index 58975f4c..b35c332c 100644
--- a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
+++ b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
@@ -1519,12 +1519,6 @@ functionality of the task:
    released. You can use this variable flag to accomplish mutual
    exclusion.
 
--  ``[network]``: When set to "1", allows a task to access the network. By
-   default, only the ``do_fetch`` task is granted network access. Recipes
-   shouldn't access the network outside of ``do_fetch`` as it usually
-   undermines fetcher source mirroring, image and licence manifests, software
-   auditing and supply chain security.
-
 -  ``[noexec]``: When set to "1", marks the task as being empty, with
    no execution required. You can use the ``[noexec]`` flag to set up
    tasks as dependency placeholders, or to disable tasks defined
-- 
2.42.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-09-10 21:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-10 19:46 [PATCH v2] bitbake-worker: remove the network flag rs
2023-09-10 19:57 ` Alexander Kanavin
2023-09-10 20:11   ` [EXTERNAL] " Randolph Sapp
2023-09-10 20:16     ` Alexander Kanavin
2023-09-10 20:17 ` Richard Purdie
2023-09-10 20:50   ` [EXTERNAL] " Randolph Sapp
2023-09-10 21:16     ` [bitbake-devel] " Alexandre Belloni
2023-09-10 21:45       ` [EXTERNAL] " Randolph Sapp

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.