Skip to contentSkip to conversation

package/racehound: fix comment

PATCH New Yann E. MORIN 3 participants 8 messages Apr 12, 2016 – Apr 14, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/racehound: fix comment

racehound requires a kernel >= 3.14 to be built and to run.

However, the current conditions on the corresponding comments are wrong:
- the comment about the kernel has a dependency on the requested headers
- the comment on the toolchain features does not have this condition.

Thus, the comments are not shown/hidden under the appropriate conditions, like in this situation:
- toolchain with headers < 3.14 (e.g. Sourcery CodeBench x86/x86_64

    2012.09 with headers 3.5)

- kernel 4.5 enabled

this comment is shown:
racehound needs an Linux kernel >= 3.14 to be built

So, this is incorrect, because:
1- a kernel >= 3.14 is indeed to be built
2- the headers version mismatch is not reported

Fix that by moving the dependency on the kernel headers to the appropriate comment and enhance it.

Since there is no way we can know the kernel version to be built, we can not add such a condition; still, we leave the kernel message as-is.

---
 package/racehound/Config.in | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
package/racehound/Config.in +4 -3
index 9f1011b..53e39a8 100644
@@ -27,10 +27,11 @@ config BR2_PACKAGE_RACEHOUND
 	  https://github.com/winnukem/racehound
 
 comment "racehound needs an Linux kernel >= 3.14 to be built"
-	depends on !BR2_LINUX_KERNEL || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14
+	depends on !BR2_LINUX_KERNEL
 	depends on BR2_i386 || BR2_x86_64
 
-comment "racehound needs a uClibc or (e)glibc toolchain w/ C++, wchar, dynamic library"
+comment "racehound needs a uClibc or (e)glibc toolchain w/ C++, wchar, dynamic library, headers >= 3.14"
 	depends on BR2_i386 || BR2_x86_64
 	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || BR2_STATIC_LIBS \
-		|| !(BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC)
+		|| !(BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC) \
+		|| !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 package/racehound: fix comment

Quoted 1 line · Yann E. MORIN

racehound requires a kernel >= 3.14 to be built and to run.

If I understand correctly, it actually doesn't need kernel headers >= 3.14,
but only a kernel >= 3.14...

Quoted 11 lines

However, the current conditions on the corresponding comments are wrong:
- the comment about the kernel has a dependency on the requested headers
- the comment on the toolchain features does not have this condition.

Thus, the comments are not shown/hidden under the appropriate conditions, like in this situation:
- toolchain with headers < 3.14 (e.g. Sourcery CodeBench x86/x86_64

     2012.09 with headers 3.5)

- kernel 4.5 enabled

So in this configuration, it should actually be possible to build racehound.

If this is true, I would remove the dependency on kernel headers.

Quoted 3 lines

this comment is shown:
racehound needs an Linux kernel >= 3.14 to be built

But I would keep this comment if !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14, to make
sure the user realizes that he needs a >= 3.14 kernel. He can still select the package if the headers ar < 3.14, so if he knows what he's doing it will be fine.

Even better would be

	depends on !BR2_LINUX_KERNEL || \
		(BR2_PACKAGE_RACEHOUND && !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14)

i.e. only show the >= 3.14 warning in case you actually selected racehound.

Quoted 10 lines

So, this is incorrect, because:
1- a kernel >= 3.14 is indeed to be built
2- the headers version mismatch is not reported

Fix that by moving the dependency on the kernel headers to the appropriate comment and enhance it.

Since there is no way we can know the kernel version to be built, we can not add such a condition; still, we leave the kernel message as-is.

It can be tested in a pre-configure hook. But the cmake rules already check
for that, so there's no need to do it again in buildroot.

Quoted 15 lines
---
  package/racehound/Config.in | 7 ++++---
  1 file changed, 4 insertions(+), 3 deletions(-)
package/racehound/Config.in +0 -1
index 9f1011b..53e39a8 100644
@@ -27,10 +27,11 @@ config BR2_PACKAGE_RACEHOUND
  	  https://github.com/winnukem/racehound
 
  comment "racehound needs an Linux kernel >= 3.14 to be built"
-	depends on !BR2_LINUX_KERNEL || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14

package/racehound/Config.in config BR2_PACKAGE_RACEHOUND · line 37

Quoted 10 lines
package/racehound/Config.in +4 -2
+	depends on !BR2_LINUX_KERNEL
  	depends on BR2_i386 || BR2_x86_64
 
