zfsonfreebsd / ZoF

ZFS on FreeBSD - the official out of tree OpenZFS implementation for FreeBSD
https://freebsd.org
Other
100 stars 8 forks source link

openzfs ports dont compile against 13.0-CURRENT HEAD/MASTER. 130006* #129

Closed javashin closed 4 years ago

javashin commented 5 years ago

https://gist.github.com/javashin/fd7b9bc0fcbf1b6e9cdc4d645dcdb2df

with clang /usr/ports/sysutils/openzfs-kmod/work/ZoF-05f627f/module/os/freebsd/spl/opensolaris_kmem.c:244:2: error: implicit declaration of function 'zone_drain' is invalid in C99 [-Werror,-Wimplicit-function-declaration] zone_drain(cache->kc_zone); ^ /usr/ports/sysutils/openzfs-kmod/work/ZoF-05f627f/module/os/freebsd/spl/opensolaris_kmem.c:244:2: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] /usr/ports/sysutils/openzfs-kmod/work/ZoF-05f627f/module/os/freebsd/spl/opensolaris_kmem.c:251:14: error: too few arguments to function call, single argument 'req' was not specified uma_reclaim();

/usr/src/sys/vm/uma.h:449:1: note: 'uma_reclaim' declared here void uma_reclaim(int req); ^ 3 errors generated. sa

"""initial compilation was with old port ^^^^^^ but still the same error after update ports""""

compiles fine with FreeBSD hellbox-l440 13.0-CURRENT FreeBSD 13.0-CURRENT DIABLO amd64 1300039. source extracted from trueos freebsd-pkgbase head >> src-13.0.20190813225649-6d1dec6f88.txz from here http://pkg.trueos.org/pkg/freebsd-pkgbase/FreeBSD%3A13%3Aamd64/latest/All/ ..

portmaster --force-config openzfs openzfs-kmod >>>>

===>>> The following actions were performed: Upgrade of openzfs-kmod-2019072200_1 to openzfs-kmod-2019080800 Upgrade of openzfs-2019072200 to openzfs-2019080800

############################################## New Test With The src extracted from FreeBSD-13.0-CURRENT-amd64-20190822 snapshot. Fails too with a different error https://gist.github.com/javashin/d7614db01a651442dbf547d9058ab35d

/usr/ports/sysutils/openzfs-kmod/work/ZoF-df21d39/module/os/freebsd/zfs/zfs_vnops.c:418:2: note: did you mean 'vm_object_pip_wait'? /usr/src/sys/vm/vm_object.h:313:6: note: 'vm_object_pip_wait' declared here void vm_object_pip_wait(vm_object_t object, char *waitid);

Not Relevant ............ ignore this seems like has been fixed. ##############################################

((((New Test)))) With fresh repo clone. git clone --depth=1 https://github.com/freebsd/freebsd.git -b master src.head.github Cloning into 'src.head.github'... remote: Enumerating objects: 81443, done. remote: Counting objects: 100% (81443/81443), done. remote: Compressing objects: 100% (67577/67577), done. remote: Total 81443 (delta 20378), reused 34274 (delta 11020), pack-reused 0 Receiving objects: 100% (81443/81443), 261.80 MiB | 1.27 MiB/s, done. Resolving deltas: 100% (20378/20378), done. Updating files: 100% (78226/78226), done.

git log

commit fe9abe05667776c0a3591b021d915051cc368a97 (grafted, HEAD -> master, origin/master, origin/HEAD) Author: philip philip@FreeBSD.org Date: Fri Sep 6 01:22:16 2019 +0000

QEMU: use default HZ

HZ=100 by default on riscv since r351918.

"""""" cp -Rfa /usr/src.head.github /usr/src ; rm -rf /usr/obj ; cd /usr/src ; time make -DMALLOC_PRODUCTION -j3 buildkernel installkernel 1>/tmp/buildkernel-CURR-$(date +%F).log 2>&1 & """""" real 9m44.710s user 24m42.075s sys 3m22.405s

"""""" portmaster --force-config openzfs-kmod """"""

======== https://gist.github.com/javashin/3a4db1d4ac7fbbccc72cd813886c53b1

/usr/ports/sysutils/openzfs-kmod/work/ZoF-df21d39/module/os/freebsd/spl/opensolaris_kmem.c:244:2: error: implicit declaration of function 'zone_drain' is invalid in C99 [-Werror,-Wimplicit-function-declaration] zone_drain(cache->kc_zone); ^ /usr/ports/sysutils/openzfs-kmod/work/ZoF-df21d39/module/os/freebsd/spl/opensolaris_kmem.c:244:2: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] /usr/ports/sysutils/openzfs-kmod/work/ZoF-df21d39/module/os/freebsd/spl/opensolaris_kmem.c:251:14: error: too few arguments to function call, single argument 'req' was not specified uma_reclaim();


