Skip to content

Conversation

cosmo0920
Copy link
Contributor

@cosmo0920 cosmo0920 commented Feb 22, 2025

In non-Western Windows environment, especially cp932 (Shift-JIS) environment of Windows, cl.exe complains continuous lines but this should be caused character encoding glitches.
This should be fixed by BOM at the top of the source files. This issue should be happened if the files contain non-ASCII characters such as AccsantGrave or other symbols or multibytes characters could cause this type of issue.

[ 98%] Building C object tests/internal/CMakeFiles/flb-it-conditionals.dir/conditionals.c.obj
conditionals.c
C:\Users\cosmo\Documents\GitHub\fluent-bit\tests\internal\conditionals.c(905): warning C4819: ファイルは、現在のコード  ページ (932) で表示できない文字を含んでいます。データの損失を防ぐために、ファイルを Unicode 形式で保存してください。
C:\Users\cosmo\Documents\GitHub\fluent-bit\tests\internal\conditionals.c(1384): error C2001: 定数が 2 行目に続いています。
C:\Users\cosmo\Documents\GitHub\fluent-bit\tests\internal\conditionals.c(1385): error C2146: 構文エラー: ')' が、識別子 'acutest_check_' の前に必要です。
C:\Users\cosmo\Documents\GitHub\fluent-bit\tests\internal\conditionals.c(1511): error C2001: 定数が 2 行目に続いています。
C:\Users\cosmo\Documents\GitHub\fluent-bit\tests\internal\conditionals.c(1512): error C2146: 構文エラー: ')' が、識別子 'acutest_check_' の前に必要です。
C:\Users\cosmo\Documents\GitHub\fluent-bit\tests\internal\conditionals.c(1799): warning C4113: 'void (__cdecl *)()' はパラメーター リストが 'void (__cdecl *)(void)' と異なります。
C:\Users\cosmo\Documents\GitHub\fluent-bit\tests\internal\conditionals.c(1800): warning C4113: 'void (__cdecl *)()' はパラメーター リストが 'void (__cdecl *)(void)' と異なります。
C:\Users\cosmo\Documents\GitHub\fluent-bit\tests\internal\conditionals.c(1801): warning C4113: 'void (__cdecl *)()' はパラメーター リストが 'void (__cdecl *)(void)' と異なります。
C:\Users\cosmo\Documents\GitHub\fluent-bit\tests\internal\conditionals.c(1802): warning C4113: 'void (__cdecl *)()' はパラメーター リストが 'void (__cdecl *)(void)' と異なります。
C:\Users\cosmo\Documents\GitHub\fluent-bit\tests\internal\conditionals.c(1803): warning C4113: 'void (__cdecl *)()' はパラメーター リストが 'void (__cdecl *)(void)' と異なります。
C:\Users\cosmo\Documents\GitHub\fluent-bit\tests\internal\conditionals.c(1804): warning C4113: 'void (__cdecl *)()' はパラメーター リストが 'void (__cdecl *)(void)' と異なります。
C:\Users\cosmo\Documents\GitHub\fluent-bit\tests\internal\conditionals.c(1805): warning C4113: 'void (__cdecl *)()' はパラメーター リストが 'void (__cdecl *)(void)' と異なります。
C:\Users\cosmo\Documents\GitHub\fluent-bit\tests\internal\conditionals.c(1806): warning C4113: 'void (__cdecl *)()' はパラメーター リストが 'void (__cdecl *)(void)' と異なります。
C:\Users\cosmo\Documents\GitHub\fluent-bit\tests\internal\conditionals.c(1807): warning C4113: 'void (__cdecl *)()' はパラメーター リストが 'void (__cdecl *)(void)' と異なります。
C:\Users\cosmo\Documents\GitHub\fluent-bit\tests\internal\conditionals.c(1808): warning C4113: 'void (__cdecl *)()' はパラメーター リストが 'void (__cdecl *)(void)' と異なります。
C:\Users\cosmo\Documents\GitHub\fluent-bit\tests\internal\conditionals.c(1809): warning C4113: 'void (__cdecl *)()' はパラメーター リストが 'void (__cdecl *)(void)' と異なります。
C:\Users\cosmo\Documents\GitHub\fluent-bit\tests\internal\conditionals.c(1810): warning C4113: 'void (__cdecl *)()' はパラメーター リストが 'void (__cdecl *)(void)' と異なります。
C:\Users\cosmo\Documents\GitHub\fluent-bit\tests\internal\conditionals.c(1811): warning C4113: 'void (__cdecl *)()' はパラメーター リストが 'void (__cdecl *)(void)' と異なります。
C:\Users\cosmo\Documents\GitHub\fluent-bit\tests\internal\conditionals.c(1812): warning C4113: 'void (__cdecl *)()' はパラメーター リストが 'void (__cdecl *)(void)' と異なります。
C:\Users\cosmo\Documents\GitHub\fluent-bit\tests\internal\conditionals.c(1813): warning C4113: 'void (__cdecl *)()' はパラメーター リストが 'void (__cdecl *)(void)' と異なります。
C:\Users\cosmo\Documents\GitHub\fluent-bit\tests\internal\conditionals.c(1814): warning C4113: 'void (__cdecl *)()' はパラメーター リストが 'void (__cdecl *)(void)' と異なります。
C:\Users\cosmo\Documents\GitHub\fluent-bit\tests\internal\conditionals.c(1815): warning C4113: 'void (__cdecl *)()' はパラメーター リストが 'void (__cdecl *)(void)' と異なります。
C:\Users\cosmo\Documents\GitHub\fluent-bit\tests\internal\conditionals.c(1816): warning C4113: 'void (__cdecl *)()' はパラメーター リストが 'void (__cdecl *)(void)' と異なります。
C:\Users\cosmo\Documents\GitHub\fluent-bit\tests\internal\conditionals.c(1817): warning C4113: 'void (__cdecl *)()' はパラメーター リストが 'void (__cdecl *)(void)' と異なります。
C:\Users\cosmo\Documents\GitHub\fluent-bit\tests\internal\conditionals.c(1818): warning C4113: 'void (__cdecl *)()' はパラメーター リストが 'void (__cdecl *)(void)' と異なります。
NMAKE : fatal error U1077: '"C:\Program Files\CMake\bin\cmake.exe" -E cmake_cl_compile_depends --dep-file=CMakeFiles\flb-it-conditionals.dir\conditionals.c.obj.d --working-dir=C:\Users\cosmo\Documents\GitHub\fluent-bit\build\tests\internal --filter-prefix="メモ: インクルード ファイル:  " -- C:\PROGRA~1\MICROS~1\2022\COMMUN~1\VC\Tools\MSVC\1442~1.344\bin\Hostx64\x64\cl.exe @C:\Users\cosmo\AppData\Local\Temp\nm1458.tmp' : リターン コード '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\bin\HostX64\x64\nmake.exe" -s -f tests\internal\CMakeFiles\flb-it-conditionals.dir\build.make /nologo -SL                 tests\internal\CMakeFiles\flb-it-conditionals.dir\build' : リターン コード '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\bin\HostX64\x64\nmake.exe" -s -f CMakeFiles\Makefile2 /nologo -LS                 all' : リターン コード '0x2'
Stop.

