diff --git a/CLAUDE.md b/CLAUDE.md index 49e04875d..539efcbe2 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -81,6 +81,19 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co - **S3 Storage Integration**: Compilation results include an `s3Key` property containing the cache key hash for S3 storage reference. Large results (>31KiB) can be stored in S3 and referenced by this key. The s3Key is removed from API responses before sending to users. - **Metrics & Statistics**: SQS workers track separate Prometheus metrics (`ce_sqs_compilations_total`, `ce_sqs_executions_total`, `ce_sqs_cmake_compilations_total`, `ce_sqs_cmake_executions_total`) and record compilation statistics via `statsNoter.noteCompilation` for Grafana monitoring, mirroring the regular API route behavior. +## CE Properties Wizard +- **Location**: `/etc/scripts/ce-properties-wizard/` - Interactive tool for adding compilers to local CE installations +- **Usage**: Run via `./run.sh` (Linux/macOS) or `.\run.ps1` (Windows) with optional compiler path and flags +- **Auto-Detection**: Automatically detects compiler type, language, version, and configuration from executable paths +- **MSVC Auto-Configuration**: Enhanced support for Microsoft Visual C++ compilers: + - **Demangler**: Automatically detects and configures `undname.exe` with `demanglerType=win32` + - **Objdumper**: Auto-detects LLVM objdump (`llvm-objdump.exe`) and configures `objdumperType=llvm` when available + - **SDK Integration**: Supports Windows SDK path specification via `--sdk-path` for non-interactive use + - **Architecture Matching**: Correctly maps compiler architecture (x64, x86, arm64) to tool paths +- **Group Management**: Automatically creates and manages compiler groups with appropriate properties +- **Validation**: Integrates with `propscheck.py` and discovery validation to ensure configurations work +- **Safe Operations**: Creates backups and preserves existing configurations, only adding new content + ## Testing Guidelines - Use Vitest for unit tests (compatible with Jest syntax) - Tests are in the `/test` directory, typically named like the source files they test diff --git a/etc/scripts/ce-properties-wizard/README.md b/etc/scripts/ce-properties-wizard/README.md index ef1322b58..cca178d26 100644 --- a/etc/scripts/ce-properties-wizard/README.md +++ b/etc/scripts/ce-properties-wizard/README.md @@ -128,6 +128,7 @@ Get-ChildItem "C:\Compilers\*\bin\*.exe" | ForEach-Object { - `--reorganize LANGUAGE`: Reorganize an existing properties file for the specified language - `--validate-discovery`: Run discovery validation to verify the compiler is detected (default for local environment) - `--env ENV`: Environment to target (local, amazon, etc.) - defaults to 'local' +- `--sdk-path`: Windows SDK base path for MSVC compilers (e.g., D:/efs/compilers/windows-kits-10) ## Supported Languages @@ -172,6 +173,44 @@ The wizard attempts to detect compiler type by running version commands: If detection fails, you can manually specify the compiler type. +## MSVC Auto-Configuration + +When adding MSVC compilers, the wizard automatically configures additional tools: + +### Demangler Configuration +- **Automatic Detection**: Detects `undname.exe` from the MSVC installation path +- **Architecture Matching**: Uses the same architecture as the compiler (x64, x86, arm64) +- **Auto-Configuration**: Sets `demanglerType=win32` and `demangler=` + +### Objdumper Configuration +- **LLVM Detection**: Automatically detects `llvm-objdump.exe` if available in the MSVC installation +- **Conditional Setup**: Only adds objdumper configuration when `llvm-objdump.exe` is found +- **Auto-Configuration**: Sets `objdumperType=llvm` and `objdumper=` + +### Windows SDK Integration +- **Interactive Prompt**: Prompts for Windows SDK path if auto-detection fails +- **Command-Line Option**: Use `--sdk-path` to specify SDK path non-interactively +- **Include/Library Paths**: Automatically configures MSVC include and library paths + +### Example MSVC Usage + +**Windows (Interactive):** +```powershell +.\run.ps1 "D:\efs\compilers\msvc-2022-ce\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64\cl.exe" +``` + +**Windows (Non-Interactive):** +```powershell +.\run.ps1 "D:\efs\compilers\msvc-2022-ce\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64\cl.exe" ` + --sdk-path "D:\efs\compilers\windows-kits-10" ` + --non-interactive +``` + +The wizard will automatically configure: +- Demangler: `D:/efs/compilers/msvc-2022-ce/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/undname.exe` +- Objdumper: `D:/efs/compilers/msvc-2022-ce/VC/Tools/Llvm/x64/bin/llvm-objdump.exe` (if available) +- Windows SDK include and library paths + ## Configuration Files The wizard modifies `.local.properties` files in `etc/config/`. It: diff --git a/etc/scripts/ce-properties-wizard/ce_properties_wizard/main.py b/etc/scripts/ce-properties-wizard/ce_properties_wizard/main.py index 5d479fd14..92c787887 100644 --- a/etc/scripts/ce-properties-wizard/ce_properties_wizard/main.py +++ b/etc/scripts/ce-properties-wizard/ce_properties_wizard/main.py @@ -121,6 +121,10 @@ def cli( ce-props-wizard --env amazon /usr/bin/g++ # Target amazon environment ce-props-wizard --list-types # List all supported compiler types ce-props-wizard /usr/bin/g++ --verify-only # Just detect compiler info + + MSVC Examples: + ce-props-wizard "D:/efs/compilers/msvc-2022/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe" + ce-props-wizard "C:/MSVC/cl.exe" --sdk-path "C:/WindowsKits/10" --non-interactive """ # Handle --list-types flag if list_types: