Skip to content

Build failure on Windows caused by UTF-8 characters #25885

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
3ea2c2b opened this issue Feb 2, 2019 · 6 comments
Closed

Build failure on Windows caused by UTF-8 characters #25885

3ea2c2b opened this issue Feb 2, 2019 · 6 comments
Labels
build Issues and PRs related to build files or the CI. windows Issues and PRs related to the Windows platform.

Comments

@3ea2c2b
Copy link

3ea2c2b commented Feb 2, 2019

Version: Github release 11.9.0

In file .\deps\v8\src\objects\js-collator.cc, line 193 and 203.
There is a comment like // This is fine.™.
Remove the character , and that will be fine.
Otherwise it may cause similar compile error like #25133.

@bnoordhuis bnoordhuis added windows Issues and PRs related to the Windows platform. build Issues and PRs related to build files or the CI. labels Feb 2, 2019
@bnoordhuis
Copy link
Member

Can you post the exact output of a clean build from vcbuild.bat on down? What compiler do you have installed? Please be specific about the version.

@3ea2c2b
Copy link
Author

3ea2c2b commented Feb 2, 2019

Using the latest MSVS 2017.

Here is the first error of the output.
deps\v8\src\objects\js-collator.cc(198): error C2065: “keyword”: Undeclared identifier [deps\v8\gypfiles\v8_base.vcxproj]

I suppose encoding casue this.
Here is a part of js-collator.cc.