/usr/src/sys/vm/uma.h:449:1: note: 'uma_reclaim' declared here
void uma_reclaim(int req);
^
3 errors generated.

EDIT:::::::
ok i was able to pass from this error after apply this patch 
https://reviews.freebsd.org/differential/changeset/?ref=683802 to openzfs-kmod 

but fails with 

/usr/ports/sysutils/openzfs-kmod/work/ZoF-df21d39/module/os/freebsd/spl/spl_zlib.c:4:10: fatal error: 'sys/zlib.h' file
not found
#include <sys/zlib.h>
^~~~~~~~~~~~
1 error generated.
*** Error code 1

OK EDIT 2 >>>>> 
now that points to the correct zlib.h 
this happen >>>
https://gist.github.com/javashin/40f731ef7a8b89b3328ad1665841ded0
javashin commented 5 years ago

next step revert the offender commit https://github.com/freebsd/freebsd/commit/5451b35f06da65eff6282c76a7a1061fb222f9ae

cloning the full big tree no --depth=1 this time

cd /usr [root@hellbox-l440 /usr]# git clone https://github.com/freebsd/freebsd.git -b master src

git log

commit f13ebd8de056b65702c2554334c1816595c71cd4 (HEAD -> master) Author: JavaShin javashin1986@gmail.com Date: Thu Sep 5 23:31:52 2019 -0400

Revert "Extend uma_reclaim() to permit different reclamation targets."

This reverts commit 5451b35f06da65eff6282c76a7a1061fb222f9ae.

commit 508197caf85aee2020b8945325b02b16c0b2f007 (origin/master, origin/HEAD) Author: jhibbits jhibbits@FreeBSD.org Date: Fri Sep 6 02:45:46 2019 +0000

Now Fails with ?>>>> /usr/ports/sysutils/openzfs-kmod/work/ZoF-df21d39/module/os/freebsd/spl/spl_zlib.c:4:10: fatal error: 'sys/zlib.h' file not found

include <sys/zlib.h>

     ^~~~~~~~~~~~

1 error generated. *** Error code 1

..... i need help .

koobs commented 5 years ago

Confirming on:

# uname -aK
FreeBSD CURRENT-amd64 13.0-CURRENT FreeBSD 13.0-CURRENT r351507 GENERIC-NODEBUG  amd64 1300041

with:

sysutils/openzfs-kmod/ # make -V PORTVERSION
2019080800
cc  -O2 -pipe -fcolor-diagnostics -march=sandybridge  -std=gnu99 -Wno-format-zero-length -fstack-protector-strong -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdia
gnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member -Wno-format-zero-length   -Qunused-arguments    -include /usr/home/koo
bs/repos/freebsd/ports/sysutils/openzfs-kmod/work/ZoF-df21d39/include/os/freebsd/spl/sys/ccompile.h -D__KERNEL__ -DFREEBSD_NAMECACHE -DBUILDING_ZFS -D__BSD_VISIBLE=1 -DHAVE_UIO_ZEROCOPY -DHAVE_KSID -DWITHOUT_NETDUMP -D_SYS_VMEM_H_ -D_MACHINE_ENDIAN_H_ -DKDTRACE_HOOKS -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHAVE_SS
E2 -DHAVE_AVX512F -DNDEBUG -DBITS_PER_LONG=64 -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc  -I/usr/home/user/repos/freebsd/ports/sysutils/openzfs-kmod/work/ZoF-df21d39/include -I/usr/home/user/repos/freebsd/ports/sysutils/openzfs-kmod/work/ZoF-df21d39/include/spl -I/usr/home/user/repos/free
bsd/ports/sysutils/openzfs-kmod/work/ZoF-df21d39/include/os/freebsd -I/usr/home/user/repos/freebsd/ports/sysutils/openzfs-kmod/work/ZoF-df21d39/include/os/freebsd/spl -I/usr/home/user/repos/freebsd/ports/sysutils/openzfs-kmod/work/ZoF-df21d39/include/os/freebsd/zfs -I. -I/usr/src/sys -I/usr/src/sys/contrib/c
k/include -fno-common -g -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include     -MD  -MF.depend.opensolaris_kmem.o -MTopensolaris_kmem.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno
-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-p
ragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member -Wno-format-zero-length  -Qunused-arguments -mno-aes -mno-avx  -std=iso9899:1999 -c /usr/home/user/repos
/freebsd/ports/sysutils/openzfs-kmod/work/ZoF-df21d39/module/os/freebsd/spl/opensolaris_kmem.c -o opensolaris_kmem.o
/usr/home/user/repos/freebsd/ports/sysutils/openzfs-kmod/work/ZoF-df21d39/module/os/freebsd/spl/opensolaris_kmem.c:244:2: error: implicit declaration of function 'zone_drain' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        zone_drain(cache->kc_zone);
        ^
