Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
TKB_VCPKG_ROOT: ${{ github.workspace }}/vcpkg
RHODIUM_VCPKG_ROOT: ${{ github.workspace }}/vcpkg
run: bash scripts/build.sh

- name: Install package
Expand All @@ -111,7 +111,7 @@ jobs:
if: steps.install_package.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: tpkg-${{ matrix.slug }}-${{ matrix.build_type }}
name: rhodium-${{ matrix.slug }}-${{ matrix.build_type }}
path: ${{ env.INSTALL_DIR }}
if-no-files-found: error

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Local dependency/cache state
.rhodium/
.tpkg/
tpkg.lock.toml

Expand All @@ -13,6 +14,7 @@ cmake-build-*/
.idea/
.codegraph/
.clangd
.agents
compile_commands.json

# Local references and generated packages
Expand Down
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.25)

include(cmake/ToolkitPkgVcpkg.cmake)
include(cmake/RhodiumVcpkg.cmake)

project(ToolkitPkg VERSION 0.1.1 LANGUAGES C CXX)
project(Rhodium VERSION 0.1.2 LANGUAGES C CXX)

include(GNUInstallDirs)

Expand All @@ -14,11 +14,11 @@ if(MSVC)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()

include(cmake/ToolkitPkgMsvcNinjaSdk.cmake)
include(cmake/ToolkitPkgDependencies.cmake)
include(cmake/ToolkitPkgTargets.cmake)
include(cmake/RhodiumMsvcNinjaSdk.cmake)
include(cmake/RhodiumDependencies.cmake)
include(cmake/RhodiumTargets.cmake)

include(CTest)
if(BUILD_TESTING)
include(cmake/ToolkitPkgTests.cmake)
include(cmake/RhodiumTests.cmake)
endif()
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This document applies to project discussions, issues, pull requests, review comm
- Be direct and technical when reviewing code.
- Criticize behavior, design, and implementation details rather than people.
- Provide enough context for maintainers and contributors to reproduce problems.
- Respect project scope: Toolkit Package Manager is a dependency manager for CMake projects, not a general build-system replacement.
- Respect project scope: Rhodium is a dependency manager for CMake projects, not a general build-system replacement.

## Unacceptable behavior

Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Contributing to Toolkit Package Manager
# Contributing to Rhodium

Toolkit Package Manager is a C/C++ dependency manager for CMake projects. Contributions should preserve that scope.
Rhodium is a C/C++ dependency manager for CMake projects. Contributions should preserve that scope.

## Contribution rules

- Do not turn Toolkit Package Manager into a general-purpose build-system replacement.
- Do not turn Rhodium into a general-purpose build-system replacement.
- Do not change CLI behavior, DSL fields, lockfile format, artifact IDs, or cache layout unless the change is explicitly planned.
- Prefer small, staged changes over broad rewrites.
- Keep `model/` as plain data and validation logic. Do not move I/O, resolver, builder, or CLI behavior into model structures.
Expand Down
4 changes: 2 additions & 2 deletions MAINTENANCE_REFACTOR_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This snapshot performs the low-risk maintenance preparation work and packages th

## Completed in this snapshot

- Added root `README.md` with corrected project positioning: Toolkit Package Manager is a dependency manager for CMake projects, not a general build system.
- Added root `README.md` with corrected project positioning: Rhodium is a dependency manager for CMake projects, not a general build system.
- Added standard project files:
- `CONTRIBUTING.md`
- `CODE_OF_CONDUCT.md`
Expand All @@ -19,7 +19,7 @@ This snapshot performs the low-risk maintenance preparation work and packages th
- `AGENTS.md`
- Removed stale/incomplete refactor artifacts from the implementation tree.
- Fixed `.gitignore` formatting and expanded local/generated ignores.
- Reworked `cmake/ToolkitPkgTargets.cmake` to collect source files by module groups instead of one repository-wide source glob.
- Reworked `cmake/RhodiumTargets.cmake` to collect source files by module groups instead of one repository-wide source glob.
- Added documentation structure under `docs/`:
- user guides
- DSL guides
Expand Down
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Toolkit Package Manager
# Rhodium

Toolkit Package Manager is a cross-platform C/C++ dependency management system designed to serve CMake projects.
Repository: https://github.com/AxlumLab/Rhodium.git

Rhodium is a cross-platform C/C++ dependency management system designed to serve CMake projects.

It is **not** a replacement for CMake, Ninja, Visual Studio, Xcode, or any native build backend. Its job is to restore source, archive, local, or prebuilt dependencies; build dependency artifacts when needed; write a lock file for reproducibility; and generate CMake integration files that your normal CMake project can consume.

The executable is `rhodium` (`rhodium.exe` on Windows). Rhodium reads `rhodium.lua` first and falls back to `tpkg.lua`. State uses an existing `.rhodium/` first, otherwise an existing `.tpkg/`, otherwise a new `.rhodium/`. Lockfiles remain `tpkg.lock.toml`. Generated CMake packages and imported targets use `rhodium` and `rhodium::`.

## Project status

Toolkit Package Manager is under active development.
Rhodium is under active development.

