Skip to content
This repository was archived by the owner on Jan 4, 2026. It is now read-only.

Conversation

@assembler-0
Copy link
Owner

@assembler-0 assembler-0 commented Nov 1, 2025

CMake fixes

Summary by CodeRabbit

  • New Features

    • Enabled ccache for faster incremental builds
    • Added many new configurable feature toggles
    • Introduced improved concurrency primitives for better locking and NUMA-friendly behavior
  • Chores

    • Enhanced build diagnostics, toolchain auto-selection, and defaulting to Release when unset
    • Reworked compilation flag handling for finer control
    • Replaced legacy formatting helpers with standard snprintf/vsnprintf for safer string handling
    • Adjusted linker discard behavior and build messaging outputs

@coderabbitai
Copy link

coderabbitai bot commented Nov 1, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The change batch overhauls the build and tooling configuration and adds concurrency primitives. CMake now includes new modules, auto-selects host toolchains, emits expanded diagnostics, defaults build type, and adds ccache support via VF_ENABLE_CCACHE. Many new VF_CONFIG options were added and compile-time flags are now applied conditionally; NASM flags were refactored. Multiple C string-formatting calls replaced a custom API with standard snprintf/vsnprintf. Linker DISCARD sections were adjusted. In Rust, MCS mutexes and enhanced spinlock APIs plus C FFI wrappers and try-locks were introduced.

Poem

🐇 I hopped through CMake, found ccache in a glen,
Flags now whisper choices, selected one by when,
Spinlocks hum a rhythm, MCS guards hold tight,
snprintf trims edges, linker sheds debug's light,
I nibble code carrots—builds faster by night!

Pre-merge checks

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title Check ❓ Inconclusive The pull request title "Development" is extremely vague and generic, failing to convey any meaningful information about the changeset. While the PR description mentions "CMake fixes," the title itself does not reflect the actual changes, which include refactoring CMakeLists.txt toolchain handling, adding ccache integration, introducing new configuration options, restructuring compilation flags, and updating linker script sections. A developer scanning the git history would gain no understanding of the primary purpose or scope of these changes from this title alone. Revise the title to be specific and descriptive of the main changes. Consider a title like "Refactor CMake configuration and toolchain handling" or "CMake fixes: improve toolchain detection and add ccache support" that clearly summarizes the primary improvements to the build system without ambiguity.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4c47903 and 3298096.

