Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Linux API headers to those of the default NixOS kernel #15449

Merged
merged 2 commits into from May 16, 2016

Conversation

joachifm
Copy link
Contributor

Given that we have to rebuild the world for #15447 could we take take that as an opportunity to update the API headers as well?

This updates the Linux API headers to those of the default NixOS kernel.
@joachifm joachifm changed the title Update Linux API headers to those of the latest NixOS kernel Update Linux API headers to those of the default NixOS kernel May 14, 2016
@vcunat
Copy link
Member

vcunat commented May 14, 2016

I wonder – could some packages have problems when running with a kernel older than linuxHeaders? Or how does the version matter?

@vcunat
Copy link
Member

vcunat commented May 14, 2016

For glibc in particular I know the minimal supported kernel is a configure option, so building against newer headers shouldn't move that bound.

@joachifm
Copy link
Contributor Author

joachifm commented May 14, 2016

@vcunat my understanding is that what matters is whether the running kernel supports those APIs that the program actually uses.
EDIT: so, yes, run-time crashes are possible. See https://www.kernel.org/doc/Documentation/kbuild/headers_install.txt

@vcunat
Copy link
Member

vcunat commented May 14, 2016

Yes, but my question was meant more like: if a program is compiled against some kernel header version, it might take those APIs for granted. We'll see, I suppose. Perhaps I'm too pessimistic.

@joachifm
Copy link
Contributor Author

But I think a program has to use an API that doesn't exist on older kernels for it to crash; given that it's backwards compatible, I'd imagine that symbols available in both versions would have the same signature.

@vcunat
Copy link
Member

vcunat commented May 14, 2016

Yes, kernel ABI is very stable (wrt. user space), that's for sure.

@joachifm
Copy link
Contributor Author

Hm, are you thinking about a scenario where a program optionally uses a newer API if it detects that the headers have a certain version? Seems to me that if a program needs newer features, then running on older kernels is out of the question anyway.

@joachifm
Copy link
Contributor Author

Anyway, this isn't important to me, I only thought it'd be a good opportunity to update the headers, so I'm fine with dropping this if it's seen as too risky.

@vcunat
Copy link
Member

vcunat commented May 14, 2016

IMHO the risk is rather low, but I don't know much about these things. /cc @edolstra anyway.

I presume that programs (e.g. glibc) had some older implementations against older kernels, but when new kernel features get in, they create better implementation of some parts utilizing the new ABI. Then they probably decide during runtime which to use, but they might purge some of the implementations during configure/build-time.

@joachifm
Copy link
Contributor Author

https://sourceware.org/glibc/wiki/FAQ#What_version_of_the_Linux_kernel_headers_should_be_used.3F recommends using the latest version, but with the same caveat as the kernel docs.

vcunat added a commit that referenced this pull request May 14, 2016
...to those of the default NixOS kernel
vcunat added a commit that referenced this pull request May 15, 2016
I don't know why it matters here; the error was:
linux.c:25:24: fatal error: linux/nvme.h: No such file or directory
joachifm added a commit that referenced this pull request May 15, 2016
@vcunat vcunat merged commit aa18837 into NixOS:master May 16, 2016
@joachifm joachifm deleted the linuxHeaders_4_4 branch May 16, 2016 08:34
@wkennington
Copy link
Contributor

To answer the previous questions, yes programs will crash when using kernel
features that are unsupported if they are not employing some form of
runtime detection.

On Mon, May 16, 2016, 1:16 AM Vladimír Čunát notifications@github.com
wrote:

Merged #15449 #15449.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#15449 (comment)

@edolstra
Copy link
Member

Hm, shouldn't this have gone into the staging branch?

@joachifm
Copy link
Contributor Author

@edolstra it did

@vcunat
Copy link
Member

vcunat commented May 16, 2016

Github only closed this after staging got merged to master. (Which is correct, as the PR was filed against master.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants