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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/workflows/website-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
-DBLAZE_CODEGEN:BOOL=OFF
-DBLAZE_DOCUMENTATION:BOOL=OFF
-DBLAZE_EDITOR:BOOL=OFF
-DBLAZE_FOUNDATION:BOOL=OFF
-DBLAZE_TESTS:BOOL=OFF
-DBLAZE_DOCS:BOOL=ON
- run: cmake --build ./build --config Release --target doxygen
1 change: 1 addition & 0 deletions .github/workflows/website-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
-DBLAZE_CODEGEN:BOOL=OFF
-DBLAZE_DOCUMENTATION:BOOL=OFF
-DBLAZE_EDITOR:BOOL=OFF
-DBLAZE_FOUNDATION:BOOL=OFF
-DBLAZE_TESTS:BOOL=OFF
-DBLAZE_DOCS:BOOL=ON
- run: cmake --build ./build --config Release --target doxygen
Expand Down
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ option(BLAZE_ALTERSCHEMA "Build the Blaze alterschema rule library" ON)
option(BLAZE_CODEGEN "Build the Blaze codegen library" ON)
option(BLAZE_DOCUMENTATION "Build the Blaze documentation generator library" ON)
option(BLAZE_EDITOR "Build the Blaze editor schema compatibility library" ON)
option(BLAZE_FOUNDATION "Build the Blaze foundation JSON Schema library" ON)
option(BLAZE_TESTS "Build the Blaze tests" OFF)
option(BLAZE_BENCHMARK "Build the Blaze benchmarks" OFF)
option(BLAZE_CONTRIB "Build the Blaze contrib programs" OFF)
Expand Down Expand Up @@ -46,6 +47,10 @@ if(PROJECT_IS_TOP_LEVEL)
sourcemeta_enable_simd()
endif()

if(BLAZE_FOUNDATION)
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 21, 2026

Choose a reason for hiding this comment

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

BLAZE_FOUNDATION is optional here, but multiple enabled-by-default targets link sourcemeta::blaze::foundation unconditionally; setting it OFF without also disabling dependents will likely break CMake configuration. Consider enforcing/propagating this dependency so BLAZE_FOUNDATION=OFF cannot yield an invalid build configuration.

Severity: medium

Other Locations
  • benchmark/CMakeLists.txt:34
  • src/compiler/CMakeLists.txt:28
  • src/output/CMakeLists.txt:18
  • src/codegen/CMakeLists.txt:18

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

add_subdirectory(src/foundation)
endif()

if(BLAZE_COMPILER)
add_subdirectory(src/compiler)
endif()
Expand Down Expand Up @@ -128,6 +133,10 @@ endif()
if(BLAZE_TESTS)
enable_testing()

if(BLAZE_FOUNDATION)
add_subdirectory(test/foundation)
endif()

if(BLAZE_COMPILER)
add_subdirectory(test/compiler)
endif()
Expand Down
13 changes: 12 additions & 1 deletion DEPENDENCIES
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
vendorpull https://github.com/sourcemeta/vendorpull 1dcbac42809cf87cb5b045106b863e17ad84ba02
core https://github.com/sourcemeta/core 7b51d3cbb4e1ea56ddc910c0d315880113afd1cc
core https://github.com/sourcemeta/core 31404273bf927fc26457a1052b27b56519c0329c
jsonschema-test-suite https://github.com/json-schema-org/JSON-Schema-Test-Suite c7257e92580678a086f0b9243a1903ed88bd27f7
jsonschema-2020-12 https://github.com/json-schema-org/json-schema-spec 769daad75a9553562333a8937a187741cb708c72
jsonschema-2019-09 https://github.com/json-schema-org/json-schema-spec 41014ea723120ce70b314d72f863c6929d9f3cfd
jsonschema-draft7 https://github.com/json-schema-org/json-schema-spec 567f768506aaa33a38e552c85bf0586029ef1b32
jsonschema-draft6 https://github.com/json-schema-org/json-schema-spec 59ed5f6fc6f6386e23ca51d7f31d7fe9cf696713
jsonschema-draft4 https://github.com/json-schema-org/json-schema-spec 955d185db846cfca84269d9d711b10f4f3353d38
jsonschema-draft3 https://github.com/json-schema-org/json-schema-spec 89912ad69fe15e006e8336a59e93bf7a1e46fa54
jsonschema-draft2 https://github.com/json-schema-org/json-schema-spec 707f65070d09fe5baa1315bce4d31a66ff124171
jsonschema-draft1 https://github.com/json-schema-org/json-schema-spec 2072feec9fc7a7ff0b2bb5b02c2d6742c554cc4a
jsonschema-draft0 https://github.com/json-schema-org/json-schema-spec 7ea575aef8d5c0183acbe6ff65b4c98ee9c236ec
openapi https://github.com/OAI/OpenAPI-Specification 74906beddddab9e555337031b2a8d8e9338c4972
referencing-suite https://github.com/python-jsonschema/referencing-suite 61c4cc202b1e96ed5adcaf4842a595f68d659212
10 changes: 9 additions & 1 deletion benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
set(BENCHMARK_SOURCES)

if(BLAZE_FOUNDATION)
list(APPEND BENCHMARK_SOURCES foundation.cc)
endif()

if(BLAZE_COMPILER AND BLAZE_EVALUATOR AND BLAZE_OUTPUT)
list(APPEND BENCHMARK_SOURCES
e2e/runner.cc
Expand Down Expand Up @@ -27,7 +31,7 @@ if(BENCHMARK_SOURCES)
target_link_libraries(sourcemeta_blaze_benchmark
PRIVATE sourcemeta::core::jsonl)
target_link_libraries(sourcemeta_blaze_benchmark
PRIVATE sourcemeta::core::jsonschema)
PRIVATE sourcemeta::blaze::foundation)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P0: The replacement link of sourcemeta::blaze::foundation is not guarded by if(BLAZE_FOUNDATION), but the target only exists when that option is enabled. This will cause a CMake configuration failure when BLAZE_FOUNDATION is OFF, and a duplicate link when it is ON. The link should be conditionally guarded, and the redundant second conditional block should be removed.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At benchmark/CMakeLists.txt, line 34:

<comment>The replacement link of `sourcemeta::blaze::foundation` is not guarded by `if(BLAZE_FOUNDATION)`, but the target only exists when that option is enabled. This will cause a CMake configuration failure when BLAZE_FOUNDATION is OFF, and a duplicate link when it is ON. The link should be conditionally guarded, and the redundant second conditional block should be removed.</comment>

<file context>
@@ -27,7 +31,7 @@ if(BENCHMARK_SOURCES)
     PRIVATE sourcemeta::core::jsonl)
   target_link_libraries(sourcemeta_blaze_benchmark
-    PRIVATE sourcemeta::core::jsonschema)
+    PRIVATE sourcemeta::blaze::foundation)
 
   if(BLAZE_COMPILER)
</file context>


if(BLAZE_COMPILER)
target_link_libraries(sourcemeta_blaze_benchmark
Expand All @@ -45,6 +49,10 @@ if(BENCHMARK_SOURCES)
target_link_libraries(sourcemeta_blaze_benchmark
PRIVATE sourcemeta::blaze::alterschema)
endif()
if(BLAZE_FOUNDATION)
target_link_libraries(sourcemeta_blaze_benchmark
PRIVATE sourcemeta::blaze::foundation)
endif()

add_custom_target(benchmark_all
COMMAND sourcemeta_blaze_benchmark
Expand Down
22 changes: 11 additions & 11 deletions benchmark/alterschema.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

#include <sourcemeta/blaze/alterschema.h>
#include <sourcemeta/blaze/compiler.h>
#include <sourcemeta/blaze/foundation.h>
#include <sourcemeta/core/json.h>
#include <sourcemeta/core/jsonschema.h>

static void
Alterschema_Check_Readibility_ISO_Language_Set_3(benchmark::State &state) {
Expand All @@ -19,8 +19,8 @@ Alterschema_Check_Readibility_ISO_Language_Set_3(benchmark::State &state) {
sourcemeta::blaze::add(bundle, sourcemeta::blaze::AlterSchemaMode::Linter);

for (auto _ : state) {
auto result = bundle.check(schema, sourcemeta::core::schema_walker,
sourcemeta::core::schema_resolver,
auto result = bundle.check(schema, sourcemeta::blaze::schema_walker,
sourcemeta::blaze::schema_resolver,
[](const auto &, const auto &, const auto &,
const auto &, const auto &) {});
assert(result.first);
Expand All @@ -38,8 +38,8 @@ static void Alterschema_Check_Readibility_OMC(benchmark::State &state) {
sourcemeta::blaze::add(bundle, sourcemeta::blaze::AlterSchemaMode::Linter);

for (auto _ : state) {
auto result = bundle.check(schema, sourcemeta::core::schema_walker,
sourcemeta::core::schema_resolver,
auto result = bundle.check(schema, sourcemeta::blaze::schema_walker,
sourcemeta::blaze::schema_resolver,
[](const auto &, const auto &, const auto &,
const auto &, const auto &) {});
assert(!result.first);
Expand All @@ -56,8 +56,8 @@ static void Alterschema_Check_Readibility_KrakenD(benchmark::State &state) {
sourcemeta::blaze::add(bundle, sourcemeta::blaze::AlterSchemaMode::Linter);

for (auto _ : state) {
auto result{bundle.check(schema, sourcemeta::core::schema_walker,
sourcemeta::core::schema_resolver,
auto result{bundle.check(schema, sourcemeta::blaze::schema_walker,
sourcemeta::blaze::schema_resolver,
[](const auto &, const auto &, const auto &,
const auto &, const auto &) {})};
benchmark::DoNotOptimize(result);
Expand All @@ -76,8 +76,8 @@ static void Alterschema_Apply_Readibility_KrakenD(benchmark::State &state) {
state.PauseTiming();
auto copy = schema;
state.ResumeTiming();
auto result = bundle.apply(copy, sourcemeta::core::schema_walker,
sourcemeta::core::schema_resolver,
auto result = bundle.apply(copy, sourcemeta::blaze::schema_walker,
sourcemeta::blaze::schema_resolver,
[](const auto &, const auto &, const auto &,
const auto &, const auto &) {});
assert(!result.first);
Expand All @@ -96,8 +96,8 @@ static void Alterschema_Check_Invalid_External_Refs(benchmark::State &state) {
for (auto _ : state) {
std::size_t trace_count{0};
auto result = bundle.check(
schema, sourcemeta::core::schema_walker,
sourcemeta::core::schema_resolver,
schema, sourcemeta::blaze::schema_walker,
sourcemeta::blaze::schema_resolver,
[&trace_count](const auto &, [[maybe_unused]] const auto &name,
const auto &, const auto &, const auto &) {
assert(name == "invalid_external_ref");
Expand Down
10 changes: 5 additions & 5 deletions benchmark/e2e/runner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
#include <filesystem> // std::filesystem
#include <vector> // std::vector

#include <sourcemeta/blaze/foundation.h>
#include <sourcemeta/core/io.h>
#include <sourcemeta/core/json.h>
#include <sourcemeta/core/jsonl.h>
#include <sourcemeta/core/jsonschema.h>

#include <sourcemeta/blaze/compiler.h>
#include <sourcemeta/blaze/evaluator.h>
Expand All @@ -20,8 +20,8 @@
\
for (auto _ : state) { \
auto schema_template{sourcemeta::blaze::compile( \
schema, sourcemeta::core::schema_walker, \
sourcemeta::core::schema_resolver, \
schema, sourcemeta::blaze::schema_walker, \
sourcemeta::blaze::schema_resolver, \
sourcemeta::blaze::default_schema_compiler, \
sourcemeta::blaze::Mode::FastValidation)}; \
benchmark::DoNotOptimize(schema_template); \
Expand All @@ -35,8 +35,8 @@
"/e2e/" directory_name}; \
const auto schema{sourcemeta::core::read_json(directory / "schema.json")}; \
const auto schema_template{ \
sourcemeta::blaze::compile(schema, sourcemeta::core::schema_walker, \
sourcemeta::core::schema_resolver, \
sourcemeta::blaze::compile(schema, sourcemeta::blaze::schema_walker, \
sourcemeta::blaze::schema_resolver, \
sourcemeta::blaze::default_schema_compiler, \
sourcemeta::blaze::Mode::FastValidation)}; \
\
Expand Down
Loading
Loading