Current validation scope:

Expand All @@ -20,26 +24,26 @@ Current validation scope:

```bash
# Check the local environment
tpkg doctor
rhodium doctor

# Detect local C/C++ and platform toolchains
tpkg sdk detect
tpkg sdk list
rhodium sdk detect
rhodium sdk list

# Restore dependency sources and artifacts
tpkg restore --config debug --toolchain windows-msvc-x64
rhodium restore --config debug --toolchain windows-msvc-x64

# Generate CMake integration files
tpkg generate --config debug --toolchain windows-msvc-x64
rhodium generate --config debug --toolchain windows-msvc-x64
```

A normal project keeps using CMake:

```cmake
include("${CMAKE_SOURCE_DIR}/.tpkg/generated/cmake/tpkg_deps.cmake")
include("${CMAKE_SOURCE_DIR}/.rhodium/generated/cmake/rhodiumConfig.cmake")
```

## Minimal `tpkg.deps.lua`
## Minimal `rhodium.lua`

```lua
package("ExampleApp")
Expand Down Expand Up @@ -80,7 +84,7 @@ Start here:
## Repository layout

```text
src/tpkg/ Toolkit Package Manager implementation
src/rhodium/ Rhodium implementation
cmake/ CMake project glue
docs/ User, reference, architecture, and contributor docs
examples/ Example dependency manifests and project layouts
Expand Down
6 changes: 3 additions & 3 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Security Policy

Toolkit Package Manager downloads, unpacks, patches, builds, and exposes third-party dependency artifacts. Treat dependency manifests and lock files as security-sensitive project inputs.
Rhodium downloads, unpacks, patches, builds, and exposes third-party dependency artifacts. Treat dependency manifests and lock files as security-sensitive project inputs.

## Supported versions

Expand All @@ -13,7 +13,7 @@ Report security issues privately to the project maintainer before opening a publ
Include:

- Affected command or workflow.
- Minimal `tpkg.lua` reproduction.
- Minimal `rhodium.lua` reproduction.
- Platform and toolchain profile.
- Whether the issue involves source fetching, archive extraction, patch application, command execution, generated CMake files, or lockfile behavior.

Expand All @@ -29,4 +29,4 @@ Include:

## Manifest trust model

`tpkg.lua` is executable Lua configuration. Do not run manifests from untrusted repositories without review.
`rhodium.lua` is executable Lua configuration. Do not run manifests from untrusted repositories without review.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ endif()
find_package(zstd CONFIG REQUIRED)
find_package(LibArchive REQUIRED)

