New issue
Advanced search Search tips
Starred by 7 users

Issue metadata

Status: Accepted
Owner:
Cc:
Components:
Area: Infrastructure
Priority: Medium
Type: Defect

Blocked on:
issue 761



Sign in to add a comment

Add a Windows clang asan bot.

Project Member Reported by bungeman@google.com, Jun 19 2014 Back to list

Issue description

Chromium has an fyi bot at http://build.chromium.org/p/chromium.fyi/builders/Chromium%20Win%20Clang%20(asan) which builds with clang for Windows and runs asan. This is awesome, and Skia should have some of this awesome too. The clang on Windows build has discovered issues in Skia, so just having the clang builder would be good.


 

Comment 1 by epoger@google.com, Aug 18 2014

Cc: -epoger@google.com
Project Member

Comment 2 by bore...@google.com, Aug 20 2014

Blockedon: skia:761
Project Member

Comment 3 by thakis@chromium.org, Aug 25 2014

(Note that clang/win is pretty experimental – there's no support for exceptions yet, no goma support, plugins don't work, only linetable debug debug information, etc. But clang/win can fall back to cl.exe for things it can't compile – like exceptions – and the static library release fyi bot we have looks pretty good.

If you're happy with this not being fully production-quality yet, things should mostly work out. That's why the chromium bot is fyi-only at this point.)
Project Member

Comment 4 by bore...@google.com, Mar 24 2015

Labels: Component-Buildbots
Project Member

Comment 5 by bore...@google.com, Jan 19 2016

Labels: NewBotRequest
Project Member

Comment 6 by bore...@google.com, Feb 9 2016

Also need a compile bot for Clang on Windows.
Project Member

Comment 7 by thakis@chromium.org, Feb 9 2016

(a Windows clang asan bot would double as a compile bot for clang on windows)
Project Member

Comment 8 by robertph...@google.com, Mar 10 2016

Cc: rmis...@google.com jcgrego...@google.com bore...@google.com
 Issue 5078  has been merged into this issue.

Comment 9 Deleted

Project Member

Comment 10 by bungeman@google.com, Mar 16 2017

This isn't really just a nice to have at this point, it's something we should really have (at the very least the compile bot). The win_clang bot is now part of the Chromium commit queue and we have no advance warning when it's going to fail. Also, it's been nearly three years since this bug was filed and clang for Windows has advanced quite a bit, it builds all of Chromium and Microsoft is shipping the front end. I would prefer not to use the front end Microsoft ships since that's not what Chromium is using, but even that would be an improvement.

I'll take a quick look at the build side of this when I get the chance.
Project Member

Comment 11 by bore...@google.com, Mar 16 2017

Sorry for my lack of response here.  If you can give me a series of commands to perform the build, I can add the bot.
Project Member

Comment 12 by thakis@chromium.org, Mar 16 2017

For completeness, all the stuff mentioned in comment 3 works now.

Do you have bots that use chromium's clang? If so, just do that (chromium's deps file downloads clang on win by default these days, and is_clang=true in your args.gn selects that as default compiler. If you want asan, add is_asan=true). If you don't deps in chromium's tools/clang/scripts and build/, I'd need some information on your setup to advise.
Project Member

Comment 13 by bungeman@google.com, Jul 31 2017

So I think the steps are 1) get clang (Chromium gets it with <chromium>/tools/clang/scripts/update.py ) and 2) set cc and cxx in the args.gn to point to it.

Seems like a good idea to get a builder working now that Chromium is looking to build with Clang on Windows by default.
Project Member

Comment 14 by bugdroid1@chromium.org, Jul 31 2017

The following revision refers to this bug:
  https://skia.googlesource.com/skia/+/c722f79b6c8919e1a8a0df6d4d7735c5a8a1b5e8

commit c722f79b6c8919e1a8a0df6d4d7735c5a8a1b5e8
Author: Mike Klein <mtklein@chromium.org>
Date: Mon Jul 31 18:39:23 2017

clang on windows support

1) Run python bin/fetch-clang-win
2) Set clang_win = "../bin/clang_win"
3) ???
4) Profit

Most changes here are to pass the right -mfoo flags to Clang
to enable advanced instruction sets, or fixed warning-as-errors.

