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

Build fails on Ubuntu 20.04 (kernel 5.4.0-205-generic) #48

Open
toreanderson opened this issue Feb 8, 2025 · 2 comments
Open

Build fails on Ubuntu 20.04 (kernel 5.4.0-205-generic) #48

toreanderson opened this issue Feb 8, 2025 · 2 comments

Comments

@toreanderson
Copy link

The module does not build on a fully updated Ubuntu 20.04 host:

ubuntu@ubuntu-20:~/nat46/nat46/modules$ make
make -C /lib/modules/5.4.0-205-generic/build M=/home/ubuntu/nat46/nat46/modules modules
make[1]: Entering directory '/usr/src/linux-headers-5.4.0-205-generic'
  CC [M]  /home/ubuntu/nat46/nat46/modules/nat46-netdev.o
  CC [M]  /home/ubuntu/nat46/nat46/modules/nat46-module.o
/home/ubuntu/nat46/nat46/modules/nat46-module.c: In function ‘nat46_init’:
/home/ubuntu/nat46/nat46/modules/nat46-module.c:254:49: error: macro "__DATE__" might prevent reproducible builds [-Werror=date-time]
  254 |  printk("nat46: module (version %s) loaded.\n", NAT46_VERSION);
      |                                                 ^~~~~~~~~~~~~
/home/ubuntu/nat46/nat46/modules/nat46-module.c:54:23: error: macro "__TIME__" might prevent reproducible builds [-Werror=date-time]
   54 | #define NAT46_VERSION __DATE__ " " __TIME__
      |                       ^~~~~~~~
/home/ubuntu/nat46/nat46/modules/nat46-module.c:254:49: note: in expansion of macro ‘NAT46_VERSION’
  254 |  printk("nat46: module (version %s) loaded.\n", NAT46_VERSION);
      |                                                 ^~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:270: /home/ubuntu/nat46/nat46/modules/nat46-module.o] Error 1
make[1]: *** [Makefile:1778: /home/ubuntu/nat46/nat46/modules] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-205-generic'
make: *** [Makefile:6: all] Error 2

Something like this fixes it:

diff --git a/nat46/modules/nat46-module.c b/nat46/modules/nat46-module.c
index f4720d4..b402f37 100644
--- a/nat46/modules/nat46-module.c
+++ b/nat46/modules/nat46-module.c
@@ -51,7 +51,7 @@
 #define NAT46_CONTROL_PROC_NAME "control"
 
 #ifndef NAT46_VERSION
-#define NAT46_VERSION __DATE__ " " __TIME__
+#define NAT46_VERSION "1.0"
 #endif
 
 MODULE_LICENSE("GPL");
angus19 added a commit to angus19/nat46 that referenced this issue Feb 19, 2025
Build fails on Fedora 41 (kernel 6.12.11-200)  (ayourtch#47)
Build fails on Ubuntu 20.04 (kernel 5.4.0-205-generic)  (ayourtch#48)
angus19 added a commit to angus19/nat46 that referenced this issue Feb 19, 2025
Build fails on Fedora 41 (kernel 6.12.11-200)  (ayourtch#47)
Build fails on Ubuntu 20.04 (kernel 5.4.0-205-generic)  (ayourtch#48)
@angus19
Copy link
Contributor

angus19 commented Feb 20, 2025

There comes a solution. Awaiting review and approval by @ayourtch.

ayourtch pushed a commit that referenced this issue Feb 22, 2025
Build fails on Fedora 41 (kernel 6.12.11-200)  (#47)
Build fails on Ubuntu 20.04 (kernel 5.4.0-205-generic)  (#48)
@ayourtch
Copy link
Owner

ayourtch commented Feb 26, 2025

Merged, sorry for the delay... Trying to figure out the way to test these things proactively - I also experimented with trying to launch the VMs, but the lxd VMs that I can launch from the GH actions, have an even later kernel... Wonder what are the approaches that the folks use to spin up the VMs ?

I am pondering running the "bare" qemu-kvm, with the images built by installing the "vanilla" ubuntu. Do you know of any better approaches ?

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

No branches or pull requests

3 participants