-comment "racehound needs a uClibc or (e)glibc toolchain w/ C++, wchar, dynamic library"
+comment "racehound needs a uClibc or (e)glibc toolchain w/ C++, wchar, dynamic library, headers >= 3.14"
  	depends on BR2_i386 || BR2_x86_64
  	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || BR2_STATIC_LIBS \
-		|| !(BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC)
+		|| !(BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC) \
+		|| !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14

Just to be clear: I think this comment shouldn't be changed at all.

Assuming, of course, that my assumption is correct that it has no particular
dependency on kernel headers.

Regards,
Arnout

Quoted 1 line
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#2 lore raw

PATCH 1/1 package/racehound: fix comment

Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

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

Quoted 1 line · Yann E. MORIN

racehound requires a kernel >= 3.14 to be built and to run.

If I understand correctly, it actually doesn't need kernel headers >=
3.14, but only a kernel >= 3.14...

Ups, sorry - I somehow missed your mail until after applying and pushing Yanns change. Lets see what Yann says.

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

PATCH 1/1 package/racehound: fix comment

In reply to Arnout Vandecappelle

Arnout, All,

On 2016-04-12 23:27 +0200, Arnout Vandecappelle spake thusly:

Quoted 5 lines · Yann E. MORIN
Quoted 1 line

racehound requires a kernel >= 3.14 to be built and to run.

If I understand correctly, it actually doesn't need kernel headers >= 3.14,
but only a kernel >= 3.14...

Indeed, the dependency on headerrs >= 3.14 is wrong.

I'll send an updated patch to fix that.

Quoted 5 lines
Quoted 5 lines

However, the current conditions on the corresponding comments are wrong:
- the comment about the kernel has a dependency on the requested headers
- the comment on the toolchain features does not have this condition.

Quoted 8 lines
Quoted 5 lines

Thus, the comments are not shown/hidden under the appropriate conditions, like in this situation:
- toolchain with headers < 3.14 (e.g. Sourcery CodeBench x86/x86_64

    2012.09 with headers 3.5)

- kernel 4.5 enabled

So in this configuration, it should actually be possible to build racehound. If this is true, I would remove the dependency on kernel headers.

I just checked those configurations:
- headers 3.14, kernel 4.5 => OK
- headers 3.5, kernel 4.5 => OK

Quoted 7 lines
Quoted 2 lines

this comment is shown:
racehound needs an Linux kernel >= 3.14 to be built

But I would keep this comment if !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14, to
make sure the user realizes that he needs a >= 3.14 kernel. He can still select the package if the headers ar < 3.14, so if he knows what he's doing it will be fine.

I respectfully disagree. There is no corelation between the headers and the running kernel (except running kernel mnust be more recent than headers).

Besides, this would be misleading in the other way: if headers are 3.14+ but kernel is 3.13-, the comment wouild not be shown.

Quoted 4 lines

Even better would be

	depends on !BR2_LINUX_KERNEL || \
		(BR2_PACKAGE_RACEHOUND && !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14)

i.e. only show the >= 3.14 warning in case you actually selected racehound.

Again, headers_atl_least_X_Y does not represent the running kernel, so I find it a bit misleading that we use that option to show/hide the comment.

Quoted 4 lines
Quoted 4 lines

So, this is incorrect, because:
1- a kernel >= 3.14 is indeed to be built
2- the headers version mismatch is not reported

Quoted 8 lines
Quoted 5 lines

Fix that by moving the dependency on the kernel headers to the appropriate comment and enhance it.

Since there is no way we can know the kernel version to be built, we can not add such a condition; still, we leave the kernel message as-is.

It can be tested in a pre-configure hook. But the cmake rules already check
for that, so there's no need to do it again in buildroot.

No, it does not check for it since we pass it -DKERNEL_VERSION_OK=YES

Regards,
Yann E. MORIN.

Quoted 43 lines
Quoted 14 lines
---
 package/racehound/Config.in | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
package/racehound/Config.in +0 -1
index 9f1011b..53e39a8 100644
@@ -27,10 +27,11 @@ config BR2_PACKAGE_RACEHOUND
 	  https://github.com/winnukem/racehound
 
 comment "racehound needs an Linux kernel >= 3.14 to be built"
-	depends on !BR2_LINUX_KERNEL || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14

package/racehound/Config.in config BR2_PACKAGE_RACEHOUND · line 37

