зеркало из https://github.com/github/codeql.git
Merge pull request #13447 from github/sashabu/windows2
Swift: Bare-bones extractor pack for Windows.
This commit is contained in:
Коммит
61a3f86f0f
8
.bazelrc
8
.bazelrc
|
@ -1,3 +1,9 @@
|
|||
build --repo_env=CC=clang --repo_env=CXX=clang++ --cxxopt="-std=c++20"
|
||||
common --enable_platform_specific_config
|
||||
|
||||
build --repo_env=CC=clang --repo_env=CXX=clang++
|
||||
|
||||
build:linux --cxxopt=-std=c++20
|
||||
build:macos --cxxopt=-std=c++20 --cpu=darwin_x86_64
|
||||
build:windows --cxxopt=/std:c++20 --cxxopt=/Zc:preprocessor
|
||||
|
||||
try-import %workspace%/local.bazelrc
|
||||
|
|
|
@ -38,11 +38,15 @@ pkg_files(
|
|||
pkg_filegroup(
|
||||
name = "extractor-pack-generic",
|
||||
srcs = [
|
||||
":dbscheme_files",
|
||||
":manifest",
|
||||
"//swift/downgrades",
|
||||
"//swift/tools",
|
||||
],
|
||||
] + select({
|
||||
"@platforms//os:windows": [],
|
||||
"//conditions:default": [
|
||||
":dbscheme_files",
|
||||
"//swift/downgrades",
|
||||
],
|
||||
}),
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
|
@ -59,8 +63,8 @@ pkg_runfiles(
|
|||
)
|
||||
|
||||
pkg_runfiles(
|
||||
name = "incompatible-os",
|
||||
srcs = ["//swift/tools/autobuilder-diagnostics:incompatible-os"],
|
||||
name = "diagnostics",
|
||||
srcs = ["//swift/tools/diagnostics:autobuilder-incompatible-os"],
|
||||
prefix = "tools/" + codeql_platform,
|
||||
)
|
||||
|
||||
|
@ -80,17 +84,20 @@ pkg_files(
|
|||
|
||||
pkg_filegroup(
|
||||
name = "extractor-pack-arch",
|
||||
srcs = [
|
||||
":extractor",
|
||||
":swift-test-sdk-arch",
|
||||
":resource-dir-arch",
|
||||
] + select({
|
||||
"@platforms//os:linux": [
|
||||
":incompatible-os",
|
||||
srcs = select({
|
||||
"@platforms//os:windows": [],
|
||||
"//conditions:default": [
|
||||
":extractor",
|
||||
":resource-dir-arch",
|
||||
":swift-test-sdk-arch",
|
||||
],
|
||||
}) + select({
|
||||
"@platforms//os:macos": [
|
||||
":xcode-autobuilder",
|
||||
],
|
||||
"//conditions:default": [
|
||||
":diagnostics",
|
||||
],
|
||||
}),
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
@ -122,7 +129,7 @@ generate_cmake(
|
|||
"//swift/extractor:extractor.real",
|
||||
"//swift/logging/tests/assertion-diagnostics:assert-false",
|
||||
] + select({
|
||||
"@platforms//os:linux": ["//swift/tools/autobuilder-diagnostics:incompatible-os"],
|
||||
"@platforms//os:linux": ["//swift/tools/diagnostics:autobuilder-incompatible-os"],
|
||||
"@platforms//os:macos": ["//swift/xcode-autobuilder"],
|
||||
}),
|
||||
visibility = ["//visibility:public"],
|
||||
|
|
|
@ -3,7 +3,11 @@
|
|||
#include <filesystem>
|
||||
#include <stdlib.h>
|
||||
#include <optional>
|
||||
#ifdef _WIN32
|
||||
#include <process.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include "absl/strings/str_cat.h"
|
||||
|
||||
#define LEVEL_REGEX_PATTERN "trace|debug|info|warning|error|critical|no_logs"
|
||||
|
|
|
@ -10,11 +10,13 @@ def _wrap_cc(rule, kwargs):
|
|||
# temporary, before we do universal merging
|
||||
"-universal_binaries",
|
||||
])
|
||||
_add_args(kwargs, "target_compatible_with", select({
|
||||
"@platforms//os:linux": [],
|
||||
"@platforms//os:macos": [],
|
||||
"//conditions:default": ["@platforms//:incompatible"],
|
||||
}))
|
||||
if "target_compatible_with" not in kwargs:
|
||||
# Restrict to Linux or macOS by default, but allow overriding
|
||||
_add_args(kwargs, "target_compatible_with", select({
|
||||
"@platforms//os:linux": [],
|
||||
"@platforms//os:macos": [],
|
||||
"//conditions:default": ["@platforms//:incompatible"],
|
||||
}))
|
||||
rule(**kwargs)
|
||||
|
||||
def swift_cc_binary(**kwargs):
|
||||
|
|
|
@ -19,8 +19,9 @@ sh_binary(
|
|||
pkg_files(
|
||||
name = "scripts",
|
||||
srcs = [
|
||||
":identify-environment",
|
||||
"autobuild.cmd",
|
||||
":autobuild",
|
||||
":identify-environment",
|
||||
":qltest",
|
||||
],
|
||||
attributes = pkg_attributes(mode = "0755"),
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
"%CODEQL_EXTRACTOR_SWIFT_ROOT%/tools/%CODEQL_PLATFORM%/autobuilder-incompatible-os.exe"
|
|
@ -3,5 +3,5 @@
|
|||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
exec "${CODEQL_EXTRACTOR_SWIFT_ROOT}/tools/${CODEQL_PLATFORM}/xcode-autobuilder"
|
||||
else
|
||||
exec "${CODEQL_EXTRACTOR_SWIFT_ROOT}/tools/${CODEQL_PLATFORM}/incompatible-os"
|
||||
exec "${CODEQL_EXTRACTOR_SWIFT_ROOT}/tools/${CODEQL_PLATFORM}/autobuilder-incompatible-os"
|
||||
fi
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
load("//swift:rules.bzl", "swift_cc_binary")
|
||||
|
||||
swift_cc_binary(
|
||||
name = "incompatible-os",
|
||||
srcs = ["IncompatibleOs.cpp"],
|
||||
visibility = ["//swift:__subpackages__"],
|
||||
deps = [
|
||||
"//swift/logging",
|
||||
],
|
||||
)
|
|
@ -0,0 +1,12 @@
|
|||
load("//swift:rules.bzl", "swift_cc_binary")
|
||||
|
||||
swift_cc_binary(
|
||||
name = "autobuilder-incompatible-os",
|
||||
srcs = ["AutobuilderIncompatibleOs.cpp"],
|
||||
# No restrictions (Windows allowed)
|
||||
target_compatible_with = [],
|
||||
visibility = ["//swift:__subpackages__"],
|
||||
deps = [
|
||||
"//swift/logging",
|
||||
],
|
||||
)
|
Загрузка…
Ссылка в новой задаче