BUG=skia:2679

Change-Id: Ieed145d35c209131c7c16fdd3ee11a3de4a1a921
Reviewed-on: https://skia-review.googlesource.com/28740
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

[modify] https://crrev.com/c722f79b6c8919e1a8a0df6d4d7735c5a8a1b5e8/src/ports/SkImageEncoder_WIC.cpp
[modify] https://crrev.com/c722f79b6c8919e1a8a0df6d4d7735c5a8a1b5e8/tools/viewer/Viewer.cpp
[modify] https://crrev.com/c722f79b6c8919e1a8a0df6d4d7735c5a8a1b5e8/src/utils/win/SkWGL_win.cpp
[modify] https://crrev.com/c722f79b6c8919e1a8a0df6d4d7735c5a8a1b5e8/third_party/zlib/BUILD.gn
[modify] https://crrev.com/c722f79b6c8919e1a8a0df6d4d7735c5a8a1b5e8/gn/BUILDCONFIG.gn
[modify] https://crrev.com/c722f79b6c8919e1a8a0df6d4d7735c5a8a1b5e8/samplecode/SampleBigGradient.cpp
[modify] https://crrev.com/c722f79b6c8919e1a8a0df6d4d7735c5a8a1b5e8/gn/toolchain/BUILD.gn
[modify] https://crrev.com/c722f79b6c8919e1a8a0df6d4d7735c5a8a1b5e8/src/views/win/SkOSWindow_win.cpp
[add] https://crrev.com/c722f79b6c8919e1a8a0df6d4d7735c5a8a1b5e8/bin/fetch-clang-win
[modify] https://crrev.com/c722f79b6c8919e1a8a0df6d4d7735c5a8a1b5e8/BUILD.gn
[modify] https://crrev.com/c722f79b6c8919e1a8a0df6d4d7735c5a8a1b5e8/tools/colorspaceinfo.cpp
[modify] https://crrev.com/c722f79b6c8919e1a8a0df6d4d7735c5a8a1b5e8/.gitignore
[modify] https://crrev.com/c722f79b6c8919e1a8a0df6d4d7735c5a8a1b5e8/include/core/SkPostConfig.h
[modify] https://crrev.com/c722f79b6c8919e1a8a0df6d4d7735c5a8a1b5e8/gn/BUILD.gn
[modify] https://crrev.com/c722f79b6c8919e1a8a0df6d4d7735c5a8a1b5e8/third_party/libwebp/BUILD.gn
[modify] https://crrev.com/c722f79b6c8919e1a8a0df6d4d7735c5a8a1b5e8/tools/sk_tool_utils.cpp

Project Member

Comment 17 by mtklein@chromium.org, Aug 1 2017

Looks like I can compile but not yet link, https://skia-review.googlesource.com/c/29024.

Things are not looking hopeful:

  ...
  if (is_asan && is_win && !is_component_build) {
    if (target_cpu == "x64") {
      # Windows 64-bit. TODO(etienneb): Remove the assert when this is ready.
      assert(false, "win/asan does not work in 64-bit yet")
  ...

Project Member

Comment 19 by benjamin...@google.com, Jan 3

'-fsanitize=address' does not yet work for Windows, but I added other "ASAN" checks in https://skia-review.googlesource.com/86401, except function, vptr, and object-size.

Not sure if I should close this now or leave open to add the remaining checks if/when they are supported.
Project Member

Comment 20 by mtklein@chromium.org, Jan 3

Status: Fixed (was: Accepted)
Let's take our victory!
Project Member

Comment 21 by thakis@chromium.org, Jan 3

we  have a working win asan bot in chromium land here fyi: https://ci.chromium.org/p/chromium/g/chromium.clang/console
Project Member

Comment 22 by mtklein@chromium.org, Jan 3

Status: Accepted (was: Fixed)
Oh, duh, 
...
  if (is_asan && is_win && !is_component_build) {
    if (target_cpu == "x64") {
      # Windows 64-bit. TODO(etienneb): Remove the assert when this is ready.
      assert(false, "win/asan does not work in 64-bit yet")
  ...

... we can do 32-bit ASAN builds.

Sign in to add a comment