Quoted 10 lines
package/racehound/Config.in +4 -2
+	depends on !BR2_LINUX_KERNEL
 	depends on BR2_i386 || BR2_x86_64
 
-comment "racehound needs a uClibc or (e)glibc toolchain w/ C++, wchar, dynamic library"
+comment "racehound needs a uClibc or (e)glibc toolchain w/ C++, wchar, dynamic library, headers >= 3.14"
 	depends on BR2_i386 || BR2_x86_64
 	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || BR2_STATIC_LIBS \
-		|| !(BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC)
+		|| !(BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC) \
+		|| !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14

Just to be clear: I think this comment shouldn't be changed at all.

Assuming, of course, that my assumption is correct that it has no
particular dependency on kernel headers.

Regards,
Arnout

Quoted 1 line
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#4 lore raw

PATCH 1/1 package/racehound: fix comment

Quoted 4 lines · Yann E. MORIN

Arnout, All,

On 2016-04-12 23:27 +0200, Arnout Vandecappelle spake thusly:

Quoted 1 line · Yann E. MORIN

[snip]

Quoted 11 lines
Quoted 7 lines
Quoted 2 lines

this comment is shown:
racehound needs an Linux kernel >= 3.14 to be built

But I would keep this comment if !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14, to
make sure the user realizes that he needs a >= 3.14 kernel. He can still select the package if the headers ar < 3.14, so if he knows what he's doing it will be fine.

I respectfully disagree. There is no corelation between the headers and the running kernel (except running kernel mnust be more recent than headers).

Exactly: the running kernel must be more recent than the headers. So if the
headers are too old, there is a chance that the kernel is too old. So I think it's useful in that case to present a warning to the user, when he selects the package, that he must make sure his kernel is sufficiently recent. That's what the dependency I proposed would do.

Quoted 3 lines

Besides, this would be misleading in the other way: if headers are 3.14+ but kernel is 3.13-, the comment wouild not be shown.

Er, what did you just say about running kernel must be more recent than headers?

Quoted 17 lines
Quoted 5 lines

Even better would be

	depends on !BR2_LINUX_KERNEL || \
		(BR2_PACKAGE_RACEHOUND && !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14)

i.e. only show the >= 3.14 warning in case you actually selected racehound.

Again, headers_atl_least_X_Y does not represent the running kernel, so I find it a bit misleading that we use that option to show/hide the comment.

Quoted 7 lines
Quoted 7 lines

So, this is incorrect, because:
1- a kernel >= 3.14 is indeed to be built
2- the headers version mismatch is not reported

Fix that by moving the dependency on the kernel headers to the appropriate comment and enhance it.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Since there is no way we can know the kernel version to be built, we can not add such a condition; still, we leave the kernel message as-is.

It can be tested in a pre-configure hook. But the cmake rules already check
for that, so there's no need to do it again in buildroot.

No, it does not check for it since we pass it -DKERNEL_VERSION_OK=YES

Why do we do that?

Regards,
Arnout

[snip]

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#5 lore raw

PATCH 1/1 package/racehound: fix comment

Arnout, All,

On 2016-04-13 22:42 +0200, Arnout Vandecappelle spake thusly:

Quoted 14 lines · Yann E. MORIN
Quoted 4 lines

Arnout, All,

On 2016-04-12 23:27 +0200, Arnout Vandecappelle spake thusly:

Quoted 1 line · Yann E. MORIN

[snip]

Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

this comment is shown:
racehound needs an Linux kernel >= 3.14 to be built

But I would keep this comment if !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14, to
make sure the user realizes that he needs a >= 3.14 kernel. He can still select the package if the headers ar < 3.14, so if he knows what he's doing it will be fine.

Quoted 5 lines
Quoted 3 lines

I respectfully disagree. There is no corelation between the headers and the running kernel (except running kernel mnust be more recent than headers).

Exactly: the running kernel must be more recent than the headers.

In fact, that's not true (I was wrong). The glibc code will by default enable workaround for kernels older than the headers, and detect the version of the kernel it is running on to decide whther to use those wrokarounds or not.

