Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH v2] emerge: auto-enable --with-bdeps if --usepkg is not enabled (bug 598444)
Date: Sun, 05 Mar 2017 19:12:28
Message-Id: 84fc45f0-8461-3deb-ac3b-e7a12c68c42e@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [PATCH v2] emerge: auto-enable --with-bdeps if --usepkg is not enabled (bug 598444) by Michael Orlitzky
1 On 03/05/2017 07:08 AM, Michael Orlitzky wrote:
2 > On 03/05/2017 03:40 AM, Zac Medico wrote:
3 >>
4 >> A new --with-bdeps-auto=<y|n> option is provided, making it possible to
5 >> enable or disable the program logic that causes --with-bdeps to be
6 >> automatically enabled. Use --with-bdeps-auto=n to prevent --with-bdeps
7 >> from being automatically enabled for installation actions. This is useful
8 >> for some rare cases in which --with-bdeps triggers unsolvable dependency
9 >> conflicts (and putting --with-bdeps=n in EMERGE_DEFAULT_OPTS would cause
10 >> undesirable --depclean behavior).
11 >>
12 >
13 > If I understand correctly, the end result of this is two --flags that
14 > combine in a (rather complicated) way to let the user control the
15 > default bdeps behavior of both "emerge --update" and "emerge --depclean"
16 > separately. I'll try to summarize my understanding:
17 >
18 > I. emerge --update
19 >
20 > I.a. Some people want to --update the build dependencies they have
21 > installed for e.g. security purposes.
22 >
23 > I.b. Others don't want build deps pulled in by "emerge --update",
24 > because they're using binary packages or because it causes
25 > conflicts in the resolver (llvm).
26 >
27 > II. emerge --depclean
28 >
29 > II.a. The default behavior is to not remove build-only dependencies
30 > because, generally, they will just have to rebuilt again.
31 >
32 > II.b. However, some people want to remove the build-only deps that
33 > aren't strictly in use -- particularly if those build-only
34 > deps are not being updated by emerge --update.
35 >
36 >
37 > To choose between those four options...
38 >
39 > i. --with-bdeps=n and --with-bdeps-auto=y gives you I.a. + II.b.
40
41 Incorrect.
42
43 These options give you I.b. + II.b. because --with-bdeps=n overrides
44 --with-bdeps-auto settings (the override is backward-compatible with
45 existing --with-bdeps usage).
46
47 Since I.a. + II.b. is a contradictory combination, there is no
48 combination of EMERGE_DEFAULT_OPTS that will give you I.a. + II.b.
49
50 Specifying --with-bdeps-auto=y has no effect, since that's the default.
51
52 > ii. --with-bdeps=n and --with-bdeps-auto=n gives you I.b. + II.b.
53
54 Correct.
55
56 Specifying --with-bdeps-auto=n has no effect, since --with-bdeps=n
57 overrides --with-bdeps-auto settings (the override is
58 backward-compatible with existing --with-bdeps usage).
59
60 > iii. --with-bdeps=y and --with-bdeps-auto=y gives you I.a. + II.a.
61
62 Correct.
63
64 Specifying --with-bdeps-auto=y has no effect for 2 reasons:
65
66 * --with-bdeps-auto=y is the default
67 * --with-bdeps=y overrides --with-bdeps-auto settings (the override is
68 backward-compatible with existing --with-bdeps usage).
69
70 > iv. --with-bdeps=y and --with-bdeps-auto=n gives you I.a. + II.a.
71
72 Correct.
73
74 Specifying --with-bdeps-auto=n has no effect, since --with-bdeps=y
75 overrides --with-bdeps-auto settings (the override is
76 backward-compatible with existing --with-bdeps usage).
77
78 > That only gets you three out of the four options. You have to read the
79 > fine print to get the other:
80 >
81 > v. passing no flags explicitly gives you I.b. and II.a.
82
83 Incorrect.
84
85 Since --with-bdeps-auto=y is the the default setting, you get I.a. +
86 II.a. unless --usepkg is enabled. If --usepkg is enabled, you get I.b. +
87 II.a., which is backward-compatible with existing --usepkg usage.
88
89 > If there's going to be two flags, can't we do better? Why not just name
90 > the flags after what we want them to do:
91 >
92 > --update-bdeps=<y|n> (default: y)
93 >
94 > --clean-bdeps=<y|n> (default: n)
95
96 The --with-bdeps-auto option results in desirable behavior by default,
97 and it's also backward compatible with existing --with-bdeps and
98 --usepkg usage. It just does the right thing, minimizing the impact to
99 existing emerge usage.
100
101 There some problems with --update-bdeps/--clean-bdeps:
102
103 * The program logic will be more complicated, since --with-bdeps will
104 have to override both options for backward-compatibility with existing
105 --with-bdeps usage.
106
107 * The meaning of --clean-bdeps is confusing. Does --clean-bdeps=y mean
108 to clean build time deps, or does it mean to pull build time deps into
109 the dependency graph for removal operations?
110
111 > With those two options, it's easy to tell portage exactly what you want.
112 > If I don't like the defaults, I can turn one of them off without
113 > affecting the other.
114
115 No, there are problems, as described above.
116
117 > But what about the --usepkg magic? I think the workaround can be left
118 > as-is. When --usepkg is enabled, switch the default for --update-bdeps
119 > to "n" unless it is explicitly set.
120
121 That would work, but introducing 2 new options is no really appealing,
122 because it will lead to more complicated logic that will be more
123 difficult to explain and for people to comprehend. I really don't want
124 to spend time documenting the interactions between --with-bdeps,
125 --update-bdes, and --clean-bdeps, and then get a ton of frequently asked
126 questions from people having difficulty understanding it.
127
128 Overall, I think the --with-bdeps-auto approach seems simpler and easier
129 to explain. I think you would have completely understood it if you had
130 read through the man page updates.
131
132 > Food for thought. Anyway, thanks for working on this.
133 --
134 Thanks,
135 Zac

Replies