Skip to content

Commit

Permalink
re #486: trying to reproduce:
Browse files Browse the repository at this point in the history
no luck so far with any of the following:

native gcc11.4 on ubuntu22.04:
```
( \
set -xe ; \
cd /rapidyaml/ ; \
bt=Release ; \
bd=build/docker-$bt ; \
tgt=ryml-test-scalar_dquoted ; \
export C4_EXTERN_DIR=`pwd`/build/extern ; \
mkdir -p $C4_EXTERN_DIR ; \
cmake -B $bd -D RYML_DEV=ON -D RYML_BUILD_BENCHMARKS=OFF && \
cmake --build $bd -j --target $tgt && \
./$bd/test/$tgt --gtest_filter=*486* )
```

Tried also using -DRYML_STRICT_ALIASING=OFF (to remove
-fstrict-aliasing) and -DRYML_PEDANTIC=OFF, and still could not
reproduce.

with wine in arch linux (gcc 14):
```
( set -xe ; \
bt=Release ; \
bd=build/mingw-$bt ; \
tgt=ryml-test-scalar_dquoted ; \
cd ~/proj/rapidyaml/ ; \
cmake -B $bd -D
CMAKE_TOOLCHAIN_FILE=`pwd`/.github/mingw-w64-x86_64.cmake -D RYML_DEV=ON && \
cmake --build $bd -j --target $tgt && \
env WINEPATH=/usr/x86_64-w64-mingw32/bin wine ./$bd/bin/$tgt.exe --gtest_filter=*486* )
```
with wine in ubuntu18.04 (gcc 7.3)
```
( set -xe ; \
cd /rapidyaml/ ; \
bt=Release ; \
bd=build/docker-mingw-$bt ; \
tgt=ryml-test-scalar_dquoted ; \
export C4_EXTERN_DIR=`pwd`/build/extern ; \
mkdir -p $C4_EXTERN_DIR ; \
cmake -B $bd -D
CMAKE_TOOLCHAIN_FILE=`pwd`/.github/mingw-w64-x86_64.cmake -D RYML_DEV=ON -D RYML_BUILD_BENCHMARKS=OFF && \
cmake --build $bd -j --target $tgt && \
env WINEPATH="/usr/lib/gcc/x86_64-w64-mingw32/7.3-win32;/usr/x86_64-w64-mingw32/lib" wine ./$bd/bin/$tgt.exe --gtest_filter=*486* )
```
with wine in ubuntu22.04 (gcc 10)
```
( set -xe ; \
cd /rapidyaml/ ; \
bt=Release ; \
bd=build/docker-mingw-$bt ; \
tgt=ryml-test-scalar_dquoted ; \
export C4_EXTERN_DIR=`pwd`/build/extern ; \
mkdir -p $C4_EXTERN_DIR ; \
cmake -B $bd -D
CMAKE_TOOLCHAIN_FILE=`pwd`/.github/mingw-w64-x86_64.cmake -D RYML_DEV=ON -D RYML_BUILD_BENCHMARKS=OFF && \
cmake --build $bd -j --target $tgt && \
env WINEPATH="/usr/lib/gcc/x86_64-w64-mingw32/10-win32;/usr/x86_64-w64-mingw32/lib" wine ./$bd/bin/$tgt.exe --gtest_filter=*486* )
```
  • Loading branch information
biojppm committed Jan 20, 2025
1 parent 16fe782 commit 2fcd2d4
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/mingw-w64-x86_64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
set(CMAKE_SYSTEM_NAME Windows)
set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)

# cross compilers to use for C, C++ and Fortran
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
set(CMAKE_Fortran_COMPILER ${TOOLCHAIN_PREFIX}-gfortran)
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)

# target environment on the build host system
set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})

# modify default behavior of FIND_XXX() commands
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
20 changes: 20 additions & 0 deletions test/test_scalar_dquoted.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,26 @@ INSTANTIATE_TEST_SUITE_P(double_quoted_filter,

//-----------------------------------------------------------------------------

TEST(double_quoted, issue486)
{
csubstr srcs[] = {
"foo: \"test,\nbar\"", // this is invalid YAML, but ryml can parse it (but won't in the future)
"foo: \"test,\n bar\"" // ... this is valid
};
auto check = [](Tree const &t){
ASSERT_TRUE(t.rootref().is_map());
ASSERT_TRUE(t.rootref().has_child("foo"));
ASSERT_TRUE(t["foo"].has_val());
ASSERT_TRUE(t["foo"].is_val_dquo());
ASSERT_EQ(t["foo"].val(), "test, bar");
};
for(csubstr src : srcs)
{
check(parse_in_arena(src));
test_check_emit_check(src, check);
}
}

TEST(double_quoted, leading_whitespace)
{
csubstr val = "\n \tfoo";
Expand Down

0 comments on commit 2fcd2d4

Please sign in to comment.