Enable the Copybara sync for all files.

PiperOrigin-RevId: 485351777
pull/10867/head
Joshua Haberman 2 years ago committed by Copybara-Service
parent 3c0f05c1fa
commit 0ff26563c9
  1. 70
      python/docs/make.bat
  2. 3
      ruby/internal.bzl
  3. 358
      toolchain/cc_toolchain_config.bzl

@ -1,35 +1,35 @@
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
:end
popd
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
:end
popd

@ -15,7 +15,6 @@ def internal_ruby_extension(
**kwargs: extra arguments to forward to the genrule.
"""
native.genrule(
name = name,
srcs = deps + [
@ -31,5 +30,5 @@ def internal_ruby_extension(
"BAZEL=true rake\n" +
"popd\n" +
"cp `dirname $(location Rakefile)`/%s $(OUTS)\n" % extension,
**kwargs,
**kwargs
)

@ -29,193 +29,193 @@ all_compile_actions = [
]
def _impl(ctx):
if "mingw" in ctx.attr.target_full_name:
artifact_name_patterns = [
artifact_name_pattern(
category_name = "executable",
prefix = "",
extension = ".exe",
),
]
else:
artifact_name_patterns = []
if "mingw" in ctx.attr.target_full_name:
artifact_name_patterns = [
artifact_name_pattern(
category_name = "executable",
prefix = "",
extension = ".exe",
),
]
else:
artifact_name_patterns = []
tool_paths = [
tool_path(
name = "gcc",
path = "/usr/local/bin/clang",
),
tool_path(
name = "ld",
path = ctx.attr.linker_path,
),
tool_path(
name = "ar",
path = "/usr/local/bin/llvm-ar",
),
tool_path(
name = "compat-ld",
path = ctx.attr.linker_path,
),
tool_path(
name = "cpp",
path = "/bin/false",
),
tool_path(
name = "dwp",
path = "/bin/false",
),
tool_path(
name = "gcov",
path = "/bin/false",
),
tool_path(
name = "nm",
path = "/bin/false",
),
tool_path(
name = "objcopy",
path = "/bin/false",
),
tool_path(
name = "objdump",
path = "/bin/false",
),
tool_path(
name = "strip",
path = "/bin/false",
),
]
tool_paths = [
tool_path(
name = "gcc",
path = "/usr/local/bin/clang",
),
tool_path(
name = "ld",
path = ctx.attr.linker_path,
),
tool_path(
name = "ar",
path = "/usr/local/bin/llvm-ar",
),
tool_path(
name = "compat-ld",
path = ctx.attr.linker_path,
),
tool_path(
name = "cpp",
path = "/bin/false",
),
tool_path(
name = "dwp",
path = "/bin/false",
),
tool_path(
name = "gcov",
path = "/bin/false",
),
tool_path(
name = "nm",
path = "/bin/false",
),
tool_path(
name = "objcopy",
path = "/bin/false",
),
tool_path(
name = "objdump",
path = "/bin/false",
),
tool_path(
name = "strip",
path = "/bin/false",
),
]
linker_flags = feature(
name = "default_linker_flags",
enabled = True,
flag_sets = [
flag_set(
actions = all_link_actions,
flag_groups = [
flag_group(
flags = [
"-B" + ctx.attr.linker_path,
"-lstdc++",
"--target=" + ctx.attr.target_full_name,
] + ctx.attr.extra_linker_flags,
),
],
),
],
)
linker_flags = feature(
name = "default_linker_flags",
enabled = True,
flag_sets = [
flag_set(
actions = all_link_actions,
flag_groups = [
flag_group(
flags = [
"-B" + ctx.attr.linker_path,
"-lstdc++",
"--target=" + ctx.attr.target_full_name,
] + ctx.attr.extra_linker_flags,
),
],
),
],
)
if "osx" in ctx.attr.target_full_name:
sysroot_action_set = all_link_actions
else:
sysroot_action_set = all_link_actions + all_compile_actions
if "osx" in ctx.attr.target_full_name:
sysroot_action_set = all_link_actions
else:
sysroot_action_set = all_link_actions + all_compile_actions
sysroot_flags = feature(
name = "sysroot_flags",
#Only enable this if a sysroot was specified
enabled = (ctx.attr.sysroot != ""),
flag_sets = [
flag_set(
actions = sysroot_action_set,
flag_groups = [
flag_group(
flags = [
"--sysroot",
ctx.attr.sysroot,
],
),
],
),
],
)
sysroot_flags = feature(
name = "sysroot_flags",
#Only enable this if a sysroot was specified
enabled = (ctx.attr.sysroot != ""),
flag_sets = [
flag_set(
actions = sysroot_action_set,
flag_groups = [
flag_group(
flags = [
"--sysroot",
ctx.attr.sysroot,
],
),
],
),
],
)
if ctx.attr.target_cpu == "x86_32":
bit_flag = "-m32"
else:
bit_flag = "-m64"
compiler_flags = feature(
name = "default_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = all_compile_actions,
flag_groups = [
flag_group(
flags = [
bit_flag,
"-Wall",
"-no-canonical-prefixes",
"--target=" + ctx.attr.target_full_name,
"-fvisibility=hidden",
] + ctx.attr.extra_compiler_flags + [
"-isystem",
ctx.attr.sysroot,
],
),
],
),
flag_set(
actions = all_compile_actions,
flag_groups = [flag_group(flags = ["-DNDEBUG", "-O3"])],
with_features = [with_feature_set(features = ["opt"])],
),
flag_set(
actions = all_compile_actions,
flag_groups = [flag_group(flags = ["-g"])],
with_features = [with_feature_set(features = ["dbg"])],
),
flag_set(
actions = all_compile_actions,
flag_groups = [flag_group(flags = ["-O1"])],
with_features = [with_feature_set(features = ["fastbuild"])],
),
],
)
if ctx.attr.target_cpu == "x86_32":
bit_flag = "-m32"
else:
bit_flag = "-m64"
compiler_flags = feature(
name = "default_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = all_compile_actions,
flag_groups = [
flag_group(
flags = [
bit_flag,
"-Wall",
"-no-canonical-prefixes",
"--target=" + ctx.attr.target_full_name,
"-fvisibility=hidden",
] + ctx.attr.extra_compiler_flags + [
"-isystem",
ctx.attr.sysroot,
],
),
],
),
flag_set(
actions = all_compile_actions,
flag_groups = [flag_group(flags = ["-DNDEBUG", "-O3"])],
with_features = [with_feature_set(features = ["opt"])],
),
flag_set(
actions = all_compile_actions,
flag_groups = [flag_group(flags = ["-g"])],
with_features = [with_feature_set(features = ["dbg"])],
),
flag_set(
actions = all_compile_actions,
flag_groups = [flag_group(flags = ["-O1"])],
with_features = [with_feature_set(features = ["fastbuild"])],
),
],
)
features = [
linker_flags,
compiler_flags,
sysroot_flags,
feature(name = "dbg"),
feature(name = "opt"),
]
features = [
linker_flags,
compiler_flags,
sysroot_flags,
feature(name = "dbg"),
feature(name = "opt"),
]
if "mingw" in ctx.attr.target_full_name:
features.append(
feature(
name = "targets_windows",
enabled = True,
)
)
else:
features.append(
feature(
name = "supports_pic",
enabled = True
)
)
if "mingw" in ctx.attr.target_full_name:
features.append(
feature(
name = "targets_windows",
enabled = True,
),
)
else:
features.append(
feature(
name = "supports_pic",
enabled = True,
),
)
return cc_common.create_cc_toolchain_config_info(
abi_libc_version = ctx.attr.abi_version,
abi_version = ctx.attr.abi_version,
artifact_name_patterns = artifact_name_patterns,
ctx = ctx,
compiler = "clang",
cxx_builtin_include_directories = [
ctx.attr.sysroot,
ctx.attr.extra_include,
"/usr/local/include",
"/usr/local/lib/clang",
],
features = features,
host_system_name = "local",
target_cpu = ctx.attr.target_cpu,
target_libc = ctx.attr.target_cpu,
target_system_name = ctx.attr.target_full_name,
toolchain_identifier = ctx.attr.target_full_name,
tool_paths = tool_paths,
)
return cc_common.create_cc_toolchain_config_info(
abi_libc_version = ctx.attr.abi_version,
abi_version = ctx.attr.abi_version,
artifact_name_patterns = artifact_name_patterns,
ctx = ctx,
compiler = "clang",
cxx_builtin_include_directories = [
ctx.attr.sysroot,
ctx.attr.extra_include,
"/usr/local/include",
"/usr/local/lib/clang",
],
features = features,
host_system_name = "local",
target_cpu = ctx.attr.target_cpu,
target_libc = ctx.attr.target_cpu,
target_system_name = ctx.attr.target_full_name,
toolchain_identifier = ctx.attr.target_full_name,
tool_paths = tool_paths,
)
cc_toolchain_config = rule(
implementation = _impl,

Loading…
Cancel
Save