This adds proper target types, dependencies, and library handling. This
is enough to build and run dm on Linux and Mac.
Change-Id: I5220f67f7dd3dbada7ad03ef83fff8fd80158fad
Reviewed-on: https://skia-review.googlesource.com/2664
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
I'm not seeing any problems with these locally. Perhaps the bots have something to say.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2709
Change-Id: I6f0c7045c8f270efcd71d837f22a40e9f9d3e9b7
Reviewed-on: https://skia-review.googlesource.com/2709
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
I don't know _why_ Clang would like these .inc files to have a newline at the end of the file, but it seems a harmless way to silence the warning.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2711
Change-Id: I6c530ee5096c48c91ddf322aca916e70a0dd770b
Reviewed-on: https://skia-review.googlesource.com/2711
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
I've even found the code that's making this happen, just don't know why.
I've added a test to assert that it's safe to assume malloc() is 8-byte aligned.
Test should compile this time.
CQ_INCLUDE_TRYBOTS=master.client.skia.android:Test-Android-Clang-NexusPlayer-CPU-Moorefield-x86-Release-GN_Android-Trybot
Change-Id: I48714b99670c20704adf4f7f216da0d60d7d9bcd
Reviewed-on: https://skia-review.googlesource.com/2662
Reviewed-on: https://skia-review.googlesource.com/2703
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
This reverts commit If8a2898ab3a77571622eb125c97f676e029b902c.
Reason for revert:
../../../../../work/skia/tests/OverAlignedTest.cpp: In function 'void test_OverAligned(skiatest::Reporter*, sk_gpu_test::GrContextFactory*)':
../../../../../work/skia/tests/OverAlignedTest.cpp:19:33: error: invalid operands of types 'void*' and 'int' to binary 'operator&'
REPORTER_ASSERT(r, SkIsAlign8(p));
^
ninja: build stopped: subcommand failed.
Original issue's description:
> Focus -Wno-over-aligned to just 32-bit x86 Android.
>
> I've even found the code that's making this happen, just don't know why.
> I've added a test to assert that it's safe to assume malloc() is 8-byte aligned.
>
> BUG=skia:
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2662
>
> CQ_INCLUDE_TRYBOTS=master.client.skia.android:Test-Android-Clang-NexusPlayer-CPU-Moorefield-x86-Release-GN_Android-Trybot
>
TBR=mtklein@chromium.org,bungeman@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Change-Id: Ic9b30ce980d8d5155528a6f2b4e1913e5fa95dc0
Reviewed-on: https://skia-review.googlesource.com/2702
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
I've even found the code that's making this happen, just don't know why.
I've added a test to assert that it's safe to assume malloc() is 8-byte aligned.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2662
CQ_INCLUDE_TRYBOTS=master.client.skia.android:Test-Android-Clang-NexusPlayer-CPU-Moorefield-x86-Release-GN_Android-Trybot
Change-Id: If8a2898ab3a77571622eb125c97f676e029b902c
Reviewed-on: https://skia-review.googlesource.com/2662
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
The warning looks to helpfully pre-warn about possible link failures, but it's warning exclusively in places where we're doing things right.
The worst that happens ignoring this warning is a missing-symbol linker error.
I've taken the opportunity to batch in a few other de-escalations:
- Wconditional-uninitialized is done better by MSAN
- It'll take some work to dig Wformat-literal out of our shader compiler, but nothing looks unsafe
- Most of Wshift-sign-overflow is 0xff << 24. Don't want to ban that.
- Wdeprecated is mostly warning about features C++11 technically deprecated that might be removed in later releases. Punt!
- Wcovered-switch-default is pretty much the opposite of what we want.
- Wshadow is triggering too often to fix quickly. Probably mostly false positives.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2620
Change-Id: I20a85a77d2e19ed05a536b23037bd988350f821e
Reviewed-on: https://skia-review.googlesource.com/2620
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
It was not a fan of this (blatant) aliasing.
I suspect this best_non_simd_srcover_srgb_srgb() function has several
other aliasing issues that use undefined behavior, but this is all it's
complaining about for now.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2606
Change-Id: I25a8800e810bccf5068c8a10e9c8c8f565e57304
Reviewed-on: https://skia-review.googlesource.com/2606
Commit-Queue: Mike Klein <mtklein@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
This cleans up 3 remaining sites using , that probably meant ;
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2605
Change-Id: I5e48bcd85d72a205d2b0c860461dab1ec793dd18
Reviewed-on: https://skia-review.googlesource.com/2605
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
This reverts commit I09c3487adfeb26a6fb07e1939cb927c5d7de3107.
Reason for revert: -Wover-aligned on x86 Android bots
Original issue's description:
> GN: detect is_clang, use it to switch Clang to warning blacklist.
>
> BUG=skia:
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2599
>
> Change-Id: I09c3487adfeb26a6fb07e1939cb927c5d7de3107
> Reviewed-on: https://skia-review.googlesource.com/2599
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Mike Klein <mtklein@chromium.org>
>
TBR=mtklein@chromium.org,bungeman@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Change-Id: Ic07bf7896a305be6c377f14a573cb10836f1a6f8
Reviewed-on: https://skia-review.googlesource.com/2601
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Can be run like
gn gen out/debug --ide=json --json-ide-script=../../gn/gn_to_cmake.py
or
gn gen out/debug --ide=json
python gn/gn_to_cmake.py out/debug/project.json
This first pass creates CMakeLists.txt with just enough information for an
ide. Each target is just a static library with sources, include
directories, and defines.
NOTRY=true
This isn't automatically tested.
Review-Url: https://codereview.chromium.org/2363873002
is_skia_standalone will be defined and set to true iff we're using our
standalone BUILDCONFIG.gn. Any other build (Fuchsia, Chrome, Pdfium)
will have their own BUILDCONFIG.gn, which presumably does not define
is_skia_standalone.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2357963002
Review-Url: https://codereview.chromium.org/2357963002
... and use it to control debug symbols and SK_ALLOW_STATIC_GLOBAL_INITIALIZERS.
This will most directly have the effect of disabling GLProgramsTest and a bunch
of similar failing Vk tests on Android.
Hopefully this makes the N7 trybot go green, keeping the N5 trybot green. Just running the N10 for fun.
(is_official_build is how Chrome terms this sort of ReleaseForReal build.)
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2340723003
Review-Url: https://codereview.chromium.org/2340723003
Android's the easiest place to start supporting Vulkan, so it's up first.
ndk_api becomes user-specifiable so that the Vulkan bots can kick it up
to 24, the first release supporting Vulkan. The defaults remain the same:
18 for 32-bit and 21 for 64-bit, the first release supporting 64-bit.
To test this, I set ndk_api=24 and skia_use_vulkan=true in GN, then
$ ninja -C out dm; and droid out/dm --config vk --src gm
Seems to work! Bot scripts to follow.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2336343002
Review-Url: https://codereview.chromium.org/2336343002
Attempt to take over all *SAN builds.
MSAN has a lot of coordination required between gn/BUILD.gn and gn_flavor.py.
I'd like to follow up to move more of this into gn/BUILD.gn, to make it easier
to use locally.
The compile steps should be much faster now. We no longer build CMake
and Clang for every run, instead using the clang_linux CIPD package. This
removes the need for all the third_party/externals/llvm/... dependencies.
Similarly, since we're using the clang_linux package, we no longer depend
on Chrome's Clang, and thus no longer need to sync chromium on these bots.
Instead of packaging up MSAN libraries and llvm-symbolizer in the compile
output, I have the test / perf bots also depend on the clang_linux package.
These do not vary from build to build.
No more need for the xsan.blacklist -include hack: Clang, GN, and Ninja
all track changes to xsan.blacklist without our help.
This has the incidental effect of upgrading the compiler used by *SAN
bots from Clang 3.8 to Clang 3.9.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2289343002
Review-Url: https://codereview.chromium.org/2289343002
In a GN world we are no longer tied to the Debug/Release dichotomy of
GYP, and extra_cflags makes it trivially easy to override any flags we
set by default. These two together mean we don't have to make the default
Debug build pointlessly unoptimized.
-O1 takes negligibly longer to compile than -O0, doesn't make debugging
difficult, and the code is considerably better. DM runs ~4x faster this way.
Backstory: I just re-noticed we do this for our Debug MSAN builds, which has
had a serious wall-time slimming effect. I was about to restore it to my GN
MSAN builds when I realized, hey, maybe we should do this for all builds.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2322753002
Review-Url: https://codereview.chromium.org/2322753002
This is for the coalescing of sources in one GYP file to improve GN runtime. If
this is successful, the other sources lists will also be merged into this one
file.
Inlines "../src" and "../include" for skia_source_dir and skia_include_dir. Evaluating these with GYP's variable expansion is annoying since I think another layer of nesting is required. Coding these explicitly is also more clear. This used to be required because Chromium would reference these .gypi files directly with a different path, but this no longer happens.
Removes the chromium defines gypi which is no longer referenced.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2302723005
Committed: https://skia.googlesource.com/skia/+/39f7a10a04a914384944d8bf62621144ac4eeaa3
Review-Url: https://codereview.chromium.org/2302723005
Reason for revert:
The broke the PDFium build. See
https://build.chromium.org/p/client.skia.compile/builders/Build-Ubuntu-GCC-x86_64-Release-PDFium/builds/2094
Original issue's description:
> Move uils and sksl to a common sources GYP file.
>
> This is for the coalescing of sources in one GYP file to improve GN runtime. If
> this is successful, the other sources lists will also be merged into this one
> file.
>
> Inlines "../src" and "../include" for skia_source_dir and skia_include_dir. Evaluating these with GYP's variable expansion is annoying since I think another layer of nesting is required. Coding these explicitly is also more clear. This used to be required because Chromium would reference these .gypi files directly with a different path, but this no longer happens.
>
> Removes the chromium defines gypi which is no longer referenced.
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2302723005
>
> Committed: https://skia.googlesource.com/skia/+/39f7a10a04a914384944d8bf62621144ac4eeaa3TBR=mtklein@chromium.org,brettw@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
Review-Url: https://codereview.chromium.org/2317683002
This is for the coalescing of sources in one GYP file to improve GN runtime. If
this is successful, the other sources lists will also be merged into this one
file.
Inlines "../src" and "../include" for skia_source_dir and skia_include_dir. Evaluating these with GYP's variable expansion is annoying since I think another layer of nesting is required. Coding these explicitly is also more clear. This used to be required because Chromium would reference these .gypi files directly with a different path, but this no longer happens.
Removes the chromium defines gypi which is no longer referenced.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2302723005
Review-Url: https://codereview.chromium.org/2302723005
This file will be imported by Chrome to access the sources lists.
Once Chrome is updated to use this file, changes to the skia .gypi layout can
be done entirely within the skia repository as long as the resulting lists
produced by the new .gni file have the same name.
Marks skia_for_chromium_defines as obsolete and moves the definition into the new .gni file. We can remove the .gypi file when Chrome is updated.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2302803005
Review-Url: https://codereview.chromium.org/2302803005
This makes it considerably easier to use ccache with the Android NDK.
You can now just set
compiler_prefix = "ccache"
ndk = "/path/to/ndk"
and we'll use the NDK clang, wrapped with ccache.
The name compiler_prefix is stolen from / compatible with Chrome.
If you have ccache, you can just always leave compiler_prefix="ccache" enabled.
This should make it an unusual thing for humans to have to change cc or cxx.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2281163002
Review-Url: https://codereview.chromium.org/2281163002
Once you have downloaded an android NDK, you can set the ndk GN arg to use it.
E.g. my gn.args looks like:
is_debug = false
ndk = "/opt/android-ndk"
This should be enough to get you going for an arm64 build. You ought to be able to tweak that to other architectures by changing target_cpu to "arm", "x86", "x86-64", etc. That won't quite work until I follow this up a bit, but the skeleton is there.
This is enough to get me compiled, linked, and running to completion on my N5x.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2275983004
Review-Url: https://codereview.chromium.org/2275983004
- Use options' template pattern for opts too.
- Simplify opt's and options' configs... they should all be the same.
- When building a static-library component in our GN environment (i.e. libskia.a),
make it a complete static lib, fully containing its transitive deps.
- It has not proved useful to override ar.
TBR=jcgregorio@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2278673002
Review-Url: https://codereview.chromium.org/2278673002
Adding flags to the end of cc or cxx is pretty useful, but these always end up
on the command line before the GN generated flags, thus setting defaults that
GN will override.
For full flexibility we want to be able to add flags after the flags GN has
added, so that custom flags can override _it_.
I've updated the Fast bots with an example here: if we said cc="clang -O3 ...",
that '-O3' would be overriden later by the default Release-mode '-Os'. By
putting it in extra_cflags, we get the last word: our '-O3' overrides the
default '-Os'.
Another good use case is a hypothetical Actually-Shippable-Release mode. Our
Release mode bundles in tons of debug symbols via '-g'. libskia.a is about 10x
larger than it needs to be when built that way, but it helps us debug the bot
failures immensely. To build a libskia.{a,so} that you'd really ship, you can
now set extra_cflags="-g0" to override '-g'. You could set '-march' flags there
too, '-fomit-frame-pointer', etc.
There are lots of flags that won't matter where they end up in the command line.
To keep everything simple I've put them in extra_cflags with the rest. This means
the only time we change 'cc' or 'cxx' in our recipes is to prefix 'ccache'.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2241263003
Review-Url: https://codereview.chromium.org/2241263003
exec_script runs every time gn does, which is explicitly on every one of our
bot runs. That should be enough to obviate the .git/logs/HEAD hack.
Easiest way to do this was to swap around find.py's argument order to allow
multiple search directories. This is the root of all the .gyp changes.
This moves the blacklist into BUILD.gn, which I think is nice.
It expands it a little as we're now searching recursively, into include/gpu/vk
which we can't include safely without the Vulkan SDK.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2205903004
Review-Url: https://codereview.chromium.org/2205903004
This should help make the bot logs a little easier to read. (On the console
this wasn't much of a big deal, as Ninja auto-abbreviates when printing to an
interactive console.)
As usual, Ninja will print the full command when a task fails.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2188263002
Review-Url: https://codereview.chromium.org/2188263002
These flags hide symbols that are not marked with SK_API when linked into a
shared library. There's nominally no effect on static linking, but I'm
pretty sure the Mac linker takes some advantage of this too to run faster.
This makes component-build DM no longer link: it uses many non SK_API APIs.
Fiddle in contrast is just fine with our public APIs, so no need to restrict that.
It'll be fun finding out which of our other tools go which ways.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2180383003
Review-Url: https://codereview.chromium.org/2180383003
- Make fiddle build on Mac (skipping GL).
- Now that we're building in SkCodec, we depend on libpng and libjpeg-turbo unconditionally, not just on Linux.
- Re-arrange third_party a bit so that our targets are Fuchsia/Chrome compatible.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2184133002
NOTREECHECKS=true
This doesn't affect Chrome/Blink, so landing through the closed tree.
Review-Url: https://codereview.chromium.org/2184133002
This sketches out what a world without Chrome's GN configs would look like.
Instead of DEPSing in build/, we now host our own gypi_to_gn.py.
The symlink from skia/ to . lets us run gclient hooks when the .gclient file is in the directory above skia/ or inside skia/. That means we don't need gn.py anymore.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2167163002
Review-Url: https://codereview.chromium.org/2167163002