[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Another take on package relationship substvars



Guillem Jover:
Hi!

On Thu, 2024-02-22 at 19:32:21 +0100, Niels Thykier wrote:
[...]

Right, this is annoying. This was actually brought up some time
ago (2010) in debian-devel as part of #597340. There was not much
reaction at the time (one good, a couple bad).


I reinvented a decade old idea that I forgotten existed, but very much remember having read in the past now that I see it again.

# How do we get here?

High level, any helper framework above dpkg can provide this feature if it
wants to. It is basically a question of parsing d/*.substvars to figure out
which substvars are relevant, compute a new field from substvars file + the
static provided data from d/control, and then passing -DField=<...> to
dpkg-gencontrol.

There are probably a bunch of nitty gritty implementation details in
practice, but the overall approach stands.

I think each helper stack (debhelper, cdbs, debputy, etc.) would define
their own rule set for how to get there. As an example, I could see this be
the new default in the next debhelper compat level, possibly with a way to
be early adopter on existing compat levels.

If we agree we want this implicit mechanism of adding some substvars
to fields, then doing it in helpers seems like a suboptimal path, as
each one would need to replicate the logic, and implement substvar
substitution logic. I think if this is to be done, it should be done
at the dpkg-dev level.

[...]


I am happy to look into moving parts of the responsibility of this into dpkg. Though, I would like to move that part of the discussion to debian-dpkg as for the vast majority this is implementation detail.

For the hand-full of people that wants to be in the discussion, I don't think it is a major ask to have them track debian-dpkg for a short while.

## Alternative solutions

We could also make unused substvars a hard failure (FTBFS). Personally, I
feel auto-managing them will be less painful for users. But if the consensus
goes down this direction, then I would be behind it as it is still better
than the status quo in my book.

I also implemented in that branch another operator !=, which marks a
substvar as required, so failure to use it will generate an error. I
might have to move the error emission into some other function that
is not called warn_about_unused() though… :)


Ok.

Based on Simon's follow up, I suspect we will not be going down this route. Obviously, dpkg can still support the feature either way. :)

That is my proposal for how Debian contributors can spend less mental effort
tracking relationship substvars and use their new spare mental capacity
providing value for our users. Thanks for reviewing the proposal and any
feedback you might have for making relationship substvars be less annoying
for users and Debian as a whole.

Personally I think I agree with this being a problem and with a
potential solution for this based on implicit substvars. [...]

Thanks,
Guillem


Thanks for the feedback.

(The snipped part I believe I already answered above)

Best regards,
Niels




Reply to: