davidchisnall / container-vm-scripts

Scripts for building FreeBSD VMs for use with podman
47 stars 4 forks source link

FreeBSD 15 (current) build fails #6

Open PetruGarstea opened 10 months ago

PetruGarstea commented 10 months ago

Hi,

--- virtio_p9fs.o ---
cc -target aarch64-unknown-freebsd15.0 --sysroot=/usr/obj/usr/local/poudriere/jails/podman-vm-jail/usr/src/arm64.aarch64/tmp -B/usr/obj/usr/local/poudriere/jails/podman-vm-jail/usr/src/arm64.aarch64/tmp/usr/bin  -O2 -pipe -fno-common  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -DKLD_TIED -nostdinc   -DHAVE_KERNEL_OPTION_HEADERS -include /usr/obj/usr/local/poudriere/jails/podman-vm-jail/usr/src/arm64.aarch64/sys/GENERIC/opt_global.h -I. -I/usr/local/poudriere/jails/podman-vm-jail/usr/src/sys -I/usr/local/poudriere/jails/podman-vm-jail/usr/src/sys/contrib/ck/include -fno-common -g -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fPIC -fdebug-prefix-map=./machine=/usr/local/poudriere/jails/podman-vm-jail/usr/src/sys/arm64/include -I/usr/obj/usr/local/poudriere/jails/podman-vm-jail/usr/src/arm64.aarch64/sys/GENERIC   -mstack-protector-guard=sysreg -mstack-protector-guard-reg=sp_el0 -mstack-protector-guard-offset=0  -MD  -MF.depend.virtio_p9fs.o -MTvirtio_p9fs.o -mgeneral-regs-only -ffixed-x18 -mbranch-protection=standard -ffreestanding -fwrapv -fstack-protector -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-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     -std=gnu99 -c /usr/local/poudriere/jails/podman-vm-jail/usr/src/sys/dev/virtio/p9fs/virtio_p9fs.c -o virtio_p9fs.o
/usr/local/poudriere/jails/podman-vm-jail/usr/src/sys/dev/virtio/p9fs/virtio_p9fs.c:244:45: error: too many arguments to function call, expected 3, have 4
      156.45 real        22.87 user         7.15 sys

make[1]: stopped in /usr/local/poudriere/jails/podman-vm-jail/usr/src

make: stopped in /usr/local/poudriere/jails/podman-vm-jail/usr/src
[00:51:20] Error: Failed to 'make buildkernel'
[00:51:20] Error while creating jail, cleaning up.
[00:51:20] Removing podman-vm-jail jail... done
[00:51:21] Cleaning podman-vm-jail data... done
# vim /usr/local/poudriere/jails/podman-vm-jail/usr/src/sys/dev/virtio/p9fs/virtio_p9fs.c
#
# git remote -v
dfr     https://github.com/dfr/freebsd-src (fetch)
dfr     https://github.com/dfr/freebsd-src (push)
origin  https://github.com/freebsd/freebsd-src (fetch)
origin  https://github.com/freebsd/freebsd-src (push)
# git status
On branch main
Your branch is up to date with 'origin/main'.

You are currently cherry-picking commit f343c9e35ddb.
  (all conflicts fixed: run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
        modified:   share/man/man5/Makefile
        new file:   share/man/man5/p9fs.5
        modified:   sys/conf/files
        modified:   sys/conf/options
        new file:   sys/dev/virtio/p9fs/virtio_p9fs.c
        new file:   sys/dev/virtio/p9fs/virtio_p9fs.h
        new file:   sys/fs/p9fs/p9_client.c
        new file:   sys/fs/p9fs/p9_client.h
        new file:   sys/fs/p9fs/p9_debug.h
        new file:   sys/fs/p9fs/p9_protocol.c
        new file:   sys/fs/p9fs/p9_protocol.h
        new file:   sys/fs/p9fs/p9_transport.c
        new file:   sys/fs/p9fs/p9_transport.h
        new file:   sys/fs/p9fs/p9fs.h
        new file:   sys/fs/p9fs/p9fs_proto.h
        new file:   sys/fs/p9fs/p9fs_subr.c
        new file:   sys/fs/p9fs/p9fs_vfsops.c
        new file:   sys/fs/p9fs/p9fs_vnops.c
        modified:   sys/kern/vfs_mountroot.c
        modified:   sys/modules/Makefile
        new file:   sys/modules/p9fs/Makefile
        modified:   sys/modules/virtio/Makefile
        new file:   sys/modules/virtio/p9fs/Makefile
# uname -a
FreeBSD fbsd-dev 15.0-CURRENT FreeBSD 15.0-CURRENT #0 main-n266315-b2b381d365fc: Thu Nov  9 03:49:34 UTC 2023     root@releng3.nyi.freebsd.org:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC arm64

The compiler fails on https://github.com/dfr/freebsd-src/blob/9pfs/sys/dev/virtio/p9fs/virtio_p9fs.c#L244

the virtio.h was updated recently https://github.com/freebsd/freebsd-src/blob/main/sys/dev/virtio/virtio.h#L106 which causes the compiler to fail.

The quick fix is

diff --git a/sys/dev/virtio/p9fs/virtio_p9fs.c b/sys/dev/virtio/p9fs/virtio_p9fs.c
index 07439e58f91c..adf06b72f3e9 100644
--- a/sys/dev/virtio/p9fs/virtio_p9fs.c
+++ b/sys/dev/virtio/p9fs/virtio_p9fs.c
@@ -241,7 +241,7 @@ vt9p_alloc_virtqueue(struct vt9p_softc *sc)
            vt9p_intr_complete, sc, &sc->vt9p_vq,
            "%s request", device_get_nameunit(dev));

-       return (virtio_alloc_virtqueues(dev, 0, 1, &vq_info));
+       return (virtio_alloc_virtqueues(dev, 1, &vq_info));
 }

 /* Probe for existence of 9P virtio channels */

The nature of these issues are expected to happen and I hope the development work will be soon merged into freebsd and podman upstream repos.

I raised the PR with the above patch

Regrads, Petru

davidchisnall commented 10 months ago

Do you know if this change was before or after 14-RELEASE was branched? I'd like to move to tracking the release branch soon.

Longer term, unfortunately, Podman is moving to VirtFS (FUSE over VirtIO), so the 9pfs is no longer required, but someone needs to do the work to glue the FreeBSD VirtIO and FUSE bits together.

PetruGarstea commented 10 months ago

Do you know if this change was before or after 14-RELEASE was branched? I'd like to move to tracking the release branch soon.

I dont know, but the change was done on September 18th, here is the commit https://github.com/freebsd/freebsd-src/commit/180c02405b12e08bbb69bb693a38077db0c85e9b#diff-f1763032b199ce719375bcffcebc956866dcab3f9d912f0b5cefcd29e4a29c30L317

davidchisnall commented 10 months ago

Thanks. @dfr will need to pull that commit and squash it with the top one, at least for now.

dfr commented 10 months ago

Thanks. @dfr will need to pull that commit and squash it with the top one, at least for now.

As it happens, I was working on the p9fs diff today and already fixed this breakage. I should be able to update the diff sometime tomorrow.

davidchisnall commented 9 months ago

It looks as if this change went in after 14.0 branched, so this means that this no longer applies on 14.0. I was hoping to move to a release for the base once this had gone out.