rc and rc.exe produce different .res files when compiling .rc files. |
||
Issue description
In //src/build/toolchain/win/tool_wrapper.py when compiling .rc files it appears that rc and rc.exe produce different content in the .res files if a resource has a resource name of 0. The equivalence of these outputs is asserted on and causes the build to fail. This is Windows only bug since it requires rc.exe.
Steps to reproduce:
(1) Create/Edit a .rc file such that a resource has a Resource Name of 0
Example:
#define BAD_RES_NAME 0
BAD_RES_NAME MYRESTYPE { 0L }
Possible test file: //src/chrome/installer/setup/setup.rc
I built using 'ninja -C out/Default -j 2000 setup.exe' (On Windows)
(2) Compile the target using rc.exe and rc
(3) rc will use 0xFF rather than 0x00 for the Resource Name (checked with hex dump).
As a result the compile step will fail due to an error in the bytewise assertion that the files are identical.
Interim workaround is to use values > 0 but it would be nice if it were fixed.
It looks like rc lives at:
https://github.com/nico/hack/blob/master/res/rc.cc
Which is called by:
//src/build/toolchain/win/rc/rc.py
Details on user-defined resources:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa381054(v=vs.85).aspx
,
Feb 21 2018
Are you sure about (3)? To me, it looks like MS rc.exe will store the 0 as a string value (3000 0000) instead of an int value (ffff 0000) like rc.py does. Thanks for the report, looking.
,
Feb 21 2018
Ah WRT (3) that makes more sense as the difference. Oversight on my part, sorry!
,
Feb 21 2018
Fixed in https://github.com/nico/hack/commit/b78055a9b7d390e05b4dbdb4e962a64a44e169a6 I think. Let me run the roll script.
,
Feb 22 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/31293c9d6d6450f5f7771d0c94f2efae3e25d0cb commit 31293c9d6d6450f5f7771d0c94f2efae3e25d0cb Author: Nico Weber <thakis@chromium.org> Date: Thu Feb 22 14:42:14 2018 Teach analyze to run compile on the Win bots when rc.exe gets updated. Bug: 814452 Change-Id: I0c02b59f1835752c2f66620404bfaaed24694ba7 Reviewed-on: https://chromium-review.googlesource.com/930004 Reviewed-by: Hans Wennborg <hans@chromium.org> Commit-Queue: Nico Weber <thakis@chromium.org> Cr-Commit-Position: refs/heads/master@{#538431} [modify] https://crrev.com/31293c9d6d6450f5f7771d0c94f2efae3e25d0cb/testing/buildbot/trybot_analyze_config.json
,
Feb 22 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/a099dfc3728ae6a737d2a0b716c9609915f200be commit a099dfc3728ae6a737d2a0b716c9609915f200be Author: Nico Weber <thakis@chromium.org> Date: Thu Feb 22 16:20:09 2018 Update prebuilt rc binary. CL created by running build/toolchain/win/rc/upload_rc_binaries.sh Picks up https://github.com/nico/hack/commit/b78055a9b7d390e05b4dbdb4e962a64a44e169a6 Bug: 814452 Change-Id: Id8d5c8b1bde49e0899314901782a5228212080f8 Reviewed-on: https://chromium-review.googlesource.com/929941 Reviewed-by: Samuel Huang <huangs@chromium.org> Commit-Queue: Nico Weber <thakis@chromium.org> Cr-Commit-Position: refs/heads/master@{#538449} [modify] https://crrev.com/a099dfc3728ae6a737d2a0b716c9609915f200be/build/toolchain/win/rc/linux64/rc.sha1 [modify] https://crrev.com/a099dfc3728ae6a737d2a0b716c9609915f200be/build/toolchain/win/rc/mac/rc.sha1 [modify] https://crrev.com/a099dfc3728ae6a737d2a0b716c9609915f200be/build/toolchain/win/rc/win/rc.exe.sha1
,
Feb 22 2018
,
Feb 23 2018
(Please shout if you find similar problems like this!)
,
Feb 23 2018
(Thanks so much for your quick response :D Will do!) |
||
►
Sign in to add a comment |
||
Comment 1 by ckitagawa@google.com
, Feb 21 2018