Skip to content

Adding Rustlings like binary, Makefile and semi Cross-Platform Support(WIP) - #5

Open
Alfred-Jijo wants to merge 16 commits into
Pinjontall94:mainfrom
Alfred-Jijo:main
Open

Adding Rustlings like binary, Makefile and semi Cross-Platform Support(WIP)#5
Alfred-Jijo wants to merge 16 commits into
Pinjontall94:mainfrom
Alfred-Jijo:main

Conversation

@Alfred-Jijo

Copy link
Copy Markdown

This PR replaces the initial Cmake verification app with a robust, C application (src/ceilings.c) that needs to bootstrapped. It introduces a Makefile build system to ensure user changes code compiles before logic checks and adds full support for WSL, Linux, and macOS environments.

Changes

Features

  • Replace Cmake build system with Make, and a C binary that needs to be bootstrapped.
  • Cross-Platform - ish: Works on windows with WSL
  • (WIP)Automation Scripts: Added generate_patches.cmd (Windows) and generate_patches.sh (Bash) to automate the creation of solution patches from the exercises/ directory.

Bug Fixes & Refactoring

  • Code Style: Refactored C c
  • code to follow KNF/BSD style (function prototypes, clean variable declarations).
  • feel free to remove clang-format or replace it

Testing

  1. Clone the branch.
  2. Run make to build the ceilings tool.
  3. Run ./ceilings (or ceilings.exe on Windows).
  4. Verify Detection: Ensure the tool detects exercises in exercises/ and compares them against patches/.
  5. Verify Compilation Failures: Introduce a syntax error in an exercise file (e.g., exercises/001_START_HERE.c) and run verify. It should report a Compilation Error and stop.
  6. Verify Logic Failures: This happens when C code is valid but logic/solution isn't. It should report a Logic Mismatch.

Checklist

  • Compilation succeeds on Linux (gcc).
  • Compilation succeeds on Windows (MinGW / gcc).
  • Makefile correctly targets individual exercises.
  • Fix generating patches and generate them all

its easy tu make a makefile crossplatform, because of wsl
Current State

Added

Cross-Platform Verification Tool (src/ceilings.c):

Replaced initial Python scripts with a robust C implementation.

Detects OS (Windows vs. POSIX) to handle directory traversal (<dirent.h>
vs FindFirstFile) and shell redirection (/dev/null vs NUL) correctly.

Implements a logic check using git apply --check --reverse.

Integrated Build System:

Added Makefile to handle compilation of individual exercises.

Updated verification tool to trigger make for specific exercises before
verifying logic.

Ensures students see raw GCC/Clang compiler errors immediately if their
code fails to build.

Automation Scripts:

Added generate_patches.cmd (Windows) and generate_patches.sh
(Linux/macOS) to automatically generate solution patches from the
exercises/ directory.

Changed

Buffer Safety: Increased internal buffer sizes (MAX_BUFFER = 4096) in
ceilings.c to prevent GCC -Wformat-truncation warnings when constructing
long file paths or commands.

Code Style: Refactored ceilings.c to follow KNF/BSD coding standards
(function prototypes, indentation, variable declarations).

User Experience:

Verification now stops immediately upon a compilation error to keep the
feedback loop tight.

Added specific error messages differentiating between "Compilation
Failed" and "Logic Incorrect".

Fixed

Fixed shell command syntax for Windows cmd.exe where > /dev/null was
causing syntax errors (replaced with dynamic NULL_DEVICE constant).

Fixed path separators to be dynamic (\ for Windows, / for POSIX).k
@Alfred-Jijo
Alfred-Jijo marked this pull request as draft December 29, 2025 16:53
@Alfred-Jijo
Alfred-Jijo marked this pull request as draft December 29, 2025 16:53
@Alfred-Jijo
Alfred-Jijo marked this pull request as ready for review December 29, 2025 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant