Skip to content
Merged
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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions crates/ty/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,11 @@ regex = { workspace = true }
tempfile = { workspace = true }
toml = { workspace = true }

[features]
default = []

[target.'cfg(all(not(target_os = "macos"), not(target_os = "windows"), not(target_os = "openbsd"), not(target_os = "aix"), not(target_os = "android"), any(target_arch = "x86_64", target_arch = "aarch64", target_arch = "powerpc64", target_arch = "riscv64")))'.dependencies]
tikv-jemallocator = { workspace = true }

[lints]
workspace = true
16 changes: 16 additions & 0 deletions crates/ty/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@ use colored::Colorize;
use std::io;
use ty::{ExitStatus, run};

#[cfg(all(
not(target_os = "macos"),
not(target_os = "windows"),
not(target_os = "openbsd"),
not(target_os = "aix"),
not(target_os = "android"),
any(
target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "powerpc64",
target_arch = "riscv64"
)
))]
#[global_allocator]
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
Comment on lines +5 to +19
Copy link
Contributor

Choose a reason for hiding this comment

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

We do something very similar in fd, and had to add more and more exclusions over the years. Might be worth comparing the lists(?).

Unrelated, it might be good to add a comment here and in Cargo.toml that the filtering rules need to be kept in sync? We don't test on all of these platforms..

Copy link
Member

Choose a reason for hiding this comment

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

For reference, I believe this is the same as in Ruff (except you're also omitting macOS (intentionally)). In uv, it looks like we use:

#[cfg(all(
    not(target_os = "windows"),
    not(target_os = "openbsd"),
    not(target_os = "freebsd"),
    any(
        target_arch = "x86_64",
        target_arch = "aarch64",
        target_arch = "powerpc64"
    )
))]
#[global_allocator]
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it's the same as Ruff, but excluding macos for the reasons described in the PR summary


pub fn main() -> ExitStatus {
run().unwrap_or_else(|error| {
use io::Write;
Expand Down
7 changes: 6 additions & 1 deletion scripts/ty_benchmark/src/benchmark/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def main() -> None:

parser.add_argument(
"--ty-path",
action="append",
type=Path,
help="Path to the ty binary to benchmark.",
)
Expand Down Expand Up @@ -108,7 +109,11 @@ def main() -> None:
for tool_name in args.tool or TOOL_CHOICES:
match tool_name:
case "ty":
suites.append(Ty(path=args.ty_path))
if args.ty_path:
for path in args.ty_path:
suites.append(Ty(path=path))
else:
suites.append(Ty())
case "pyrefly":
suites.append(Pyrefly())
case "pyright":
Expand Down
Loading