Go to file
Kevin Lubick 54bd442fad [bazel] Use hermetic Python with jinja2+MarkupSafe
The file generation logic that dawn [1] uses to make some
source files requires jinja2, which also requires MarkupSafe.

The GN build handles this by specifying those repos in
DEPS, checking them out at a certain git hash, and then
providing them via a command line arg [2].

We do not have to do it this way in Bazel to have reproducible
builds. This CL specifies an exact version (verified by sha256)
of those two deps and then uses a hermetic version of
Python 3.9 to run all py_binary commands.

Previously, we would rely on the system Python (and installed
libraries). That happened to work on my machine, but not on
other machines without jinja2 and MarkupSafe installed. After
this CL, it should work on machines that do not have python
even installed.

I chose the same jinja2 version used by Dawn [3], which was
2.11.3. Then I chose the newest version of MarkupSafe that
was compatible with jinja2 (2.0.1).

If we have other python scripts that need external deps, we
should be able to specify them in the py_binary that needs
them and in requirements.txt. Then, the pip_install() step
in WORKSPACE.bazel will download them and make them available.

[1] https://dawn.googlesource.com/dawn.git/+/refs/heads/main/docs/dawn/overview.md
[2] https://dawn.googlesource.com/dawn.git/+/e45ff6a4b3c2f06dade68ec0f01ddc3bfd70c282/generator/generator_lib.gni#77
[3] ee69aa00ee

Change-Id: I3d0074f3003de179400e239e00107c34f35f4901
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524217
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2022-03-28 13:56:16 +00:00
bazel [bazel] Add support for Dawn (via Vulkan) 2022-03-22 13:05:52 +00:00
bench [graphite] Add failure mode to Recorder::snap 2022-03-25 17:49:53 +00:00
bin Handle 'aarch64' from platform.machine() 2022-03-01 13:10:59 +00:00
build/fuchsia
build_overrides Add Abseil dependency for Dawn 2021-09-22 22:05:32 +00:00
client_utils/android Make class members that are static constexpr also be inline. 2021-10-11 16:22:59 +00:00
demos.skia.org [canvaskit] Add in fillText to spreadsheet demo for comparison 2022-02-15 15:35:43 +00:00
dm [graphite] Add failure mode to Recorder::snap 2022-03-25 17:49:53 +00:00
docker [canvaskit] Enable Debugger bindings for autobuild 2022-03-08 17:42:37 +00:00
docs/examples Reland "Add kR8_unorm_SkColorType" 2022-02-10 18:00:19 +00:00
example [bazel] Add support for Dawn (via Vulkan) 2022-03-22 13:05:52 +00:00
experimental [bazel] Fix build 2022-03-28 13:56:16 +00:00
fuzz Reland "[includes] Remove link between SkImage.h and SkImageEncoder.h" 2022-03-10 04:47:51 +00:00
gm [bazel] Fix build 2022-03-28 13:56:16 +00:00
gn [graphite] Add support for finished callbacks. 2022-03-25 14:47:05 +00:00
include [bazel] Fix build 2022-03-28 13:56:16 +00:00
infra [graphite] Add failure mode to Recorder::snap 2022-03-25 17:49:53 +00:00
modules [bazel] Fix build 2022-03-28 13:56:16 +00:00
platform_tools Add missing import for RuntimeShader class. 2022-03-22 13:52:52 +00:00
resources Implement constant-folding for vector/matrix multiplication. 2022-03-25 21:42:47 +00:00
samplecode Add SampleSBIX to study sbix glyph translation. 2022-03-25 14:43:23 +00:00
site Remove obsolete python2 references. 2022-03-16 19:56:37 +00:00
specs [infra] Port serve.py from Python2 to 3 2021-08-31 15:28:19 +00:00
src [bazel] Fix build 2022-03-28 13:56:16 +00:00
tests [bazel] Fix build 2022-03-28 13:56:16 +00:00
third_party [bazel] Use hermetic Python with jinja2+MarkupSafe 2022-03-28 13:56:16 +00:00
toolchain fix typo in toolchain comments 2022-03-21 20:20:04 +00:00
tools [bazel] Fix build 2022-03-28 13:56:16 +00:00
.bazelrc [canvaskit] Add more features to Bazel build 2022-02-04 21:33:20 +00:00
.bazelversion [canvaskit] Add skottie to Bazel build 2022-02-04 19:18:27 +00:00
.clang-format
.clang-tidy
.gitignore Add .vscode to the default gitignore list. 2021-10-13 15:23:02 +00:00
.gn
.vpython [python3] Reland recipes -> python3 changes 2021-12-01 13:04:03 +00:00
AUTHORS Remove obsolete sk_cf_obj 2022-03-11 05:59:16 +00:00
BUILD.bazel [bazel] Add support for Dawn (via Vulkan) 2022-03-22 13:05:52 +00:00
BUILD.gn Use non-deprecated Dawn GN targets 2022-03-22 13:05:52 +00:00
codereview.settings
CONTRIBUTING
CQ_COMMITTERS
DEPS Roll ANGLE from c8f86c217479 to 7a85d114b5a3 (19 revisions) 2022-03-28 05:25:45 +00:00
DIR_METADATA
go_repositories.bzl [bazel] Use bazel to build task drivers 2022-03-03 16:12:18 +00:00
go.mod [bazel] Make use of test_on_env to spin up server for gms 2022-02-28 14:05:54 +00:00
go.sum [bazel] Make use of test_on_env to spin up server for gms 2022-02-28 14:05:54 +00:00
LICENSE
OWNERS [infra] Add wildcard OWNERS 2021-08-30 19:19:34 +00:00
OWNERS.android Update OWNERS.android with more details 2022-03-16 18:13:33 +00:00
package-lock.json [bazel] Make custom karma_test rule 2022-02-23 14:53:01 +00:00
package.json [bazel] Make custom karma_test rule 2022-02-23 14:53:01 +00:00
PRESUBMIT.py Remove AUTHORS check from PRESUBMIT.py 2021-09-30 14:12:18 +00:00
public.bzl remove jpeg from android builds flagged with no_codec 2022-02-14 19:29:10 +00:00
README
README.chromium
RELEASE_NOTES.txt Revert "Always apply mipmap sharpening on GPU" 2022-03-24 13:56:27 +00:00
requirements.txt [bazel] Use hermetic Python with jinja2+MarkupSafe 2022-03-28 13:56:16 +00:00
whitespace.txt Push shaders.skia.org. 2022-01-19 21:46:16 +00:00
WORKSPACE.bazel [bazel] Use hermetic Python with jinja2+MarkupSafe 2022-03-28 13:56:16 +00:00

Skia is a complete 2D graphic library for drawing Text, Geometries, and Images.

See full details, and build instructions, at https://skia.org.