Skip to contentSkip to conversation

package/libsodium: add config for full build

PATCH Superseded Adrien Gallouët 4 participants 8 messages Sep 23, 2019 – Oct 24, 2019

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 package/libsodium: add config for full build

A new option is added to build all functions.

This option was implicitly used before, so it is activated by default to avoid unpleasant surprises.

---
Changes v3 -> v4:
- better commit log (suggested by Thomas Petazzoni)

Changes v2 -> v3:
- add a better help (suggested by Arnout Vandecappelle)

Changes v1 -> v2:
- full build (suggested by Arnout Vandecappelle)

---
 package/libsodium/Config.in    | 12 ++++++++++++
 package/libsodium/libsodium.mk |  4 ++++
 2 files changed, 16 insertions(+)
package/libsodium/Config.in +12 -0
index 47b9bb350c..518b0532ed 100644
@@ -4,3 +4,15 @@ config BR2_PACKAGE_LIBSODIUM
 	  A modern and easy-to-use crypto library.
 
 	  http://libsodium.org/
+
+if BR2_PACKAGE_LIBSODIUM
+
+config BR2_PACKAGE_LIBSODIUM_FULL
+	bool "all functions"
+	default y
+	help
+	  Build all seldom used and obsolete functions. Without
+	  this option, only the minimal set of normally used
+	  functions is built.
+
+endif
package/libsodium/libsodium.mk +4 -0
index a94a8271c5..9afa09ff37 100644
@@ -14,5 +14,9 @@ ifeq ($(BR2_TOOLCHAIN_SUPPORTS_PIE),)
 LIBSODIUM_CONF_OPTS += --disable-pie
 endif
 
+ifeq ($(BR2_PACKAGE_LIBSODIUM_FULL),)
+LIBSODIUM_CONF_OPTS += --enable-minimal
+endif
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
Signature · 1 line
2.19.1
#1 lore raw

PATCH v4 1/1 package/libsodium: add config for full build

Hello,

Quoted 14 lines · On Mon, 23 Sep 2019 08:29:03 +0000 Adrien Gallou?t <[email protected]> wrote:
package/libsodium/Config.in +9 -0
+config BR2_PACKAGE_LIBSODIUM_FULL
+	bool "all functions"
+	default y
+	help
+	  Build all seldom used and obsolete functions. Without
+	  this option, only the minimal set of normally used
+	  functions is built.
+
+endif
package/libsodium/libsodium.mk +0 -0
index a94a8271c5..9afa09ff37 100644

package/libsodium/libsodium.mk ifeq ($(BR2_TOOLCHAIN_SUPPORTS_PIE),) · line 18

Quoted 5 lines
package/libsodium/libsodium.mk +2 -0
@@ -14,5 +14,9 @@ ifeq ($(BR2_TOOLCHAIN_SUPPORTS_PIE),)
 LIBSODIUM_CONF_OPTS += --disable-pie
 endif
 
+ifeq ($(BR2_PACKAGE_LIBSODIUM_FULL),)
+LIBSODIUM_CONF_OPTS += --enable-minimal

But then, does it make sense to invert the option and name it BR2_PACKAGE_LIBSODIUM_MINIMAL ? It would match the --enable-minimal/--disable-minimal autoconf options of libsodium.

Also, we need to pass --disable-minimal in an "else" clause.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

PATCH v4 1/1 package/libsodium: add config for full build

Hello,

Quoted 23 lines · Thomas Petazzoni

Hello,

Quoted 17 lines · On Mon, 23 Sep 2019 08:29:03 +0000 Adrien Gallou?t <[email protected]> wrote:
package/libsodium/Config.in +9 -0
+config BR2_PACKAGE_LIBSODIUM_FULL
+     bool "all functions"
+     default y
+     help
+       Build all seldom used and obsolete functions. Without
+       this option, only the minimal set of normally used
+       functions is built.
+
+endif
package/libsodium/libsodium.mk +0 -0
index a94a8271c5..9afa09ff37 100644
@@ -14,5 +14,9 @@ ifeq ($(BR2_TOOLCHAIN_SUPPORTS_PIE),)
 LIBSODIUM_CONF_OPTS += --disable-pie
 endif
 
Quoted 6 lines

package/libsodium/libsodium.mk ifeq ($(BR2_TOOLCHAIN_SUPPORTS_PIE),) · line 18

Quoted 2 lines
package/libsodium/libsodium.mk +2 -0
+ifeq ($(BR2_PACKAGE_LIBSODIUM_FULL),)
+LIBSODIUM_CONF_OPTS += --enable-minimal

But then, does it make sense to invert the option and name it BR2_PACKAGE_LIBSODIUM_MINIMAL ? It would match the --enable-minimal/--disable-minimal autoconf options of libsodium.

That was my first patch :) Do you want me to resubmit it ?

Quoted 10 lines

Also, we need to pass --disable-minimal in an "else" clause.

Thanks,

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Regards,
Adrien

