Skip to content

[pull] master from jbeder:master#84

Open
pull[bot] wants to merge 171 commits into
bazelregistry:masterfrom
jbeder:master
Open

[pull] master from jbeder:master#84
pull[bot] wants to merge 171 commits into
bazelregistry:masterfrom
jbeder:master

Conversation

@pull

@pull pull Bot commented Dec 15, 2021

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

Add copying of shared library to the output directory with a test binary.

[binary] removed using of non unsigned char as argument at
'std::isspace' function that was provokes undefined behavior.

[.github/workflows/build.yml] enabled run of test at the
'windows-latest' environment.
@pull pull Bot added the ⤵️ pull label Dec 15, 2021
dota17 and others added 28 commits January 5, 2022 18:12
Also refactor the build action to use a matrix.
Complies with YAML Standard [5.4](https://yaml.org/spec/1.2.2/#54-line-break-characters) [25] instead of matching `\r` only in combination with `\n`.
After configuring the file `yaml-cpp-config.cmake.in`, the result ends up with
empty variables.  (see also the discussion in #774).

Rework this file and the call to `configure_package_config_file` according the
cmake documentation
(https://cmake.org/cmake/help/v3.22/module/CMakePackageConfigHelpers.html?highlight=configure_package_config#command:configure_package_config_file)
to overcome this issue and allow a simple `find_package` after install.

As there was some discussion about the place where to install the
`yaml-cpp-config.cmake` file, e.g. #1055, factor out the install location into
an extra variable to make it easier changing this location in the future.

Also untabify CMakeLists.txt in some places to align with the other code parts in this file.
…endencies also. (#1039)

The option `YAML_CPP_BUILD_TESTS` currently enables or disables building of tests; but unconditionally the CMake file includes CTest; this PR makes that conditional on the option.

Also, there is no option for enabling formatting, but it does check whether it can find the `clang-format` executable; this PR adds an option (default to true) that skips even looking for the executable if disabled.
Changes YAML_CPP_INSTALL from a cmake_dependent_option to an option.

Fixes #756, #847, and #1011.
Windows builds need some defines being set to use the static linking.

Also add bazel builds and test to Github-CI.
On Oracle Solaris the following statement is declared in file /usr/include/sys/regset.h:
#define SS 18 /* only stored on a privilege transition */

Because of this template type name SS is substituted by numeric literal, which results in a compilation error:
error: expected nested-name-specifier before numeric constant

Fixed by renaming template type names.

Co-authored-by: Roman Degtyar <Roman.Degtyar@veeam.com>
Minimize warnings when not the top-level project

Should fix #970 and #764 when trying to add yaml-cpp to other project
Add definitions to static yaml-cpp target (fixes #1116)

Also updates CONTRIBUTING instructions for tests
This pull request adds two new exported variables to the CMake config:

YAML_CPP_LIBRARY_DIR - points to the directory containing the built library files
YAML_CPP_SHARED_LIBS_BUILT - boolean value, lets users know whether shared libraries were built or not
It secures the repo against erroneous or malicious actions from external jobs you call from your workflow. It's specially important for the case they get compromised, for example.
* Test(CMake) set NAME and COMMAND in add_test

* (CMake) add enable_testing()

* (CMake) move cmake_dependent_option up, before using them

* (CMake) use YAML_CPP_MAIN_PROJECT in cmake_dependent_option

* (CMake) log values regarding tests

* (CMake) always find CTest, but don't enable tests

* (CMAKE)(temp) fix logging

* (actions) set YAML_CPP_BUILD_TESTS for tests

* (actions) provide YAML_CPP_BUILD_TESTS to ctest

* (actions) set -DYAML_CPP_BUILD_TESTS at build

* (actions) don't fail false

* (actions) build tests in Test step

* (actions) run tests verbose

* (CMake) remove temp logging

* (actions) split building from running tests

* (actions) ctest Debug

* (actions) ctest Debug

* Remove enable_testing
SGSSGene and others added 30 commits March 16, 2026 22:46
This tests the usage of a float as a key.
Because of a bug, this will fail and will be converted to a sequence.
Previously, floats are converted to integer. In some cases this causes
the node to be converted to a sequence instead of a map.
This commit fixes this, by only treating integral values as integral
values.
The 'Next Line' (NEL) has to be encoded utf8 0xC2 0x85.
This fixes the test (which now fails).
\#log: behaviour change: cloning a node preserves markings
googletest 1.13 requires at least C++14

log: fix tests using c++ version from googletest
The unit test only tested for the '|' literal indicator.
But in some cases it should have been '|-'. If a string does not end
with an '\n' it has to use '|-' to indicate that the trailing new line
is not part of the string.

Additionally, I also added a explicit test for '|+'.
log: fix literal string outputs 'chomping indicator' if required
C++ 11 because it is the oldest supported by the project.
C++ 20 because it is GCC default in current compiler versions.
C++ 23 because its the newest with wide compiler support.

log: CI testing for c++23
log: add CI on windows-11-arm platform for bazel
* [cmake] Require CMake 3.15 or newer

* [test] Update Google-test to 1.16

* [ci] Add workflow to configure with CMake 3.15

Ensure that oldest supportest version of CMake can configure project
Copy quick_cmake from CLIUtils/CLI11

log: requires cmake 3.15 as a minimum
log: fix MSVC narrowing conversion warnings
When compiling yaml-cpp as a root project flags like -Wall -pedantic or
-pedantic-error are being set. Some compilers report false positives
and/or are not aware of certain flags.
While having a strict compile policy is nice but hinders people who are
using rare compiler or compiler configurations or sometimes just new
compiler.

The current workaround is to edit the CMakeLists.txt file and edit out
those flags.

This patch provides a new CMake option "YAML_CPP_USE_STRICT_FLAGS".
The default value is set to ON if its the
root project, otherwise OFF. This allows a user to call `cmake
-DYAML_CPP_USE_STRICT_FLAGS=OFF .." to deactivate any strict flag
settings.

log: feat: option for strict flag usage
Add explicit casts to silence 8 warnings triggered by MSVC /W3:

fptostring.cpp:
- Add static_cast<int>(precision) where public API (size_t) calls
  internal template (int)
- Add static_cast<int>(...) for pointer-arithmetic result stored in int

dragonbox.h:
- Add static_cast<uint_least32_t>(n) in umul64() calls inside
  if-constexpr branches guarded by is_same<UInt, uint_least32_t> to
  silence MSVC warnings on discarded branches when UInt=uint_least64_t
- Change trailing-zero counter 's' from size_t to DecimalExponentType
  in both remove_trailing_zeros specializations to match exponent type

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

log: fix MSVC narrowing conversion warnings
Fixes deprecation warning for Node20.js

log: Fixes deprecation warning for Node20.js
…#1451)

log: recognizes `0o` and `0O` as prefix for octal values.
fixes #1322

log: add converter for std::unordered_set
This allows users to build with -fno-exceptions, and smoothly turns exceptions into crashes at the boundary.

log: bazel support for '-fno-exceptions'
When a node's tag started with "!!" — the YAML secondary tag handle,
as in "!!str" or "!!int" — EmitFromEvents stripped a single '!' and
emitted the rest as a LocalTag. The remaining string ("!str") then
failed the LocalTag character regex on the inner '!' and the emitter
bailed out with INVALID_TAG, truncating output after "!".

Reproduction from #1373:

    YAML::Node root;
    YAML::Node s{"hello"};
    s.SetTag("!!str");
    root["some_string"] = s;
    root["some_int"] = 2;
    std::cout << root;  // -> "some_string: !"

Recognize the "!!" prefix in EmitProps and route it through
SecondaryTag with the rest of the tag content. After this:

    some_string: !!str hello
    some_int: 2

Added two regression tests under NodeTest covering both the secondary
("!!") and primary ("!") handle paths.

Closes #1373.

Signed-off-by: Charlie Tonneslan <cst0520@gmail.com>

log: capability to emit secondary handles (e.g. !!str)
…itting (#1447)

* Support single-quoted and literal style for binary emitting.

* Add test for binary emitting styles.

* Add Utils::ComputeBinaryFormat and non-trivial comments.

log: support literal and single-quoted style for YAML::Binary emitting
* Support line wrapping for literal binary emitting.

* Add test for literal binary wrapping

* fix code style and maintainability

log: Support for line wrapping for binary literal syntax
log: README - remove stackoverflow link
* Emit eight-bit integer types as numbers

* Rename uint8_t regression test

---------

Co-authored-by: Bryan Nathan <bryan@users.noreply.github.com>

log: behavior change: uint8_t are now emitted as integers
* feat: add thread-safe contains() function for Node

* remove thread-unsafe EnsureNodeExists in Node::contains().

log: add Node::contains for thread safe testing of existence of children
IsAnchorChar rejected 0x7E ('~') via an off-by-one (< 0x7E), even though
'~' is a valid ns-char and the parser's anchor rule already accepts it.
As a result the emitter could not round-trip its own valid anchor names,
failing with INVALID_ANCHOR. DEL (0x7F) and C1 controls stay excluded.

log: allow `~` in emitted anchor an alias names
* Fix bug on tags starting with "!!"

* Add test for emitting SecondaryTag

* Fix bug when calling SetTag with named tag handles.

* Add test for SetTag

* move SetTag tests from emitter_test.cpp to load_node_test.cpp

* keep emitter_test.cpp unchanged

* keep emitter_test.cpp unchanged

log: improved parsing/emitting of local tags "!!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.