Hi folks!
I just tried running sudo nixos-rebuild switch --upgrade on the unstable channel but ran into the following error:
CC [M] /build/source/exfat_super.o
/build/source/exfat_super.c:147:8: error: unknown type name 'time_t'
147 | static time_t accum_days_in_year[] = {
| ^~~~~~
/build/source/exfat_super.c: In function 'exfat_time_fat2unix':
/build/source/exfat_super.c:158:2: error: unknown type name 'time_t'; did you mean 'ktime_t'?
158 | time_t year = tp->Year;
| ^~~~~~
| ktime_t
/build/source/exfat_super.c:159:2: error: unknown type name 'time_t'; did you mean 'ktime_t'?
159 | time_t ld;
| ^~~~~~
| ktime_t
/build/source/exfat_super.c: In function 'exfat_time_unix2fat':
/build/source/exfat_super.c:177:2: error: unknown type name 'time_t'; did you mean 'ktime_t'?
177 | time_t second = ts->tv_sec;
| ^~~~~~
| ktime_t
/build/source/exfat_super.c:178:2: error: unknown type name 'time_t'; did you mean 'ktime_t'?
178 | time_t day, month, year;
| ^~~~~~
| ktime_t
/build/source/exfat_super.c:179:2: error: unknown type name 'time_t'; did you mean 'ktime_t'?
179 | time_t ld;
| ^~~~~~
| ktime_t
make[3]: *** [/nix/store/p87axccmvlybjqsbv7hjihxqmj8hdw5l-linux-5.6.5-dev/lib/modules/5.6.5/source/scripts/Makefile.build:268: /build/source/e
xfat_super.o] Error 1
make[2]: *** [/nix/store/p87axccmvlybjqsbv7hjihxqmj8hdw5l-linux-5.6.5-dev/lib/modules/5.6.5/source/Makefile:1683: /build/source] Error 2
make[1]: *** [/nix/store/p87axccmvlybjqsbv7hjihxqmj8hdw5l-linux-5.6.5-dev/lib/modules/5.6.5/source/Makefile:180: sub-make] Error 2
make[1]: Leaving directory '/nix/store/p87axccmvlybjqsbv7hjihxqmj8hdw5l-linux-5.6.5-dev/lib/modules/5.6.5/build'
make: *** [Makefile:35: all] Error 2
builder for '/nix/store/g1nmkh3axdrxf6hjq4akl90gjyhjzih0-exfat-nofuse-2019-09-06-5.6.5.drv' failed with exit code 2
It seems as though there is some compilation error in exfat-nofuse?
Here's the output of nix-shell -p nix-info --run "nix-info -m":
[mindtree@mindtree ~]$ nix-shell -p nix-info --run "nix-info -m"
these paths will be fetched (0.05 MiB download, 0.28 MiB unpacked):
/nix/store/35hb71frwcrzsza8zqij7bfxq8q4bkng-bash-interactive-4.4-p23-dev
copying path '/nix/store/35hb71frwcrzsza8zqij7bfxq8q4bkng-bash-interactive-4.4-p23-dev' from 'https://cache.nixos.org'...
- system: `"x86_64-linux"`
- host os: `Linux 5.5.13, NixOS, 20.09pre218613.ae6bdcc5358 (Nightingale)`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.3.3`
- channels(root): `"nixos-20.09pre222244.22a3bf9fb9e"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
I'm still quite new to nix - please let me know if I'm doing something silly or I can do anything else to help!
PS: Thanks for all your work on nix! I recently switched from Arch and it's been a delight to use so far :)
Indeed, this is broken on 5.6, presumably due to the year 2038 changes. However, you are trying to build a the module for 5.6, which already contains the staging exfat driver:
$ zgrep EXFAT /proc/config.gz
CONFIG_STAGING_EXFAT_FS=m
CONFIG_STAGING_EXFAT_DISCARD=y
# CONFIG_STAGING_EXFAT_DELAYED_SYNC is not set
# CONFIG_STAGING_EXFAT_KERNEL_DEBUG is not set
# CONFIG_STAGING_EXFAT_DEBUG_MSG is not set
CONFIG_STAGING_EXFAT_DEFAULT_CODEPAGE=437
CONFIG_STAGING_EXFAT_DEFAULT_IOCHARSET="utf8"
So on 5.6 (and even on older till 5.4) you should be able to mount and use exfat without the kernel module.
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/mount-wd-hdd-to-nixos-nix-pkgs-exfat-utils/7834/3
I just hit the same issue while trying to switch from the current stable to the latest kernel. I also had similar errors in other packages like virtualbox with the unstable kernel, when using the kernel from 20.03 it seems to work.
I have boot.extraModulePackages = [ config.boot.kernelPackages.exfat-nofuse ]; in my configuration.nix. When I remove that rebuilding the system works. I'd still like to be able to mount fat devices though, any hints on how to achieve that?
As commented above:
So on 5.6 (and even on older till 5.4) you should be able to mount and use exfat without the kernel module.
@Emantor Does that mean I don't need to specify the kernel module anymore? If that's the case I'll update the wiki.
@Emantor Does that mean I don't need to specify the kernel module anymore? If that's the case I'll update the wiki.
Yes, that should be the case. See this article and this article from LWN for more on the history of the exfat driver.
Most helpful comment
Indeed, this is broken on 5.6, presumably due to the year 2038 changes. However, you are trying to build a the module for 5.6, which already contains the staging exfat driver:
So on 5.6 (and even on older till 5.4) you should be able to mount and use exfat without the kernel module.