This compiling error is caused by:

https://github.com/fluent/fluent-bit/blob/master/tests/internal/conditionals.c#L1384

    record_data = create_test_record("path", "/api/üser/测试");

In addition, cp932 Windows environment does not recognize UTF-8 by default.
With this behavior, the following error which is including the above error log is sometimes happening:

C:\Users\cosmo\Documents\GitHub\fluent-bit\tests\internal\conditionals.c(905): warning C4819: ファイルは、現在のコード  ページ (932) で表示できない文字を含んでいます。データの損失を防ぐために、ファイルを Unicode 形式で保存してください。

To suppress this type of errors, we need to put BOM at the first bytes of the files which contains non-ASCII characters.


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • Example configuration file for the change
  • Debug log output from testing the change
  • Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • Run local packaging test showing all targets (including any new ones) build.
  • Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • Documentation required for this feature

Backporting

  • Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

… Windows environments

In non-Western Windows environment, especially cp932 (Shift-JIS)
environment of Windows, cl.exe complains continuous lines but this should
be caused character encoding glitches.
This should be fixed by BOM at the top of the source files.
This issue should be happened if the files contain non-ASCII characters
such as AccsantGrave or other symbols or multibytes characters could
cause this type of issue.

Signed-off-by: Hiroshi Hatake <[email protected]>
@cosmo0920 cosmo0920 added this to the Fluent Bit v4.0.0 milestone Feb 23, 2025
@edsiper edsiper merged commit d6c4b3d into master Feb 27, 2025
53 of 54 checks passed
@edsiper edsiper deleted the cosmo0920-add-bom-for-cp932-environment branch February 27, 2025 03:26
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.

3 participants