Skip to main content

A build system wrapper for PROS robotics projects

Project description

Sketchy PROS Compiler Wrapper

A build system wrapper for PROS robotics projects that provides file change tracking, build logging, and binary backups.

Installation

Install from PyPI:

pip install sketchy-pros-compiler

Install from git

git clone https://github.com/zxzimeng/sketchy_pros_compiler.git
cd sketchy_pros_compiler
pip install .

Features

  • Tracks changes between compilations
  • Concatenates source files for faster compilation
  • Preserves original file structure
  • Maintains build history with timestamps
  • Backs up binary files after successful builds
  • Diff output for file changes to see the changes made since last compile

Performance Benefits

Standard PROS Build

$time pros --no-analytics make  
> 21.58s user 1.90s system 98% cpu 23.819 total

$ls -s bin/hot.package.elf
Binary size: 9064KB (bin/hot.package.elf)

Sketchy PROS Compiler

$time sketchy_pros_compiler
> 2.77s user 0.47s system 85% cpu 3.769 total

$ls -s bin/hot.package.elf
Binary size: 6728KB (bin/hot.package.elf)

Improvements:

  • Faster compilation, smaller compiliation size on larger projects
  • Maintains full functionality, file structure, and readability
  • Includes change tracking and backup features

Directory Structure

~/tmp/sketchycompiler/
├── hard/                     # Temporary build files
├── softstorage/             # Source file snapshots for diff comparison
└── logstorage/             
    ├── build_history.log    # Complete build history
    └── [timestamp]/         # Per-build archives
        ├── changes.log      # File changes for this build
        └── bin/*            # Binary backup from this build

Example Structure:

❯ tree -r
.
├── softstorage
│   ├── pid_tune_assist
│   │   └── pid_tune_assist.cpp
│   ├── opcontrol.cpp
│   ├── odometry.cpp
│   ├── main.cpp
│   ├── deprecated_auton
│   │   ├── blue_right.cpp
│   │   └── blue_left.cpp
│   ├── auxilliary_control.cpp
│   ├── auton_selector
│   │   └── auton_selector.cpp
│   └── auton_programs
│       ├── sixty_second.cpp
│       ├── red_right.cpp
│       ├── red_left.cpp
│       ├── no_risk_auton_programs.cpp
│       ├── map_selector_functions_and_logic.cpp
│       ├── blue_right.cpp
│       └── blue_left.cpp
├── logstorage
│   ├── build_history.log
│   └── March_04_21_07_05_2025
│       ├── main.cpp.o
│       ├── hot.package.elf
│       ├── hot.package.bin
│       ├── cold.package.elf
│       ├── cold.package.bin
│       ├── changes.log
│       ├── auton_selector
│       │   └── auton_selector.cpp.o
│       └── _pros_ld_timestamp.o
└── hard
    ├── pid_tune_assist
    ├── deprecated_auton
    └── auton_programs

13 directories, 24 files

Usage

After installing to path, run from within a PROS project directory to build:

pros_sketchy

The script will:

  1. Show changes since last compilation
  2. Concatenate source files (excluding auton_selector)
  3. Run PROS build system
  4. Restore original file structure
  5. Archive build artifacts and changes

Requirements

  • PROS CLI installed and configured
  • macOS environment

Sample Run Output

❯ pros_sketchy 
[34m=== Changes since last compilation ===[0m

[36m=== File: auton_programs/blue_right.cpp ===[0m
@@ -11,7 +11,7 @@

         // Get First Mogo
         chassis.processMovement(Movement{
-                                    .pose = {-41.652, -36.117, 270}, .offset_distance = 0, .perp_offset_distance = 0,
+                                    .pose = {-43, -5, 270}, .offset_distance = 0, .perp_offset_distance = 0,
                                     .moveParams = MoveToPoseParams{.forwards = false, .minSpeed = 70},
                                     .exitDistance = 0,
                                     .timeout = 4000

[35m════════════════════════════════════════════════════════════════[0m
[36m                      PROS Build Output                           [0m
[35m════════════════════════════════════════════════════════════════[0m

Compiled src/main.cpp [WARNINGS]
src/main.cpp: In member function 'void Aux::watchIndexer()':
src/main.cpp:2321:23: warning: comparison between 'enum Aux::ConveyorState' and 'enum Aux::IntakeClawSystemState' [-Wenum-compare]
 2321 |     if (conveyorState == AUTO_CONVEYOR) {
      |         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
In file included from ./include/lemlib/api.hpp:5,
                 from ./include/main.h:43,
                 from src/main.cpp:1:
./include/lemlib/util.hpp: At global scope:
./include/lemlib/util.hpp:78:17: warning: inline function 'constexpr float lemlib::sanitizeAngle(float, bool)' used but never defined
   78 | constexpr float sanitizeAngle(float angle, bool radians = true);
      |                 ^~~~~~~~~~~~~
Adding timestamp [OK]
Linking hot project with ./bin/cold.package.elf and LemLib,libc,liblvgl,libm,libpros [OK]
Section sizes:
   text	  data	   bss	 total	   hex	filename
  97356	    20	48249600	48346976	2e1b760	bin/hot.package.elf
Creating bin/hot.package.bin for VEX EDR V5 [DONE]
Compilation complete and files restored successfully.

[35m════════════════════════════════════════════════════════════════[0m
[36m                      Final File Status                           [0m
[35m════════════════════════════════════════════════════════════════[0m

[34m=== Changes since last compilation ===[0m
[33mNo changes detected in any files[0m

Build Archives

Each build creates a timestamped directory containing:

  • Binary files from successful builds
  • Detailed change logs
  • Compilation status and warnings
  • Full build output history

Access previous builds in ~/tmp/sketchycompiler/logstorage/

How It Works

  1. Change Detection

    • Tracks file modifications between builds
    • Shows colorized diffs of changes
    • Maintains history of all modifications
  2. Build Optimization

    • Concatenates source files for faster compilation
    • Reduces binary size through optimized linking
    • Preserves original project structure
  3. Backup System

    • Archives each build with timestamp
    • Stores binary files and changes
    • Maintains complete build history
  4. File Management

    • Temporary build directory for compilation
    • Automatic restoration of original files
    • Structured storage of build artifacts

Limitations

You may not use the same variable names for the variables in different files as they will be compiled in one file, variable hashing is not supported yet.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sketchy_pros_compiler-1.0.2.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sketchy_pros_compiler-1.0.2-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file sketchy_pros_compiler-1.0.2.tar.gz.

File metadata

  • Download URL: sketchy_pros_compiler-1.0.2.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for sketchy_pros_compiler-1.0.2.tar.gz
Algorithm Hash digest
SHA256 5f0c5ee714fb8cfde48c05eb38225bfa69facdd642c19c7f5802b68048e3ec67
MD5 cd3e3e31d4e422fc63f59b879eb7361a
BLAKE2b-256 8da71ecc131470fbb582bcd5f4459ee18fb2e60d4c98aa9e9d0afe8f6c3272fa

See more details on using hashes here.

File details

Details for the file sketchy_pros_compiler-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for sketchy_pros_compiler-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4997bd380b147111fd1e40223f3a7188b4cc7f1ad226d599a67042ae09da5e03
MD5 b800ed950da53c99b85aee8092ab7511
BLAKE2b-256 f9c5f6dfd3452df18f0a20d951e170cea8be9ae3580792b1f456b34e06bb31c7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page