/usr/home/user/repos/freebsd/ports/sysutils/openzfs-kmod/work/ZoF-df21d39/module/os/freebsd/spl/opensolaris_kmem.c:244:2: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
/usr/home/user/repos/freebsd/ports/sysutils/openzfs-kmod/work/ZoF-df21d39/module/os/freebsd/spl/opensolaris_kmem.c:251:14: error: too few arguments to function call, single argument 'req' was not specified
        uma_reclaim();
        ~~~~~~~~~~~ ^
/usr/src/sys/vm/uma.h:449:1: note: 'uma_reclaim' declared here
void uma_reclaim(int req);
^
3 errors generated.
*** Error code 1
ghost commented 5 years ago

@mattmacy do we have a fix for this we can bring in for the port?

javashin commented 5 years ago

all done this commit fixes everything 86923cbfd2362339b96c63d453849ac1a49667c2

javashin commented 5 years ago

thaks mmacy

javashin commented 5 years ago

fix HEAD build fix HEAD build https://github.com/zfsonfreebsd/ZoF/commit/86923cbfd2362339b96c63d453849ac1a49667c2

dont really means is gonna work it does compile here but on boot hangs crashdump and reboot with "ZFS LOCK TYPE : UNLOCK"

mattmacy commented 5 years ago

all done this commit fixes everything 86923cb You'll also want: https://github.com/zfsonfreebsd/ZoF/commit/df43298115d159ab926c36f283ecafb586f84612

mattmacy commented 5 years ago

@javashin those both need to be applied against the zfsbsd branch - it looks like that hasn't happened. Could you please apply and test?

javashin commented 5 years ago

@mattmacy thanks. i just compiled from the pr-20190906 branch and the module is fine compiled and working . no more crash dumps or zfs lock. + works with my updated kernel

FreeBSD hellbox-l440 13.0-CURRENT FreeBSD 13.0-CURRENT #0 r352112M: Mon Sep 9 21:52:44 AST 2019 root@hellbox-l440:/usr/obj/usr/src/amd64.amd64/sys/DIABLO amd64 1300047 .

but i cant compile the openzfs utils from it fails with >>>

../../module/zfs/spa_misc.c:2761:45: error: unknown type name 'zfs_kernel_param_t' param_set_deadman_failmode(const char val, zfs_kernel_param_t kp) ^ ../../module/zfs/spa_misc.c:2783:10: error: implicit declaration of function 'param_set_charp' is invalid in C99 [-Werror,-Wimplicit-function-declaration] return (param_set_charp(val, kp)); ^ ../../module/zfs/spa_misc.c:2783:10: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] 3 errors generated. gmake[5]: *** [Makefile:1253: spa_misc.lo] Error 1

javashin commented 4 years ago

Hi This Is Happening Again I have version 1300068 and 1300069 World+kernel in sync with the /usr/src here and the modules dont compile neither the utils , the rebase from the 21 of december of 2019 did compile but after boot with this module the dataset get some way corrupted , takes more than a minute to mount in other operating systems and when i compile world the binary result is broken and cant be installed with make installworld , the ports needs to be fixed i was able to fix some of the files but got stuck and cant compile because of some changes made in freebsd base

javashin commented 4 years ago

I need some help .....

javashin commented 4 years ago

@freqlabs @mattmacy if any of you can take a look to the openzfs ports and give me a quick patch or point me where and what i need to fix to solve this problem im having which im sure some other people will have or are having right now , but seems to be slow around here , i see @mattmacy working hard on rebases this holidays. thanks in advance.

javashin commented 4 years ago

i been talking about this in FreeBSDDesktop in gitter there is some info about this issue.

javashin commented 4 years ago

/mnt/freebsd/usr/ports/sysutils/openzfs-kmod/work/ZoF-d4169da/module/os/freebsd/zfs/zfs_ctldir.c:603:23: error: use of undeclared identifier 'VI_DOOMED' if ((dvp->v_iflag & VI_DOOMED) != 0) { ^ 1 error generated.

this fixed that^^^^^

ghost commented 4 years ago

The port is transitioning to a new maintainer but I have requested the port be updated to the latest commit as of yesterday.

javashin commented 4 years ago

The port is transitioning to a new maintainer but I have requested the port be updated to the latest commit as of yesterday. Hi Thanks/

I Dont Know If anyone has notice that ZoF is Corrupting files and making the mount time of a dataset mounted with last commits revisions work of ZOF the dataset in the same ZOL pool get slow and when i compiled world+kernel the files are corrupted and cant be installed with make installworld , just to test i did created a zfs pool just for freebsd with zfs legacy and compiled world in there and all went fine . for now im not using zfsonfreebsd someone needs to investigate i recompiled world like 4 times with the same result .

malbertoni commented 4 years ago

@javashin we haven't observed that with the tests, is this with the latest branch?

mattmacy commented 4 years ago

port updated - file a new issue for future bugs

javashin commented 4 years ago

Sure