#3 lore raw

PATCH v4 1/1 package/libsodium: add config for full build

Quoted 5 lines · On Sat, 28 Sep 2019 23:49:56 +0200 Adrien Gallou?t <[email protected]> wrote:
Quoted 3 lines

But then, does it make sense to invert the option and name it BR2_PACKAGE_LIBSODIUM_MINIMAL ? It would match the --enable-minimal/--disable-minimal autoconf options of libsodium.

That was my first patch :) Do you want me to resubmit it ?

I don't have a very clear-cut opinion.

On one hand, it is weird to have a Config.in option to reduce/remove something. But on the other hand, it makes sense to have Config.in options that are as much as possible mapped to the corresponding options provided by the package build system.

Arnout, Peter, any preference ?

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#4 lore raw

PATCH v4 1/1 package/libsodium: add config for full build

Quoted 9 lines · Thomas Petazzoni
Quoted 5 lines · On Sat, 28 Sep 2019 23:49:56 +0200 Adrien Gallou?t <[email protected]> wrote:
Quoted 3 lines

But then, does it make sense to invert the option and name it BR2_PACKAGE_LIBSODIUM_MINIMAL ? It would match the --enable-minimal/--disable-minimal autoconf options of libsodium.

That was my first patch :) Do you want me to resubmit it ?

Quoted 8 lines

I don't have a very clear-cut opinion.

On one hand, it is weird to have a Config.in option to reduce/remove something. But on the other hand, it makes sense to have Config.in options that are as much as possible mapped to the corresponding options provided by the package build system.

Arnout, Peter, any preference ?

It was me who suggested to turn around the logic.

I believe we have had problems in the past where there was some MINIMAL option,
but then some other package needed something from the non-minimal set. Then it has to do a 'depends on' instead of a 'select'.

So it's not a matter of being weird, it's a matter of making sure we don't
create problems in the future.

Quoted 1 line
Quoted 1 line

Also, we need to pass --disable-minimal in an "else" clause.

This is still true. Adrien, I believe I did say something to that effect in an
earlier iteration, and I also believe you replied to it. But my memory is worthless :-)

Regards,
Arnout

#5 lore raw

PATCH v4 1/1 package/libsodium: add config for full build

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Arnout" == Arnout Vandecappelle <[email protected]> writes:

Hi,

Quoted 10 lines
Quoted 1 line

Arnout, Peter, any preference ?

It was me who suggested to turn around the logic.

I believe we have had problems in the past where there was some MINIMAL option,
but then some other package needed something from the non-minimal set. Then it has to do a 'depends on' instead of a 'select'.

So it's not a matter of being weird, it's a matter of making sure we don't
create problems in the future.

Yes, indeed - I would prefer to keep it like this (a "positive" option).

Quoted 5 lines
Quoted 1 line
Quoted 1 line

Also, we need to pass --disable-minimal in an "else" clause.

This is still true. Adrien, I believe I did say something to that effect in an
earlier iteration, and I also believe you replied to it. But my memory is worthless :-)

Heh ;)

Signature · 1 line
Bye, Peter Korsgaard
#6 lore raw

PATCH v4 1/1 package/libsodium: add config for full build

In reply to Arnout Vandecappelle
Quoted 3 lines · On Sun, 29 Sep 2019 12:51:35 +0200 Arnout Vandecappelle <[email protected]> wrote:

I believe we have had problems in the past where there was some MINIMAL option,
but then some other package needed something from the non-minimal set. Then it has to do a 'depends on' instead of a 'select'.

That makes a lot of sense indeed. So we should always have option that "add" more stuff, and never option that "remove" stuff for that reason.

Thanks for the feedback, I hadn't thought about this.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#7 lore raw

PATCH v4 1/1 package/libsodium: add config for full build

In reply to Arnout Vandecappelle
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Arnout" == Arnout Vandecappelle <[email protected]> writes:

Hi,

Quoted 9 lines
Quoted 8 lines

I don't have a very clear-cut opinion.

On one hand, it is weird to have a Config.in option to reduce/remove something. But on the other hand, it makes sense to have Config.in options that are as much as possible mapped to the corresponding options provided by the package build system.

Arnout, Peter, any preference ?

Quoted 8 lines

It was me who suggested to turn around the logic.

I believe we have had problems in the past where there was some MINIMAL option,
but then some other package needed something from the non-minimal set. Then it has to do a 'depends on' instead of a 'select'.

So it's not a matter of being weird, it's a matter of making sure we don't
create problems in the future.

Agreed, having options to disable stuff gets tricky when you have other packages needing the disabled stuff.

Quoted 5 lines
Quoted 1 line
Quoted 1 line

Also, we need to pass --disable-minimal in an "else" clause.

This is still true. Adrien, I believe I did say something to that effect in an
earlier iteration, and I also believe you replied to it. But my memory is worthless :-)

Getting old? :P

Signature · 1 line
Bye, Peter Korsgaard