Hi Ludo, On Thu, 10 Sep 2020 10:09:11 +0200 Ludovic Courtès wrote: > Surely we don’t need that much just to build a kernel module. :-) Since Linux is a monolithic kernel and since C has no modules: Yes, yes we do--in the general case. Linux kernel developers have no interest in supporting out-of-tree modules for free (and no interesting in having the Linux kernel API frozen) so there's no incentive to support a use case where you can compile a Linux kernel module without having the full source of the Linux kernel (that would be just asking for license abuse, too). That would mean that we would have to both design and then support out-of-tree build infrastructure ourselves in Guix. And for what? It's only used when building the module--it will be thrown away afterwards anyway. Or is it not garbage-collected afterwards? That would be a serious bug. > ;; TODO: Only preserve the minimum, i.e. [Kbuild], Kconfig, > ;; scripts, include, ".config". > > Which files exactly are needed? Can we go ahead and implement this TODO? Who knows? Nobody--not even Linux kernel developers. Given the design of C, it's not possible in general to know what is the interface and what is the implementation. I guess for the Linux kernel we could kinda wing it because of the social conventions the Linux kernel enforces where it kinda almost does have a module separation into interface and implementation. > I understand the need to “cut corners” while trying things out, but I’d > argue that this specific corner should have been restored before getting > into master. If you want that, I think you need to argue that with the main Linux kernel maintainers (Greg Kroah-Hartmann etc). I don't think it is practical for us to maintain a weird minimal module-building-only fork of Linux. I'd be glad to be proven wrong, though. Even if we did, there are much worse build-time storage space wastes (*cough* llvm *cough*). That said, I did a quick size comparison and found those big items: 150 MB a2fs24bgghjvlzq5lzr6zki7mqxx8mpi-linux-libre-module-builder-5.8.7/lib/modules/build/drivers/gpu/drm/amd/include/asic_reg 30 MB a2fs24bgghjvlzq5lzr6zki7mqxx8mpi-linux-libre-module-builder-5.8.7/lib/modules/build/drivers/staging I don't think we need these in any potential Linux kernel module--but who knows? Maybe somebody does need those.