public inbox for distributions@lists.linux.dev
 help / color / mirror / Atom feed
From: Simon Josefsson <simon@josefsson.org>
To: "Michał Górny" <mgorny@gentoo.org>
Cc: distributions@lists.linux.dev
Subject: Re: Standardizing NO_NETWORK and USE_SYSTEM_DEPS environment variables
Date: Thu, 23 Jan 2025 14:53:56 +0100	[thread overview]
Message-ID: <8734h9ocuj.fsf@josefsson.org> (raw)
In-Reply-To: <b0726076ea438d59d8b7b5d0f44a4ed6ca11d418.camel@gentoo.org> ("Michał Górny"'s message of "Thu, 23 Jan 2025 14:14:36 +0100")

[-- Attachment #1: Type: text/plain, Size: 2709 bytes --]

Michał Górny <mgorny@gentoo.org> writes:

> 1) NO_NETWORK -- if it's set to a non-empty value, it requests that
> programs don't access the (TCP/IP) network.

To me this sounds like an obviously good idea, and would consider using
both in my upstream and packaging work.

> 2) USE_SYSTEM_DEPS -- if it's set to a non-empty value, it requests that
> the build system does not use any vendored dependency for which it
> supports using a system version instead, and that it links to shared
> libraries whenever possible.
...
> For USE_SYSTEM_DEPS, the primary goal is to build against system
> dependencies.  For example, some upstreams either prefer using vendored
> dependencies or fallback to them when the system dependencies aren't
> found.  However, in Gentoo we really do want stuff to use system
> dependencies -- and if we miss to specify them appropriately, we'd
> rather see an error than an implicit fallback to a vendored dependency.
> So if USE_SYSTEM_DEPS is set, the build system should enable using
> system dependencies whenever supported, and disable all possible
> fallbacks to vendored dependencies.

This sounds really complicated, and speaking as an upstream that would
receive a request like this, my initial reaction would be that an
environment variable like that is a bad idea and that it is better to
handle it by the packager for each distribution.  Why?  In many of my
upstream packages, I have ./configure checks that inspects system
characteristics and changes behaviour of my code as appropriate.  I
believe this is the correct approach to handle system differences.  I
also believe it is not possible to adhear to a variable like that,
because it assumes there is one single ideal "system" version of
dependencies.  This isn't the case for almost anything.  Even trivial
functions like strverscmp() in low-level libc has had behavioural bugs
in them.  Should a USE_SYSTEM_DEPS cause the project to assume that
strverscmp() works correctly or not?  You can repeat this question for
even more trivial matters up to big things where there is no single
right answer at all, consider having to support multiple OpenSSL APIs
for example.  What OpenSSL version is a "system dependency"?  The only
reasonable response upstreams can do for this is to detect system
differences, and act accordingly.  Distributions who package these
packages usually just use the defaults, but if there is a bug for your
particular system (like strverscmp() or OpenSSL check returns
incorrectly), you have to patch things depending on how your environment
looks like.  Upstreams doesn't have the context knowledge you do to do
the right thing here.

/Simon

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1251 bytes --]

  parent reply	other threads:[~2025-01-23 14:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-23 13:14 Standardizing NO_NETWORK and USE_SYSTEM_DEPS environment variables Michał Górny
2025-01-23 13:50 ` Bruno Haible
2025-01-23 14:09   ` Eli Schwartz
2025-01-23 14:26   ` Michał Górny
2025-01-23 17:47     ` Bruno Haible
2025-01-23 13:53 ` Simon Josefsson [this message]
2025-01-23 14:37   ` Michał Górny
2025-01-23 14:04 ` Bernhard M. Wiedemann
2025-01-23 14:43   ` Michał Górny
2025-01-23 15:19 ` Celeste Liu
2025-01-23 15:38   ` Michał Górny
2025-01-23 16:13     ` Celeste Liu
2025-01-23 19:42   ` Simon Josefsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8734h9ocuj.fsf@josefsson.org \
    --to=simon@josefsson.org \
    --cc=distributions@lists.linux.dev \
    --cc=mgorny@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox