-
Notifications
You must be signed in to change notification settings - Fork 7
Upgrade Core and include Blaze #910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| vendorpull https://github.com/sourcemeta/vendorpull 1dcbac42809cf87cb5b045106b863e17ad84ba02 | ||
| core https://github.com/sourcemeta/core 57e8c91ed68e3ee903526fd2f45cb16ca46759d8 | ||
| core https://github.com/sourcemeta/core efaed8a73fa1ba38f0c2fdcbd11d0b3223c5a70e | ||
| blaze https://github.com/sourcemeta/blaze 0ff98cb5e537f571bdf04f0d59a031a0d8634e07 | ||
| bootstrap https://github.com/twbs/bootstrap 1a6fdfae6be09b09eaced8f0e442ca6f7680a61e |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| if(NOT Blaze_FOUND) | ||
| if(JSONBINPACK_INSTALL) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Set Otherwise vendored Blaze keeps its install rules enabled even when JSONBinPack installs are disabled. Prompt for AI agents |
||
| set(SOURCEMETA_BLAZE_INSTALL ON CACHE BOOL "enable installation") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Severity: low 🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage. |
||
| else() | ||
| set(SOURCEMETA_BLAZE_INSTALL OFF CACHE BOOL "disable installation") | ||
| endif() | ||
|
|
||
| set(BLAZE_TEST OFF CACHE BOOL "disable") | ||
| set(BLAZE_CONFIGURATION OFF CACHE BOOL "disable") | ||
| set(BLAZE_CONTRIB OFF CACHE BOOL "disable") | ||
| add_subdirectory("${PROJECT_SOURCE_DIR}/vendor/blaze") | ||
| include(Sourcemeta) | ||
| set(Blaze_FOUND ON) | ||
| endif() | ||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -10,7 +10,8 @@ if(NOT JSONBINPACK_COMPONENTS) | |||||||||||
| endif() | ||||||||||||
|
|
||||||||||||
| include(CMakeFindDependencyMacro) | ||||||||||||
| find_dependency(Core COMPONENTS regex uri json jsonpointer jsonschema alterschema) | ||||||||||||
| find_dependency(Core COMPONENTS regex uri json jsonpointer jsonschema) | ||||||||||||
| find_dependency(Blaze COMPONENTS alterschema) | ||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Make the Blaze dependency conditional on the compiler component; otherwise runtime/numeric-only consumers require an unnecessary package. Prompt for AI agents
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||
|
|
||||||||||||
| foreach(component ${JSONBINPACK_COMPONENTS}) | ||||||||||||
| if(component STREQUAL "numeric") | ||||||||||||
|
|
||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,19 @@ | ||
| #include <sourcemeta/jsonbinpack/compiler.h> | ||
| #include <sourcemeta/jsonbinpack/numeric.h> | ||
|
|
||
| #include <sourcemeta/core/alterschema.h> | ||
| #include <sourcemeta/blaze/alterschema.h> | ||
| #include <sourcemeta/core/jsonpointer.h> | ||
|
|
||
| #include "encoding.h" | ||
|
|
||
| #include <cassert> // assert | ||
| #include <type_traits> // std::true_type | ||
|
|
||
| static auto | ||
| transformer_callback_noop(const sourcemeta::core::Pointer &, | ||
| const std::string_view, const std::string_view, | ||
| const sourcemeta::core::SchemaTransformRule::Result &, | ||
| [[maybe_unused]] const bool applied) -> void { | ||
| static auto transformer_callback_noop( | ||
| const sourcemeta::core::Pointer &, const std::string_view, | ||
| const std::string_view, | ||
| const sourcemeta::blaze::SchemaTransformRule::Result &, | ||
| [[maybe_unused]] const bool applied) -> void { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Severity: medium 🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage. |
||
| assert(applied); | ||
| } | ||
|
|
||
|
|
@@ -23,9 +23,9 @@ auto canonicalize(sourcemeta::core::JSON &schema, | |
| const sourcemeta::core::SchemaWalker &walker, | ||
| const sourcemeta::core::SchemaResolver &resolver, | ||
| const std::string_view default_dialect) -> void { | ||
| sourcemeta::core::SchemaTransformer canonicalizer; | ||
| sourcemeta::core::add(canonicalizer, | ||
| sourcemeta::core::AlterSchemaMode::Canonicalizer); | ||
| sourcemeta::blaze::SchemaTransformer canonicalizer; | ||
| sourcemeta::blaze::add(canonicalizer, | ||
| sourcemeta::blaze::AlterSchemaMode::Canonicalizer); | ||
| [[maybe_unused]] const auto result = | ||
| canonicalizer.apply(schema, walker, make_resolver(resolver), | ||
| transformer_callback_noop, default_dialect); | ||
|
|
@@ -63,7 +63,7 @@ auto compile(sourcemeta::core::JSON &schema, | |
| const std::string_view default_dialect) -> void { | ||
| canonicalize(schema, walker, resolver, default_dialect); | ||
|
|
||
| sourcemeta::core::SchemaTransformer mapper; | ||
| sourcemeta::blaze::SchemaTransformer mapper; | ||
|
|
||
| // Enums | ||
| mapper.add<Enum8Bit>(); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CMakeLists.txt:21find_package(Blaze REQUIRED)is unconditional even thoughJSONBINPACK_COMPILERcan be turned OFF, so builds that only wantnumeric/runtimewill still require Blaze.Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.