summaryrefslogtreecommitdiffstats
path: root/src/tools/rustc-workspace-hack
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/tools/rustc-workspace-hack
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/rustc-workspace-hack')
-rw-r--r--src/tools/rustc-workspace-hack/Cargo.toml100
-rw-r--r--src/tools/rustc-workspace-hack/README.md25
-rw-r--r--src/tools/rustc-workspace-hack/lib.rs1
3 files changed, 126 insertions, 0 deletions
diff --git a/src/tools/rustc-workspace-hack/Cargo.toml b/src/tools/rustc-workspace-hack/Cargo.toml
new file mode 100644
index 000000000..b1d8b8649
--- /dev/null
+++ b/src/tools/rustc-workspace-hack/Cargo.toml
@@ -0,0 +1,100 @@
+[package]
+name = "rustc-workspace-hack"
+version = "1.0.0"
+license = 'MIT OR Apache-2.0'
+description = """
+Hack for the compiler's own build system
+"""
+edition = "2021"
+
+[lib]
+path = "lib.rs"
+
+# For documentation about what this is and why in the world these dependencies
+# are appearing, see `README.md`.
+
+[target.'cfg(windows)'.dependencies.winapi]
+version = "0.3"
+features = [
+ "accctrl",
+ "aclapi",
+ "basetsd",
+ "cfg",
+ "consoleapi",
+ "errhandlingapi",
+ "evntrace",
+ "fibersapi",
+ "in6addr",
+ "inaddr",
+ "ioapiset",
+ "jobapi",
+ "jobapi2",
+ "knownfolders",
+ "libloaderapi",
+ "lmcons",
+ "memoryapi",
+ "minschannel",
+ "minwinbase",
+ "mstcpip",
+ "mswsock",
+ "namedpipeapi",
+ "ntdef",
+ "ntsecapi",
+ "ntstatus",
+ "objbase",
+ "processenv",
+ "processthreadsapi",
+ "profileapi",
+ "psapi",
+ "schannel",
+ "securitybaseapi",
+ "shellapi",
+ "shlobj",
+ "sspi",
+ "synchapi",
+ "sysinfoapi",
+ "threadpoollegacyapiset",
+ "timezoneapi",
+ "userenv",
+ "winbase",
+ "wincon",
+ "wincrypt",
+ "windef",
+ "winioctl",
+ "winnt",
+ "winreg",
+ "winsock2",
+ "winuser",
+ "ws2def",
+ "ws2ipdef",
+ "ws2tcpip",
+]
+
+[dependencies]
+bstr = { version = "0.2.17", features = ["default"] }
+byteorder = { version = "1", features = ['default', 'std'] }
+clap = { version = "3.1.1", features = ["derive", "clap_derive"]}
+curl-sys = { version = "0.4.13", features = ["http2", "libnghttp2-sys"], optional = true }
+crossbeam-utils = { version = "0.8.0", features = ["nightly"] }
+libc = { version = "0.2.79", features = ["align"] }
+# Ensure default features of libz-sys, which are disabled in some scenarios.
+libz-sys = { version = "1.1.2" }
+# The only user of memchr's deprecated `use_std` feature is `combine`, so this can be
+# removed if/when https://github.com/Marwes/combine/pull/348 is merged and released.
+memchr = { version = "2.5", features = ["std", "use_std"] }
+# Ensure default features of regex, which are disabled in some scenarios.
+regex = { version = "1.5.6" }
+proc-macro2 = { version = "1", features = ["default"] }
+quote = { version = "1", features = ["default"] }
+rand_core_0_5 = { package = "rand_core", version = "0.5.1", features = ["getrandom", "alloc", "std"] }
+serde = { version = "1.0.82", features = ['derive'] }
+serde_json = { version = "1.0.31", features = ["raw_value", "unbounded_depth"] }
+smallvec = { version = "1.8.1", features = ['union', 'may_dangle'] }
+syn = { version = "1", features = ['fold', 'full', 'extra-traits', 'visit', 'visit-mut'] }
+url = { version = "2.0", features = ['serde'] }
+
+[target.'cfg(not(windows))'.dependencies]
+openssl = { version = "0.10.35", optional = true }
+
+[features]
+all-static = ['openssl/vendored', 'curl-sys/static-curl', 'curl-sys/force-system-lib-on-osx']
diff --git a/src/tools/rustc-workspace-hack/README.md b/src/tools/rustc-workspace-hack/README.md
new file mode 100644
index 000000000..4a5286fae
--- /dev/null
+++ b/src/tools/rustc-workspace-hack/README.md
@@ -0,0 +1,25 @@
+# `rustc-workspace-hack`
+
+This crate is a bit of a hack to make workspaces in rustc work a bit better.
+The rationale for this existence is a bit subtle, but the general idea is that
+we want commands like `./x.py build src/tools/{rls,clippy,cargo}` to share as
+many dependencies as possible.
+
+Each invocation is a different invocation of Cargo, however. Each time Cargo
+runs a build it will re-resolve the dependency graph, notably selecting
+different features sometimes for each build.
+
+For example, let's say there's a very deep dependency like `num-traits` in each
+of these builds. For Cargo the `num-traits`'s `default` feature is turned off.
+In RLS, however, the `default` feature is turned. This means that building Cargo
+and then the RLS will actually build Cargo twice (as a transitive dependency
+changed). This is bad!
+
+The goal of this crate is to solve this problem and ensure that the resolved
+dependency graph for all of these tools is the same in the various subsets of
+each tool, notably enabling the same features of transitive dependencies.
+
+All tools vendored here depend on the `rustc-workspace-hack` crate on crates.io.
+When on crates.io this crate is an empty crate that is just a noop. We override
+it, however, in this workspace to this crate here, which means we can control
+crates in the dependency graph for each of these tools.
diff --git a/src/tools/rustc-workspace-hack/lib.rs b/src/tools/rustc-workspace-hack/lib.rs
new file mode 100644
index 000000000..44425d9c1
--- /dev/null
+++ b/src/tools/rustc-workspace-hack/lib.rs
@@ -0,0 +1 @@
+// intentionally left blank