By default, glibc is *very* conservative, and adds support for kernel *much* older than the headers (dating back to at least 3.20-or-so IIRC.

This means that, even with headers >= 3.14, a glibc might be able to run on kernels < 3.14.

In Buildroot, we do configure glibc to not enable those workarounds [0], utb non-Buildroot toolchains may not do so, like crosstool-Ng which alows to set an arbitrary value to the oldest supported kernel [1] [2].

So, in fine, we can *not* assume that a toolchain with the appropriate headers is sufficient to guarantee that the running kernel will be recent enough.

Note that there were patches (at least a request) floating on the list that proposed to add such a feature to Buildroot, to be able to specify the oldest kernel glibc would be able to run under [3].

[0] https://git.buildroot.org/buildroot/tree/package/glibc/glibc.mk#n99
[1] http://crosstool-ng.org/git/crosstool-ng/tree/config/libc/glibc.in.2#n174
[2] http://crosstool-ng.org/git/crosstool-ng/tree/scripts/build/libc/glibc.sh#n501
[3] http://lists.busybox.net/pipermail/buildroot/2016-January/150676.html
and http://lists.busybox.net/pipermail/buildroot/2016-February/thread.html#151640

Quoted 5 lines

So if the
headers are too old, there is a chance that the kernel is too old. So I think it's useful in that case to present a warning to the user, when he selects the package, that he must make sure his kernel is sufficiently recent. That's what the dependency I proposed would do.

And I don't think that:
1- it is even correct to begin with, see above; 2- we should even use the headers_at_least_XXX for that.

Quoted 4 lines
Quoted 2 lines

Besides, this would be misleading in the other way: if headers are 3.14+ but kernel is 3.13-, the comment wouild not be shown.

Er, what did you just say about running kernel must be more recent than headers?

E.g. the user has a toolchain with 3.14+ headers, but selects a 3.13- kernel. TRhere is nothing that prevents that in our Kconfig. Not that we should do it, as it is perfectly possible to run such a kernel, as explained above (but not with a Buildroot toolchain, however).

Quoted 6 lines
Quoted 5 lines
Quoted 4 lines
Quoted 2 lines

Since there is no way we can know the kernel version to be built, we can not add such a condition; still, we leave the kernel message as-is.

It can be tested in a pre-configure hook. But the cmake rules already check
for that, so there's no need to do it again in buildroot.

No, it does not check for it since we pass it -DKERNEL_VERSION_OK=YES

Why do we do that?

I guess because otherwise the CMakefile does a test on the host kernel? It uses ${CMAKE_SYSTEM_VERSION} which is set by CMake to uname -r.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#6 lore raw

PATCH 1/1 package/racehound: fix comment

In reply to Yann E. MORIN
Quoted 21 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

racehound requires a kernel >= 3.14 to be built and to run. However, the current conditions on the corresponding comments are wrong:
- the comment about the kernel has a dependency on the requested headers
- the comment on the toolchain features does not have this condition.

Thus, the comments are not shown/hidden under the appropriate conditions, like in this situation:
- toolchain with headers < 3.14 (e.g. Sourcery CodeBench x86/x86_64

    2012.09 with headers 3.5)

- kernel 4.5 enabled

this comment is shown:
racehound needs an Linux kernel >= 3.14 to be built

So, this is incorrect, because:
1- a kernel >= 3.14 is indeed to be built
2- the headers version mismatch is not reported

Quoted 7 lines

Fix that by moving the dependency on the kernel headers to the appropriate comment and enhance it.

Since there is no way we can know the kernel version to be built, we can not add such a condition; still, we leave the kernel message as-is.

Committed, thanks.

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

PATCH 1/1 package/racehound: fix comment

Quoted 24 lines · Peter Korsgaard
Quoted 23 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

racehound requires a kernel >= 3.14 to be built and to run. However, the current conditions on the corresponding comments are wrong:
- the comment about the kernel has a dependency on the requested headers
- the comment on the toolchain features does not have this condition.

Thus, the comments are not shown/hidden under the appropriate conditions, like in this situation:
- toolchain with headers < 3.14 (e.g. Sourcery CodeBench x86/x86_64

    2012.09 with headers 3.5)

- kernel 4.5 enabled

this comment is shown:
racehound needs an Linux kernel >= 3.14 to be built

So, this is incorrect, because:
1- a kernel >= 3.14 is indeed to be built
2- the headers version mismatch is not reported

Fix that by moving the dependency on the kernel headers to the appropriate comment and enhance it.

Quoted 6 lines
Quoted 4 lines

Since there is no way we can know the kernel version to be built, we can not add such a condition; still, we leave the kernel message as-is.

Committed, thanks.

So, you don't agree with my analysis? :-)

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF