Skip to content

Commit 2fa0e6d

Browse files
[Patch] Photon v0.1.1
- Added dependency check.
1 parent c86ff2f commit 2fa0e6d

7 files changed

Lines changed: 401 additions & 8 deletions

File tree

photon/CHANGELOG.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Photon Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
## [0.1.1] - 2025-11-10
6+
7+
### Added
8+
- **System Requirements Check** feature from Phase 1 roadmap
9+
- New `photon check` command to verify system requirements
10+
- Automatic verification before each build
11+
- Checks for Rust compiler (1.70.0+), Cargo, Git, and LLVM
12+
- Helpful error messages with installation links when requirements are missing
13+
- Version detection for all required tools
14+
- Distinguishes between critical requirements (Rust, Cargo, Git) and optional (LLVM)
15+
- Unit tests for version checking logic
16+
17+
### Changed
18+
- Updated help documentation to include `photon check` command
19+
- Enhanced build process to verify system requirements before compilation
20+
- Updated README.md with system requirements section
21+
- Updated QUICKSTART.md with system check step
22+
- Updated SCOPE.md to mark System Requirements Check as complete
23+
24+
### Technical Details
25+
- New module: `src/system_check.rs`
26+
- Dependencies: Uses standard library only (no new external dependencies)
27+
- Cross-platform compatible (Linux, macOS, Windows)
28+
29+
## [0.1.0] - 2025-11-08
30+
31+
### Added
32+
- Initial release of Photon build tool
33+
- Cross-platform build support (Linux, macOS, Windows)
34+
- Multiple build profiles: debug, release, snapshot
35+
- Binary installation to libs/ with platform-specific naming
36+
- Git integration for version tracking
37+
- Clean build artifacts command
38+
- Beautiful CLI output with ASCII banner
39+
- Comprehensive help system
40+
- Version information command
41+
42+
### Features
43+
- `photon build [profile]` - Build Noviq interpreter
44+
- `photon clean` - Clean build artifacts
45+
- `photon install` - Install binaries to libs/
46+
- `photon help` - Show help information
47+
- `photon version` - Show version information
48+
49+
---
50+
51+
## Version Format
52+
53+
Photon follows [Semantic Versioning](https://semver.org/):
54+
- MAJOR.MINOR.PATCH (e.g., 0.1.1)
55+
- MAJOR: Breaking changes
56+
- MINOR: New features (backward compatible)
57+
- PATCH: Bug fixes (backward compatible)

photon/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "photon"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
edition = "2021"
55
description = "Build tool for the Noviq programming language"
66
authors = ["Noviq Contributors"]

photon/QUICKSTART.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@
88
cargo build --release
99
```
1010

11-
2. **Add to PATH (Optional but recommended)**:
11+
2. **Check System Requirements**:
12+
```bash
13+
./target/release/photon check
14+
```
15+
16+
This verifies you have Rust, Cargo, Git, and other required tools installed.
17+
18+
3. **Add to PATH (Optional but recommended)**:
1219
```bash
1320
# Linux/macOS - Add to ~/.bashrc or ~/.zshrc
1421
export PATH="$PATH:/path/to/Noviq/photon/target/release"
@@ -63,8 +70,14 @@ photon install
6370

6471
## Troubleshooting
6572

73+
### "System requirements not met"
74+
- Run `photon check` to see what's missing
75+
- Install Rust: https://rustup.rs/
76+
- Install Git: https://git-scm.com/downloads
77+
6678
### "cargo: command not found"
6779
- Install Rust: https://rustup.rs/
80+
- Make sure `~/.cargo/bin` is in your PATH
6881

6982
### "Failed to change to Noviq directory"
7083
- Make sure you're running Photon from the `photon/` directory

photon/README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Photon is a cross-platform build tool written in Rust that compiles the Noviq in
77
## Features
88

99
- Fast & Reliable - Built in Rust for performance and safety
10+
- System Requirements Check - Automatically verifies Rust, Cargo, and Git
1011
- Multiple Build Profiles - Debug, Release, and Snapshot builds
1112
- Automatic Installation - Copy built binaries to `libs/` with proper naming
1213
- Clean Builds - Easy artifact cleanup
@@ -52,6 +53,9 @@ photon build snapshot
5253
### Other Commands
5354

5455
```bash
56+
# Check system requirements
57+
photon check
58+
5559
# Clean build artifacts
5660
photon clean
5761

@@ -102,6 +106,10 @@ photon build snapshot
102106
## Workflow Example
103107

104108
```bash
109+
# 0. Check system requirements first
110+
cd /path/to/Noviq/photon
111+
./target/release/photon check
112+
105113
# 1. Make changes to Noviq source code
106114
cd /path/to/Noviq
107115

@@ -132,8 +140,20 @@ Examples:
132140

133141
## Requirements
134142

135-
- Rust toolchain (for building Photon)
136-
- Git (for snapshot builds with commit hash)
143+
Photon automatically checks for the following requirements before building:
144+
145+
- **Rust 1.70.0+** - For compiling Noviq (checked automatically)
146+
- **Cargo** - Rust's package manager (comes with Rust)
147+
- **Git** - For snapshot builds with commit hash
148+
- **LLVM** (optional) - For future JIT support
149+
150+
You can verify your system meets these requirements by running:
151+
152+
```bash
153+
photon check
154+
```
155+
156+
If any requirements are missing, Photon will provide installation links and instructions.
137157

138158
## Integration with Cargo Workspace
139159

photon/SCOPE.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,20 @@ Transform Photon from a simple build script replacement into a comprehensive dev
1111
- Binary installation to libs/
1212
- Git integration for version tracking
1313
- Clean build artifacts
14+
- System requirements verification ✓
1415

1516
## Planned Features
1617

1718
### Phase 1: Enhanced Build System (v0.2.0)
1819

1920
#### Dependency Management
20-
- **System Requirements Check**
21+
- **System Requirements Check** (COMPLETED v0.1.1)
2122
- Verify Rust toolchain version
2223
- Check Git availability
2324
- Validate required system libraries
2425
- Display helpful error messages with installation links
26+
- Automatic verification before builds
27+
- Manual check via `photon check` command
2528

2629
- **Build Caching**
2730
- Track source file changes

photon/src/main.rs

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ use std::path::Path;
77
use std::process::{Command, exit};
88
use std::fs;
99

10+
mod system_check;
11+
1012
fn main() {
1113
print_banner();
1214

@@ -26,6 +28,7 @@ fn main() {
2628
}
2729
"clean" => clean_build(),
2830
"install" => install_noviq(),
31+
"check" => check_system(),
2932
"help" | "--help" | "-h" => print_help(),
3033
"version" | "--version" | "-v" => print_version(),
3134
_ => {
@@ -37,16 +40,21 @@ fn main() {
3740
}
3841

3942
fn print_banner() {
43+
let version = env!("CARGO_PKG_VERSION");
4044
println!("╔═══════════════════════════════════════╗");
4145
println!("║ Photon Build Tool ║");
42-
println!("║ Noviq Programming Language v0.1 ║");
46+
println!("║ Noviq Programming Language v{} ║", version);
4347
println!("╚═══════════════════════════════════════╝");
4448
println!();
4549
}
4650

4751
fn print_version() {
48-
println!("Photon v0.1.0");
49-
println!("Build tool for Noviq Programming Language");
52+
let version = env!("CARGO_PKG_VERSION");
53+
let name = env!("CARGO_PKG_NAME");
54+
let description = env!("CARGO_PKG_DESCRIPTION");
55+
56+
println!("{} v{}", name.chars().next().unwrap().to_uppercase().to_string() + &name[1..], version);
57+
println!("{}", description);
5058
}
5159

5260
fn print_help() {
@@ -60,6 +68,7 @@ fn print_help() {
6068
println!();
6169
println!(" clean Clean build artifacts");
6270
println!(" install Install built binary to libs/");
71+
println!(" check Check system requirements");
6372
println!(" help Show this help message");
6473
println!(" version Show version information");
6574
println!();
@@ -69,6 +78,7 @@ fn print_help() {
6978
println!(" photon build snapshot # Snapshot build with git hash");
7079
println!(" photon clean # Clean build directory");
7180
println!(" photon install # Install to libs/");
81+
println!(" photon check # Verify system requirements");
7282
println!();
7383
println!("BUILD PROFILES:");
7484
println!(" debug - Unoptimized with debug symbols");
@@ -82,6 +92,13 @@ fn print_help() {
8292
}
8393

8494
fn build_noviq(profile: &str) {
95+
// First, verify system requirements
96+
if !system_check::verify_system_requirements(false) {
97+
println!();
98+
system_check::verify_system_requirements(true);
99+
exit(1);
100+
}
101+
85102
println!("[*] Building Noviq ({} mode)...", profile);
86103
println!();
87104

@@ -256,3 +273,43 @@ fn install_noviq() {
256273
println!("[WARN] No binaries installed. Build Noviq first with 'photon build'");
257274
}
258275
}
276+
277+
fn check_system() {
278+
println!("[*] Verifying system requirements...");
279+
println!();
280+
281+
let results = system_check::run_all_checks();
282+
let mut all_critical_passed = true;
283+
284+
// Print results
285+
for result in &results {
286+
println!(" {}", result);
287+
288+
// Only Rust, Cargo, and Git are critical
289+
if !result.passed && result.name != "LLVM" {
290+
all_critical_passed = false;
291+
}
292+
}
293+
294+
println!();
295+
296+
if all_critical_passed {
297+
println!("[✓] All system requirements satisfied!");
298+
println!(" You're ready to build Noviq!");
299+
} else {
300+
println!("[✗] Some critical requirements are missing!");
301+
println!();
302+
println!("Please install the missing components:");
303+
304+
for result in &results {
305+
if !result.passed && result.name != "LLVM" {
306+
println!(" • {} - {}", result.name, result.message);
307+
}
308+
}
309+
310+
println!();
311+
println!("Quick Install Guide:");
312+
println!(" Rust & Cargo: https://rustup.rs");
313+
println!(" Git: https://git-scm.com/downloads");
314+
}
315+
}

0 commit comments

Comments
 (0)