[package]
name = "turbo-tasks-fetch"
version = "0.1.0"
description = "TBD"
license = "MIT"
edition = "2024"
[lib]
bench = false
[lints]
workspace = true
[dependencies]
anyhow = { workspace = true }
async-trait = { workspace = true }
quick_cache = { workspace = true }
serde = { workspace = true }
tokio = { workspace = true }
turbo-rcstr = { workspace = true }
turbo-tasks = { workspace = true }
turbo-tasks-fs = { workspace = true }
turbopack-core = { workspace = true }
# Enable specific tls features per-target.
#
# Be careful when selecting tls backend. If you must verify ALL build targets of
# next-swc to ensure it works. next-swc have various platforms, some don't
# support native-tls (using openssl-sys) and some aren't buildable with rustls.
#
# The TLS backend used must match with the construction of `request::Client` in
# `src/client.rs`.
# On macOS, use the default rustls configuration (uses aws-lc-rs).
[target.'cfg(target_os = "macos")'.dependencies]
reqwest = { workspace = true, features = ["rustls"] }
# On Linux (all architectures) and Windows x86-64, use ring for rustls.
# - Linux: aws-lc-rs has cross-compilation issues in our CI:
# https://github.com/aws/aws-lc-rs/issues/673
# - On Linux, linking with the native SSL library can be distro-dependent, so
# it's easier for us to statically link ring or aws-lc-rs.
# - Windows: aws-lc-sys requires NASM and CMake which we don't have installed in
# CI, and would complicate the development environment setup. We could
# possibly switch to always using `native-tls` on Windows in the future.
[target.'cfg(any(target_os = "linux", all(windows, not(target_arch = "aarch64"))))'.dependencies]
reqwest = { workspace = true, features = ["rustls-no-provider"] }
rustls = { version = "0.23", default-features = false, features = ["ring", "std", "tls12"] }
# On Linux, we need to add webpki-roots, in case the user is building a bare-bones docker image that
# does not contain any root certs (e.g. `oven/bun:slim`). See footnote #2 here:
# https://github.com/rustls/rustls-platform-verifier/tree/93f729c6309680486d33f982e3ba3c42b976f774?tab=readme-ov-file#user-content-fn-3-7402e7116652999a2e8c2860b94080eb
#
# It would be more ideal to use the smaller `webpki-roots` crate instead of `webpki-root-certs`, but
# API limitations of reqwest require us to get the full certificate:
# https://github.com/seanmonstar/reqwest/discussions/2906#discussioncomment-15483148
[target.'cfg(target_os = "linux")'.dependencies]
webpki-root-certs = "1"
# On Windows ARM64, use native-tls because rustls with ring has build issues.
[target.'cfg(all(windows, target_arch = "aarch64"))'.dependencies]
reqwest = { workspace = true, features = ["native-tls"] }
[dev-dependencies]
mockito = { version = "1.7.0", default-features = false }
tokio = { workspace = true, features = ["full"] }
turbo-tasks-testing = { workspace = true }
turbo-tasks-backend = { workspace = true }