SerenityOS / serenity

The Serenity Operating System 🐞
https://serenityos.org
BSD 2-Clause "Simplified" License
30.43k stars 3.18k forks source link

./Meta/serenity.sh run: die: SERENITY_SOURCE_DIR is not set #25004

Open squeaktoy opened 2 weeks ago

squeaktoy commented 2 weeks ago

I tried getting SerenityOS to run on my Gentoo system. Unfortunately I get this output:

$ ./Meta/serenity.sh run
[0/5] Performing build step for 'lagom'
ninja: no work to do.
[1/5] Performing install step for 'lagom'
[0/1] Install the project...
-- Install configuration: ""
[2/5] Performing build step for 'serenity'
[0/2] Re-checking globbed directories...
[3/3] Linking CXX executable Kernel/Prekernel/kernel_x86-64
[3/5] Performing install step for 'serenity'
[0/2] Re-checking globbed directories...
[3/4] Install the project...
-- Install configuration: ""
[5/5] Completed 'serenity'
ninja: Entering directory `/home/user/software/sys-os/serenity/Build/x86_64'
[0/2] Re-checking globbed directories...
[3/4] Install the project...
-- Install configuration: ""
ninja: Entering directory `/home/user/software/sys-os/serenity/Build/x86_64'
[0/2] Re-checking globbed directories...
[0/1] cd /home/user/software/sys-os/serenity/Build/x86_64 && /usr/bin/cmake -E env SERENITY_...OLCHAIN=GNU LLVM_VERSION=13.2.0 /home/user/software/sys-os/serenity/Meta/build-image-qemu.s
doas (user@weerwolf) password: 
find: ‘/Base’: No such file or directory
du: cannot access '/Base': No such file or directory
checking existing image
e2fsck 1.47.1 (20-May-2024)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
_disk_image: 11/99072 files (0.0% non-contiguous), 3672/368500 blocks
done
mounting filesystem... done
die: SERENITY_SOURCE_DIR is not set
unmounting filesystem... done
FAILED: CMakeFiles/qemu-image _disk_image /home/user/software/sys-os/serenity/Build/x86_64/CMakeFiles/qemu-image /home/user/software/sys-os/serenity/Build/x86_64/_disk_image 
cd /home/user/software/sys-os/serenity/Build/x86_64 && /usr/bin/cmake -E env SERENITY_SOURCE_DIR=/home/user/software/sys-os/serenity SERENITY_ARCH=x86_64 SERENITY_TOOLCHAIN=GNU LLVM_VERSION=13.2.0 /home/user/software/sys-os/serenity/Meta/build-image-qemu.sh
ninja: build stopped: subcommand failed.

I'm using GCC 14.2.1

spholz commented 2 weeks ago

This looks like a doas issue.

https://github.com/SerenityOS/serenity/blob/36b7cac60548d604040cf117acc371b842cdaa7e/Meta/shell_include.sh#L24-L25

You need to either configure doas to keep our environment variables set with setenv or just use keepenv (https://man.openbsd.org/doas.conf.5).

squeaktoy commented 2 weeks ago

So the keepenv trick got me a little further, but now I'm getting this output:

[0/5] Performing build step for 'lagom'
ninja: no work to do.
[1/5] Performing install step for 'lagom'
[0/1] Install the project...
-- Install configuration: ""
[2/5] Performing build step for 'serenity'
[0/2] Re-checking globbed directories...
[3/3] Linking CXX executable Kernel/Prekernel/kernel_x86-64
[3/5] Performing install step for 'serenity'
[0/2] Re-checking globbed directories...
[3/4] Install the project...
-- Install configuration: ""
[5/5] Completed 'serenity'
ninja: Entering directory `/home/user/software/sys-os/serenity/Build/x86_64'
[0/2] Re-checking globbed directories...
[3/4] Install the project...
-- Install configuration: ""
ninja: Entering directory `/home/user/software/sys-os/serenity/Build/x86_64'
[0/2] Re-checking globbed directories...
[0/1] cd /home/user/software/sys-os/serenity/Build/x86_64 && /usr/bin/cmake -E env SERENITY_...OLCHAIN=GNU LLVM_VERSION=13.2.0 /home/user/software/sys-os/serenity/Meta/build-image-qemu.s
doas (user@weerwolf) password: 
checking existing image
e2fsck 1.47.1 (20-May-2024)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
_disk_image: 18251/99072 files (5.6% non-contiguous), 222951/380522 blocks
done
mounting filesystem... done
installing base system... done
creating initial filesystem structure... done
creating utmp file... done
setting up device nodes folder... done
setting up sysfs folder... done
installing users... done
adding some desktop icons... done
installing shortcuts... done
installing 'checksum' variants... done
unmounting filesystem... done
ninja: Entering directory `/home/user/software/sys-os/serenity/Build/x86_64'
[0/2] Re-checking globbed directories...
[0/1] cd /home/user/software/sys-os/serenity/Build/x86_64 && /usr/bin/cmake -E env SERENITY_...oftware/sys-os/serenity SERENITY_ARCH=x86_64 /home/user/software/sys-os/serenity/Meta/run.s
qemu-system-x86_64: multiboot knows VBE. we don't
qemu-system-x86_64: -device nvme,serial=deadbeef,drive=boot-drive,bus=bridge4,logical_block_size=4096,physical_block_size=4096: Could not open '_disk_image': Permission denied
ADKaster commented 2 weeks ago

I would check the permissions on Build/x86_64/_disk_image. if they are indeed messed up, chmod/chown-ing them to be accessible by your user should let it boot if you simply do ninja -C Build/x86_64 run. That target won't rebuild any changed C++ files though. It's possible that things don't work right with doas, it's been a while since anyone tested it.