Skip to content
Open
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: 4 additions & 0 deletions pantor/ruckig/Ruckig_cmp.gox
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
compareVer (a, b) => {
// ruckig publishes semver tags like "v0.17.3".
return semver.compare(a.Version, b.Version)
}
88 changes: 88 additions & 0 deletions pantor/ruckig/v0.17.3/Ruckig_llar.gox
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import "os"

id "pantor/ruckig"

fromVer "v0.17.3"

onBuild ctx => {
installDir := ctx.outputDir

c := cmake.new(ctx.SourceDir, ctx.SourceDir+"/_build", installDir)
c.buildType "Release"

// ruckig is a C++20 CMake library. Build only the core static library:
// disable the examples, unit tests, the nanobind Python wrapper and the
// (network) cloud client, matching the community package interface. The
// cloud client would otherwise inject vendored third_party headers and a
// WITH_CLOUD_CLIENT define that are not part of the core install.
c.defineBool "BUILD_SHARED_LIBS", false
c.defineBool "CMAKE_POSITION_INDEPENDENT_CODE", true
c.defineBool "BUILD_EXAMPLES", false
c.defineBool "BUILD_TESTS", false
c.defineBool "BUILD_PYTHON_MODULE", false
c.defineBool "BUILD_CLOUD_CLIENT", false

c.configure
c.build
c.install

// Consumers link the installed "ruckig" library (target ruckig::ruckig).
ctx.setMetadata "-lruckig"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The metadata is a bare -lruckig, which omits the install-directory search paths. Upstream installs headers to include/ruckig and the archive to lib/, so a consumer given only -lruckig has no -I<installDir>/include or -L<installDir>/lib and cannot locate <ruckig/ruckig.hpp> or the archive. The spec's Metadata section says to include install-directory paths when consumers need them.

This gap is not caught by onTest: the consumer there uses find_package(ruckig REQUIRED CONFIG) via tc.use installDir (CMAKE_PREFIX_PATH), so it never exercises the metadata string.

Also note the comment on the line above describes the CMake target (ruckig::ruckig), but the metadata emitted is a raw linker flag — different consumer contracts. Consider deriving the metadata from the installed CMake config (or otherwise including -I/-L paths) so raw-metadata consumers can compile and link.

}

onTest ctx => {
installDir := ctx.outputDir

// Keep the consumer build in its own tree so onTest behaves identically
// on a cache hit (onBuild skipped, no _build dir) and a cache miss.
testDir := ctx.SourceDir + "/_testconsumer"
testBuild := testDir + "/_build"

os.mkdirAll(testDir, 0o755)!

// Consumer mirrors the Conan test_package: a single-DoF trajectory update.
cpp := `#include <cstdio>
#include <ruckig/ruckig.hpp>

int main() {
using namespace ruckig;

Ruckig<1> otg(0.01);
InputParameter<1> input;
OutputParameter<1> output;

input.target_position = {1.0};
input.max_velocity = {1.0};
input.max_acceleration = {1.0};
input.max_jerk = {1.0};

auto result = otg.update(input, output);
printf("Ruckig update result: %d\n", static_cast<int>(result));
return 0;
}
`
os.writeFile(testDir+"/test_package.cpp", []byte(cpp), 0o644)!

cml := `cmake_minimum_required(VERSION 3.15)
project(ruckig_test_package LANGUAGES CXX)

find_package(ruckig REQUIRED CONFIG)

add_executable(test_package test_package.cpp)
target_link_libraries(test_package PRIVATE ruckig::ruckig)
`
os.writeFile(testDir+"/CMakeLists.txt", []byte(cml), 0o644)!

tc := cmake.new(testDir, testBuild, testBuild+"/_out")
tc.buildType "Release"
tc.use installDir

tc.configure
tc.build

// A non-zero exit surfaces via lastErr and fails the test.
exec testBuild + "/test_package"
if lastErr != nil {
panic lastErr
}
}
4 changes: 4 additions & 0 deletions pantor/ruckig/versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"path": "pantor/ruckig",
"deps": {}
}