📒 Files selected for processing (16)
  • CMakeLists.txt (3 hunks)
  • fs/DriveNaming.c (1 hunks)
  • fs/FileSystem.c (1 hunks)
  • fs/Iso9660.c (1 hunks)
  • fs/MBR.c (1 hunks)
  • fs/procfs/ProcFS.c (1 hunks)
  • kernel/atomic/rust/src/ffi.rs (2 hunks)
  • kernel/atomic/rust/src/mcs.rs (3 hunks)
  • kernel/atomic/rust/src/spinlock.rs (6 hunks)
  • kernel/etc/Console.c (5 hunks)
  • kernel/etc/Format.c (1 hunks)
  • kernel/etc/Format.h (2 hunks)
  • kernel/etc/Shell.c (1 hunks)
  • kernel/sched/EEVDF.c (5 hunks)
  • kernel/sched/MLFQ.c (5 hunks)
  • mm/security/Cerberus.c (4 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6bdfaf8 and 4c47903.

📒 Files selected for processing (6)
  • CMakeLists.txt (3 hunks)
  • cmake/ccache.cmake (1 hunks)
  • cmake/configuration.cmake (1 hunks)
  • cmake/features.cmake (1 hunks)
  • cmake/flags.cmake (1 hunks)
  • voidframe.ld (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: assembler-0
Repo: assembler-0/autocc PR: 33
File: include/utils.hpp:138-190
Timestamp: 2025-08-04T13:24:48.984Z
Learning: The user assembler-0 tends to create wrapper functions during refactoring and sometimes accidentally leaves duplicate implementations. They have a casual, self-aware attitude about coding mistakes and are receptive to feedback about code duplication issues.
Learnt from: assembler-0
Repo: assembler-0/VoidFrame PR: 101
File: kernel/etc/Shell.c:829-837
Timestamp: 2025-08-31T07:06:37.003Z
Learning: assembler-0 is working on optimizing ramfs performance in VoidFrame kernel and wants to implement proper filesystem characteristics like faster lookups, better memory management, and advanced features like copy-on-write and caching.
Learnt from: assembler-0
Repo: assembler-0/VoidFrame PR: 132
File: arch/x86_64/syscall/Syscall.c:12-19
Timestamp: 2025-09-19T11:55:43.328Z
Learning: In the VoidFrame kernel project, assembler-0 is implementing basic POSIX-compliant syscalls in ring 0 without user/kernel memory protection, prioritizing getting basic functionality working before adding full security features.
Learnt from: assembler-0
Repo: assembler-0/VoidFrame PR: 103
File: docs/ARCHITECHTURE.md:1-3
Timestamp: 2025-08-31T14:19:11.366Z
Learning: assembler-0 wants to implement deep fault tracing for VoidFrame kernel exceptions (Page Fault, General Protection Fault, Invalid Opcode) instead of just panicking. The current interrupt handler has complete register state available in the Registers struct (defined in arch/x86_64/cpu/Cpu.h) including RBP for stack walking, RIP for fault location, and error codes for analysis.
Learnt from: assembler-0
Repo: assembler-0/VoidFrame PR: 80
File: README.md:7-8
Timestamp: 2025-08-13T08:43:54.750Z
Learning: User assembler-0 is working on VoidFrame kernel with a tight deadline (2-3 days before summer ends) and specifically requested runtime safety checks similar to __stack_chk_fail but for deadlocks and other kernel issues. The kernel already has extensive safety mechanisms including stack canaries, guard pages, heap integrity checks, and process security validation.
Learnt from: assembler-0
Repo: assembler-0/VoidFrame PR: 72
File: arch/x86_64/syscall/SyscallEntry.asm:24-30
Timestamp: 2025-08-12T02:13:46.266Z
Learning: User assembler-0 has existing ELF infrastructure in VoidFrame kernel with Elf.h header definitions and CreateProcess() function that properly sets up process context including stack allocation, ProcessExitStub return address, and register initialization. The issue was missing ELF loader implementation, not compilation problems.
🔇 Additional comments (14)
voidframe.ld (2)

79-79: LGTM: Correct to discard dynamic sections for a static kernel.

Discarding .dynamic* sections is appropriate for a statically-linked kernel, as these sections are only needed for dynamic linking at runtime.


74-80: Confirm intentional inclusion of debug symbols in Release builds.

The verification reveals that DEBUG_SYMBOLS defaults to ON, meaning debug symbols will be generated and—combined with the removal of .debug* from the DISCARD section—will now be kept in the kernel binary by default in Release builds.

This is a significant change with production implications:

  • Debug symbols can increase binary size by 2-10x
  • Requires explicitly setting DEBUG_SYMBOLS=OFF to restore minimal Release builds
  • Not documented in the build system changes

Please confirm:

  1. Is this intentional for all builds, or should CMAKE_BUILD_TYPE=Release automatically disable DEBUG_SYMBOLS?
  2. Is the binary size increase expected and acceptable for the project's deployment targets?
cmake/ccache.cmake (3)

1-5: LGTM!

The option definition is clear and enabling ccache by default is appropriate for faster incremental builds during development.


22-30: LGTM!

Displaying ccache statistics at configure time provides useful feedback to developers. The use of ERROR_QUIET appropriately prevents failures if the stats command encounters issues.


31-33: LGTM!

The warning appropriately informs users when ccache is requested but unavailable, without failing the build.

cmake/flags.cmake (1)

25-30: LGTM! Good refactoring for maintainability.

The variable-based approach cleanly separates the base NASM flags from the conditional VESA framebuffer flag, making the configuration more maintainable. This aligns well with the conditional flag patterns used elsewhere in the file.

cmake/features.cmake (2)

4-90: LGTM! Excellent refactoring for feature configurability.

The transition from bulk definitions to per-flag conditional blocks enables fine-grained control over kernel features. Each flag is now independently configurable via the options defined in cmake/configuration.cmake, significantly improving build flexibility.

The logical grouping with spacing (lines 71-90) enhances readability for related features.


92-106: LGTM!

The existing conditional blocks are correctly preserved, maintaining backward compatibility and proper error handling for the scheduler selection.

CMakeLists.txt (4)

18-20: LGTM!

The ccache module inclusion is well-positioned and aligns with the new ccache.cmake functionality.


42-56: Verify intended Windows support strategy.

The toolchain auto-selection includes a Windows branch (lines 50-52), but earlier platform checks issue a FATAL_ERROR for Windows (line 35). This makes the Windows toolchain selection unreachable.

Please clarify the intended Windows support:

  1. If Windows is not supported, remove the Windows branch from the toolchain auto-selection (lines 50-52).
  2. If Windows support via WSL is intended, consider changing line 35 from FATAL_ERROR to a more nuanced check or documentation.
  3. If this is defensive coding for future Windows support, consider adding a comment explaining the unreachable branch.

58-61: LGTM! Sensible default build type.

Defaulting to Release when CMAKE_BUILD_TYPE is unset is a reasonable choice, and the warning ensures users are aware of the automatic selection.


70-79: LGTM! Enhanced diagnostic output.

Adding the generator status message complements the existing build information display and aids in troubleshooting build configurations.

cmake/configuration.cmake (2)

9-14: LGTM! Appropriate defaults for optional features.

The OFF defaults for specialized drivers (VMware SVGA II), debug features (Cerberus logging/threat reporting, panic override), and optional functionality (multiboot modules) are sensible choices that prioritize a lean default configuration.


16-38: LGTM! Well-balanced defaults for core functionality.

The ON defaults appropriately enable:

  • Essential hardware support (PCI, PS2, storage controllers)
  • Security features (memory protection, Cerberus stack protection)
  • Standard system components (shell, VFS, framebuffer)

This provides a functional out-of-the-box configuration while allowing users to disable unnecessary features.

@assembler-0 assembler-0 merged commit 80de4df into main Nov 1, 2025
1 of 2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants