Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions swift/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ pkg_filegroup(
":extractor",
":swift-test-sdk-arch",
] + select({
"@platforms//os:linux": [
":incompatible-os",
],
"@platforms//os:macos": [
":xcode-autobuilder",
],
"//conditions:default": [
":incompatible-os",
],
Comment on lines +83 to +85

@redsun82 redsun82 Jun 13, 2023

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be something like

pkg_filegroup(
    name = "extractor-pack-arch",
    srcs = select({
        "@platforms//os:windows": [],
        "//conditions:default": [
            ":extractor",
            ":swift-test-sdk-arch",
        ],
    }) + select({
        "@platforms//os:macos": [
            ":xcode-autobuilder",
        ],
        "//conditions:default": [
            ":incompatible-os",
        ],
    }),
    visibility = ["//visibility:public"],
)

or should this be postponed to a follow-up PR where the whole extractor-pack can be built on Windows (including a Windows version of extractor-pack-generic, probably with just an autobuild.cmd)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I was planning on doing this in a follow-up PR, but see my comment to Geoff below: I'm now leaning towards adding all the commits here instead.

}),
visibility = ["//visibility:public"],
)
Expand Down
4 changes: 4 additions & 0 deletions swift/logging/SwiftLogging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 7 additions & 5 deletions swift/rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 2 additions & 0 deletions swift/tools/autobuilder-diagnostics/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ swift_cc_binary(
deps = [
"//swift/logging",
],
# No restrictions (Windows allowed)
target_compatible_with = [],
)