function(tpkg_link_core_dependencies target_name)
function(rhodium_link_core_dependencies target_name)
target_link_libraries(${target_name} PUBLIC
sol2::sol2
CLI11::CLI11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ if(NOT MSVC)
return()
endif()

function(_tpkg_first_existing out_var)
function(_rhodium_first_existing out_var)
foreach(_candidate IN LISTS ARGN)
if(EXISTS "${_candidate}")
set(${out_var} "${_candidate}" PARENT_SCOPE)
Expand All @@ -12,7 +12,7 @@ function(_tpkg_first_existing out_var)
set(${out_var} "" PARENT_SCOPE)
endfunction()

function(_tpkg_latest_child out_var parent)
function(_rhodium_latest_child out_var parent)
if(NOT EXISTS "${parent}")
set(${out_var} "" PARENT_SCOPE)
return()
Expand All @@ -29,7 +29,7 @@ function(_tpkg_latest_child out_var parent)
set(${out_var} "" PARENT_SCOPE)
endfunction()

function(_tpkg_msvc_host_arch out_var)
function(_rhodium_msvc_host_arch out_var)
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" _processor)
if(_processor MATCHES "arm64|aarch64")
set(${out_var} "arm64" PARENT_SCOPE)
Expand All @@ -40,7 +40,7 @@ function(_tpkg_msvc_host_arch out_var)
endif()
endfunction()

function(_tpkg_enable_msvc_ninja_sdk_paths)
function(_rhodium_enable_msvc_ninja_sdk_paths)
cmake_path(CONVERT "${CMAKE_CXX_COMPILER}" TO_CMAKE_PATH_LIST _compiler)
if(NOT _compiler MATCHES "/VC/Tools/MSVC/[^/]+/bin/Host[^/]+/[^/]+/cl(\\.exe)?$")
return()
Expand All @@ -51,17 +51,17 @@ function(_tpkg_enable_msvc_ninja_sdk_paths)
return()
endif()

_tpkg_first_existing(_kits_root
_rhodium_first_existing(_kits_root
"C:/Windows Kits/10"
"C:/Program Files (x86)/Windows Kits/10"
"C:/Program Files/Windows Kits/10"
)
_tpkg_latest_child(_kits_version_root "${_kits_root}/Include")
_rhodium_latest_child(_kits_version_root "${_kits_root}/Include")
if(_kits_version_root)
get_filename_component(_kits_version "${_kits_version_root}" NAME)
endif()

_tpkg_msvc_host_arch(_arch)
_rhodium_msvc_host_arch(_arch)

set(_include_dirs
"${_vc_tools_root}/include"
Expand All @@ -86,10 +86,10 @@ function(_tpkg_enable_msvc_ninja_sdk_paths)
include_directories(BEFORE SYSTEM ${_include_dirs})
link_directories(${_lib_dirs})

message(STATUS "Toolkit Package Manager: added MSVC SDK include paths for Ninja from ${_vc_tools_root}")
message(STATUS "Rhodium: added MSVC SDK include paths for Ninja from ${_vc_tools_root}")
if(_kits_version)
message(STATUS "Toolkit Package Manager: added Windows SDK ${_kits_version} paths from ${_kits_root}")
message(STATUS "Rhodium: added Windows SDK ${_kits_version} paths from ${_kits_root}")
endif()
endfunction()

_tpkg_enable_msvc_ninja_sdk_paths()
_rhodium_enable_msvc_ninja_sdk_paths()
71 changes: 71 additions & 0 deletions cmake/RhodiumTargets.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
file(GLOB RHODIUM_CLI_SOURCES CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/src/rhodium/cli/*.cpp"
)
file(GLOB RHODIUM_CMAKE_SOURCES CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/src/rhodium/cmake/*.cpp"
)
file(GLOB RHODIUM_CONFIG_SOURCES CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/src/rhodium/config/*.cpp"
)
file(GLOB RHODIUM_CORE_MODULE_SOURCES CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/src/rhodium/core/*.cpp"
)
file(GLOB RHODIUM_DIAGNOSTICS_SOURCES CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/src/rhodium/diagnostics/*.cpp"
)
file(GLOB RHODIUM_MODEL_SOURCES CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/src/rhodium/model/*.cpp"
)
file(GLOB RHODIUM_PACKAGE_SOURCES CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/src/rhodium/package/*.cpp"
)
file(GLOB RHODIUM_RESOLVE_SOURCES CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/src/rhodium/resolve/*.cpp"
)
file(GLOB RHODIUM_SCRIPT_SOURCES CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/src/rhodium/script/*.cpp"
)
file(GLOB RHODIUM_TOOLCHAIN_SOURCES CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/src/rhodium/toolchain/*.cpp"
)
file(GLOB RHODIUM_UTILS_SOURCES CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/src/rhodium/utils/*.cpp"
)

set(RHODIUM_CORE_SOURCES
${RHODIUM_CLI_SOURCES}
${RHODIUM_CMAKE_SOURCES}
${RHODIUM_CONFIG_SOURCES}
${RHODIUM_CORE_MODULE_SOURCES}
${RHODIUM_DIAGNOSTICS_SOURCES}
${RHODIUM_MODEL_SOURCES}
${RHODIUM_PACKAGE_SOURCES}
${RHODIUM_RESOLVE_SOURCES}
${RHODIUM_SCRIPT_SOURCES}
${RHODIUM_TOOLCHAIN_SOURCES}
${RHODIUM_UTILS_SOURCES}
)

add_library(rhodium_core STATIC ${RHODIUM_CORE_SOURCES})
target_include_directories(rhodium_core PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/src")
target_compile_definitions(rhodium_core PUBLIC RHODIUM_VERSION=\"${PROJECT_VERSION}\")
rhodium_link_core_dependencies(rhodium_core)

if(MSVC)
target_compile_options(rhodium_core PRIVATE /utf-8 /W4 /permissive-)
else()
target_compile_options(rhodium_core PRIVATE -Wall -Wextra -Wpedantic)
endif()

add_executable(rhodium "${CMAKE_CURRENT_SOURCE_DIR}/src/rhodium/main.cpp")
target_link_libraries(rhodium PRIVATE rhodium_core)
set_target_properties(rhodium PROPERTIES OUTPUT_NAME rhodium)

install(TARGETS rhodium
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
)

source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/src" FILES
"${CMAKE_CURRENT_SOURCE_DIR}/src/rhodium/main.cpp"
${RHODIUM_CORE_SOURCES}
)
22 changes: 22 additions & 0 deletions cmake/RhodiumTests.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
find_package(GTest CONFIG REQUIRED)

set(RHODIUM_TEST_SOURCES
tests/rhodium/BuildModelTests.cpp
tests/rhodium/WorkspaceCompatibilityTests.cpp
tests/rhodium/ArchiveTests.cpp
tests/rhodium/CMakeDependencyExporterTests.cpp
tests/rhodium/DependencyResolverTests.cpp
tests/rhodium/LuaDslTests.cpp
tests/rhodium/LockFileTests.cpp
tests/rhodium/PackageArtifactResolverTests.cpp
tests/rhodium/PackageBuilderUtilTests.cpp
tests/rhodium/ToolchainTests.cpp
)

add_executable(rhodium_tests ${RHODIUM_TEST_SOURCES})
target_link_libraries(rhodium_tests PRIVATE rhodium_core GTest::gtest GTest::gtest_main)

include(GoogleTest)
gtest_discover_tests(rhodium_tests)

source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/tests" PREFIX tests FILES ${RHODIUM_TEST_SOURCES})
Loading
Loading