189: for (const char* keyword = keywords->next(&length, status);
190: keyword != nullptr; keyword = keywords->next(&length, status)) {
191: // Ignore failures in ICU and skip to the next keyword.
192: //
193: // This is fine.™
194: if (U_FAILURE(status)) {
195: status = U_ZERO_ERROR;
196: continue;
197 }
198:
199: icu_locale.getKeywordValue(keyword, value, ULOC_FULLNAME_CAPACITY, status);

when i change encoding from UTF-8 to ANSI, the file turns into the following one.

189: for (const char* keyword = keywords->next(&length, status);
190: keyword != nullptr; keyword = keywords->next(&length, status)) {
191: // Ignore failures in ICU and skip to the next keyword.
192: //
193: // This is fine.鈩?
194: if (U_FAILURE(status)) {
195: status = U_ZERO_ERROR;
196: continue;
197 }
198:
199: icu_locale.getKeywordValue(keyword, value, ULOC_FULLNAME_CAPACITY, status);

And I used Notepad++,only to find that there is no '\n' bewteen line 193 and line 194
So the file actually looks like the following one.

189: for (const char* keyword = keywords->next(&length, status);
190: keyword != nullptr; keyword = keywords->next(&length, status)) {
191: // Ignore failures in ICU and skip to the next keyword.
192: //
193: // This is fine.鈩?if (U_FAILURE(status)) {
194: status = U_ZERO_ERROR;
195: continue;
196 }
197:
198: icu_locale.getKeywordValue(keyword, value, ULOC_FULLNAME_CAPACITY, status);

So it may be the reason for the error.
deps\v8\src\objects\js-collator.cc(198): error C2065: “keyword”: Undeclared identifier [deps\v8\gypfiles\v8_base.vcxproj]

@bnoordhuis
Copy link
Member

Using the latest MSVS 2017

When I said "please be specific" I meant the exact version number. :-)

FWIW, we have VS 2017 in our CI's build matrix and it works without a hitch. The problem is almost certainly on your end.

@3ea2c2b
Copy link
Author

3ea2c2b commented Feb 3, 2019

VS 2017 15.9.6
MSVC 14.16.27023

@bnoordhuis
Copy link
Member

Can you also run vcbuild.bat clean and then run vcbuild.bat again and include the output here? You can put it in <detail> tags to stop it from becoming a wall of text.

@3ea2c2b
Copy link
Author

3ea2c2b commented Feb 17, 2019

js-collator.cc
root\node-11.10.0\deps\v8\src\objects\js-collator.cc : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Un
icode format to prevent data loss [root\node-11.10.0\deps\v8\gypfiles\v8_base.vcxproj]
root\node-11.10.0\deps\icu-small\source\common\unicode\stringoptions.h : warning C4819: The file contains a character that cannot be represented in the current code page (936). S
ave the file in Unicode format to prevent data loss (compiling source file ..\src\objects\js-collator.cc) [root\node-11.10.0\deps\v8\gypfiles\v8_base.vcxproj]
root\node-11.10.0\deps\v8\src\objects\js-collator.cc(198): error C2065: 'keyword': undeclared identifier [root\node-11.10.0\deps\v8\gypfiles\v8_base.vcxproj]
root\node-11.10.0\deps\v8\src\objects\js-collator.cc(204): error C2044: illegal continue [root\node-11.10.0\deps\v8\gypfiles\v8_base.vcxproj]
root\node-11.10.0\deps\v8\src\objects\js-collator.cc(207): error C2065: 'keyword': undeclared identifier [root\node-11.10.0\deps\v8\gypfiles\v8_base.vcxproj]
root\node-11.10.0\deps\v8\src\objects\js-collator.cc(210): error C2059: syntax error: 'if' [root\node-11.10.0\deps\v8\gypfiles\v8_base.vcxproj]
root\node-11.10.0\deps\v8\src\objects\js-collator.cc(210): error C2143: syntax error: missing ';' before '{' [root\node-11.10.0\deps\v8\gypfiles\v8_base.vcxproj]
root\node-11.10.0\deps\v8\src\objects\js-collator.cc(210): error C2447: '{': missing function header (old-style formal list?) [root\node-11.10.0\deps\v8\gypfiles\v8_base.vcxproj]
root\node-11.10.0\deps\v8\src\objects\js-collator.cc(217): error C2059: syntax error: 'return' [root\node-11.10.0\deps\v8\gypfiles\v8_base.vcxproj]
root\node-11.10.0\deps\v8\src\objects\js-collator.cc(237): error C2143: syntax error: missing ';' before '<' [root\node-11.10.0\deps\v8\gypfiles\v8_base.vcxproj]
root\node-11.10.0\deps\v8\src\objects\js-collator.cc(237): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [root\node-11.10.0\deps\v8\gypf
iles\v8_base.vcxproj]
root\node-11.10.0\deps\v8\src\objects\js-collator.cc(237): error C2653: 'JSCollator': is not a class or namespace name [root\node-11.10.0\deps\v8\gypfiles\v8_base.vcxproj]
root\node-11.10.0\deps\v8\src\objects\js-collator.cc(239): error C2143: syntax error: missing ';' before '{' [root\node-11.10.0\deps\v8\gypfiles\v8_base.vcxproj]
root\node-11.10.0\deps\v8\src\objects\js-collator.cc(239): error C2447: '{': missing function header (old-style formal list?) [root\node-11.10.0\deps\v8\gypfiles\v8_base.vcxproj]
root\node-11.10.0\deps\v8\src\objects\js-collator.cc(527): error C2653: 'JSCollator': is not a class or namespace name [root\node-11.10.0\deps\v8\gypfiles\v8_base.vcxproj]
root\node-11.10.0\deps\v8\src\objects\js-collator.cc(527): error C2065: 'Usage': undeclared identifier [root\node-11.10.0\deps\v8\gypfiles\v8_base.vcxproj]
root\node-11.10.0\deps\v8\src\objects\js-collator.cc(527): error C2146: syntax error: missing ')' before identifier 'usage' [root\node-11.10.0\deps\v8\gypfiles\v8_base.vcxproj]
root\node-11.10.0\deps\v8\src\objects\js-collator.cc(527): error C2143: syntax error: missing ';' before '{' [root\node-11.10.0\deps\v8\gypfiles\v8_base.vcxproj]
root\node-11.10.0\deps\v8\src\objects\js-collator.cc(527): error C2447: '{': missing function header (old-style formal list?) [root\node-11.10.0\deps\v8\gypfiles\v8_base.vcxproj]
root\node-11.10.0\deps\v8\src\objects\js-collator.cc(538): error C2059: syntax error: '}' [root\node-11.10.0\deps\v8\gypfiles\v8_base.vcxproj]
root\node-11.10.0\deps\v8\src\objects\js-collator.cc(538): error C2143: syntax error: missing ';' before '}' [root\node-11.10.0\deps\v8\gypfiles\v8_base.vcxproj]
root\node-11.10.0\deps\v8\src\objects\js-collator.cc(539): error C2143: syntax error: missing ';' before '}' [root\node-11.10.0\deps\v8\gypfiles\v8_base.vcxproj]
root\node-11.10.0\deps\v8\src\objects\js-collator.cc(539): error C2059: syntax error: '}' [root\node-11.10.0\deps\v8\gypfiles\v8_base.vcxproj]

If you check the first error, you will find it ought to be located in line 199, not 198.

@danbev danbev closed this as completed in 8fbbab8 Nov 19, 2019
BridgeAR pushed a commit that referenced this issue Nov 19, 2019
PR-URL: #30492
Fixes: #25885
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
targos pushed a commit that referenced this issue Dec 1, 2019
PR-URL: #30492
Fixes: #25885
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
MylesBorins pushed a commit that referenced this issue Dec 17, 2019
PR-URL: #30492
Fixes: #25885
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
build Issues and PRs related to build files or the CI. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants