Prepare the workspace crates for publishing on crates.io

crates.io packages cannot depend on git repositories or unversioned
paths. mold now uses the mimalloc fork published as mold-mimalloc, and
each workspace crate requires the exact version of the others because
they depend on each other's internals. The packages also get crates.io
metadata, and the libmold package includes only the files needed to
build it.
This commit is contained in:
Rui Ueyama committed 2026-10-07 07:30:19 +09:00
1 parent e4e0ad7c92
commit 37c0756898
23 files changed
+113 -61

No files matched your search

Generated
+19 -17
View File
@@ -185,14 +185,6 @@ version = "0.2.189"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
[[package]]
name = "libmimalloc-sys"
version = "0.1.49"
source = "git+https://github.com/rui314/mimalloc_rust?rev=3979460494f1cd1e7f936cb8e10f41e927c9f698#3979460494f1cd1e7f936cb8e10f41e927c9f698"
dependencies = [
"cc",
]
[[package]]
name = "libmold"
version = "3.0.0"
@@ -242,20 +234,11 @@ dependencies = [
"libc",
]
[[package]]
name = "mimalloc"
version = "0.1.52"
source = "git+https://github.com/rui314/mimalloc_rust?rev=3979460494f1cd1e7f936cb8e10f41e927c9f698#3979460494f1cd1e7f936cb8e10f41e927c9f698"
dependencies = [
"libmimalloc-sys",
]
[[package]]
name = "mold"
version = "3.0.0"
dependencies = [
"libmold",
"mimalloc",
"mold-arch-arm32",
"mold-arch-arm32be",
"mold-arch-arm64",
@@ -276,6 +259,7 @@ dependencies = [
"mold-arch-sh4be",
"mold-arch-sparc64",
"mold-arch-x86_64",
"mold-mimalloc",
"mold-tests",
]
@@ -419,6 +403,24 @@ dependencies = [
"libmold",
]
[[package]]
name = "mold-mimalloc"
version = "0.1.52"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b7efd1b6c74e7a09c1d296af4875b79118a5ea32d70736601a8323ddcbcb4c2"
dependencies = [
"mold-mimalloc-sys",
]
[[package]]
name = "mold-mimalloc-sys"
version = "0.1.49"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "66a79c372cdbf45bf4548fd4aa40a0b2805ef2ee8e25e5185e11bf2b5c5de366"
dependencies = [
"cc",
]
[[package]]
name = "mold-tests"
version = "3.0.0"
+28 -2
View File
@@ -3,10 +3,12 @@ name = "libmold"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
description = "A high-performance ELF linker, rewritten in Rust"
description = "The internal library of the mold linker, whose API is not stable"
license.workspace = true
repository.workspace = true
# tests/lib.rs belongs to the mold-tests workspace crate.
autotests = false
include = ["/src", "/c", "/build.rs", "/LICENSE", "/README.md"]
# The linker is generic over the target. Instantiating it for all twenty
# targets in one crate keeps the compiler on a single core for minutes, so
@@ -21,10 +23,34 @@ version = "3.0.0"
edition = "2024"
rust-version = "1.95"
license = "MIT"
repository = "https://github.com/rui314/mold"
# The workspace crates are published together and depend on each other's
# internals, so each one requires the exact version of the others. Keep
# these versions equal to the workspace version above.
[workspace.dependencies]
libc = "0.2"
libmold = { path = "." }
libmold = { path = ".", version = "=3.0.0" }
mold-arch-x86_64 = { path = "arch/x86_64", version = "=3.0.0" }
mold-arch-i386 = { path = "arch/i386", version = "=3.0.0" }
mold-arch-arm32 = { path = "arch/arm32", version = "=3.0.0" }
mold-arch-arm32be = { path = "arch/arm32be", version = "=3.0.0" }
mold-arch-arm64 = { path = "arch/arm64", version = "=3.0.0" }
mold-arch-arm64be = { path = "arch/arm64be", version = "=3.0.0" }
mold-arch-riscv64 = { path = "arch/riscv64", version = "=3.0.0" }
mold-arch-riscv64be = { path = "arch/riscv64be", version = "=3.0.0" }
mold-arch-riscv32 = { path = "arch/riscv32", version = "=3.0.0" }
mold-arch-riscv32be = { path = "arch/riscv32be", version = "=3.0.0" }
mold-arch-ppc64v2 = { path = "arch/ppc64v2", version = "=3.0.0" }
mold-arch-ppc32 = { path = "arch/ppc32", version = "=3.0.0" }
mold-arch-ppc64v1 = { path = "arch/ppc64v1", version = "=3.0.0" }
mold-arch-s390x = { path = "arch/s390x", version = "=3.0.0" }
mold-arch-sparc64 = { path = "arch/sparc64", version = "=3.0.0" }
mold-arch-m68k = { path = "arch/m68k", version = "=3.0.0" }
mold-arch-sh4 = { path = "arch/sh4", version = "=3.0.0" }
mold-arch-sh4be = { path = "arch/sh4be", version = "=3.0.0" }
mold-arch-loongarch64 = { path = "arch/loongarch64", version = "=3.0.0" }
mold-arch-loongarch32 = { path = "arch/loongarch32", version = "=3.0.0" }
[dependencies]
blake3 = "1.8.7"
+2 -1
View File
@@ -3,8 +3,9 @@ name = "mold-arch-arm32"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
description = "The mold linker instantiated for arm32"
description = "An internal crate of the mold linker, which instantiates it for arm32"
license.workspace = true
repository.workspace = true
[lib]
path = "lib.rs"
+2 -1
View File
@@ -3,8 +3,9 @@ name = "mold-arch-arm32be"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
description = "The mold linker instantiated for arm32be"
description = "An internal crate of the mold linker, which instantiates it for arm32be"
license.workspace = true
repository.workspace = true
[lib]
path = "lib.rs"
+2 -1
View File
@@ -3,8 +3,9 @@ name = "mold-arch-arm64"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
description = "The mold linker instantiated for arm64"
description = "An internal crate of the mold linker, which instantiates it for arm64"
license.workspace = true
repository.workspace = true
[lib]
path = "lib.rs"
+2 -1
View File
@@ -3,8 +3,9 @@ name = "mold-arch-arm64be"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
description = "The mold linker instantiated for arm64be"
description = "An internal crate of the mold linker, which instantiates it for arm64be"
license.workspace = true
repository.workspace = true
[lib]
path = "lib.rs"
+2 -1
View File
@@ -3,8 +3,9 @@ name = "mold-arch-i386"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
description = "The mold linker instantiated for i386"
description = "An internal crate of the mold linker, which instantiates it for i386"
license.workspace = true
repository.workspace = true
[lib]
path = "lib.rs"
+2 -1
View File
@@ -3,8 +3,9 @@ name = "mold-arch-loongarch32"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
description = "The mold linker instantiated for loongarch32"
description = "An internal crate of the mold linker, which instantiates it for loongarch32"
license.workspace = true
repository.workspace = true
[lib]
path = "lib.rs"
+2 -1
View File
@@ -3,8 +3,9 @@ name = "mold-arch-loongarch64"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
description = "The mold linker instantiated for loongarch64"
description = "An internal crate of the mold linker, which instantiates it for loongarch64"
license.workspace = true
repository.workspace = true
[lib]
path = "lib.rs"
+2 -1
View File
@@ -3,8 +3,9 @@ name = "mold-arch-m68k"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
description = "The mold linker instantiated for m68k"
description = "An internal crate of the mold linker, which instantiates it for m68k"
license.workspace = true
repository.workspace = true
[lib]
path = "lib.rs"
+2 -1
View File
@@ -3,8 +3,9 @@ name = "mold-arch-ppc32"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
description = "The mold linker instantiated for ppc32"
description = "An internal crate of the mold linker, which instantiates it for ppc32"
license.workspace = true
repository.workspace = true
[lib]
path = "lib.rs"
+2 -1
View File
@@ -3,8 +3,9 @@ name = "mold-arch-ppc64v1"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
description = "The mold linker instantiated for ppc64v1"
description = "An internal crate of the mold linker, which instantiates it for ppc64v1"
license.workspace = true
repository.workspace = true
[lib]
path = "lib.rs"
+2 -1
View File
@@ -3,8 +3,9 @@ name = "mold-arch-ppc64v2"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
description = "The mold linker instantiated for ppc64v2"
description = "An internal crate of the mold linker, which instantiates it for ppc64v2"
license.workspace = true
repository.workspace = true
[lib]
path = "lib.rs"
+2 -1
View File
@@ -3,8 +3,9 @@ name = "mold-arch-riscv32"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
description = "The mold linker instantiated for riscv32"
description = "An internal crate of the mold linker, which instantiates it for riscv32"
license.workspace = true
repository.workspace = true
[lib]
path = "lib.rs"
+2 -1
View File
@@ -3,8 +3,9 @@ name = "mold-arch-riscv32be"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
description = "The mold linker instantiated for riscv32be"
description = "An internal crate of the mold linker, which instantiates it for riscv32be"
license.workspace = true
repository.workspace = true
[lib]
path = "lib.rs"
+2 -1
View File
@@ -3,8 +3,9 @@ name = "mold-arch-riscv64"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
description = "The mold linker instantiated for riscv64"
description = "An internal crate of the mold linker, which instantiates it for riscv64"
license.workspace = true
repository.workspace = true
[lib]
path = "lib.rs"
+2 -1
View File
@@ -3,8 +3,9 @@ name = "mold-arch-riscv64be"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
description = "The mold linker instantiated for riscv64be"
description = "An internal crate of the mold linker, which instantiates it for riscv64be"
license.workspace = true
repository.workspace = true
[lib]
path = "lib.rs"
+2 -1
View File
@@ -3,8 +3,9 @@ name = "mold-arch-s390x"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
description = "The mold linker instantiated for s390x"
description = "An internal crate of the mold linker, which instantiates it for s390x"
license.workspace = true
repository.workspace = true
[lib]
path = "lib.rs"
+2 -1
View File
@@ -3,8 +3,9 @@ name = "mold-arch-sh4"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
description = "The mold linker instantiated for sh4"
description = "An internal crate of the mold linker, which instantiates it for sh4"
license.workspace = true
repository.workspace = true
[lib]
path = "lib.rs"
+2 -1
View File
@@ -3,8 +3,9 @@ name = "mold-arch-sh4be"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
description = "The mold linker instantiated for sh4be"
description = "An internal crate of the mold linker, which instantiates it for sh4be"
license.workspace = true
repository.workspace = true
[lib]
path = "lib.rs"
+2 -1
View File
@@ -3,8 +3,9 @@ name = "mold-arch-sparc64"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
description = "The mold linker instantiated for sparc64"
description = "An internal crate of the mold linker, which instantiates it for sparc64"
license.workspace = true
repository.workspace = true
[lib]
path = "lib.rs"
+2 -1
View File
@@ -3,8 +3,9 @@ name = "mold-arch-x86_64"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
description = "The mold linker instantiated for x86_64"
description = "An internal crate of the mold linker, which instantiates it for x86_64"
license.workspace = true
repository.workspace = true
[lib]
path = "lib.rs"
+26 -22
View File
@@ -3,8 +3,12 @@ name = "mold"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
description = "The mold executable"
description = "A high-performance ELF linker, rewritten in Rust"
license.workspace = true
repository.workspace = true
readme = "../README.md"
keywords = ["linker", "elf"]
categories = ["command-line-utilities", "development-tools::build-utils"]
[[bin]]
name = "mold"
@@ -16,28 +20,28 @@ path = "integration.rs"
harness = false
[dependencies]
mimalloc = { git = "https://github.com/rui314/mimalloc_rust", rev = "3979460494f1cd1e7f936cb8e10f41e927c9f698" }
mimalloc = { package = "mold-mimalloc", version = "0.1.52" }
libmold.workspace = true
mold-arch-x86_64 = { path = "../arch/x86_64", optional = true }
mold-arch-i386 = { path = "../arch/i386", optional = true }
mold-arch-arm32 = { path = "../arch/arm32", optional = true }
mold-arch-arm32be = { path = "../arch/arm32be", optional = true }
mold-arch-arm64 = { path = "../arch/arm64", optional = true }
mold-arch-arm64be = { path = "../arch/arm64be", optional = true }
mold-arch-riscv64 = { path = "../arch/riscv64", optional = true }
mold-arch-riscv64be = { path = "../arch/riscv64be", optional = true }
mold-arch-riscv32 = { path = "../arch/riscv32", optional = true }
mold-arch-riscv32be = { path = "../arch/riscv32be", optional = true }
mold-arch-ppc64v2 = { path = "../arch/ppc64v2", optional = true }
mold-arch-ppc32 = { path = "../arch/ppc32", optional = true }
mold-arch-ppc64v1 = { path = "../arch/ppc64v1", optional = true }
mold-arch-s390x = { path = "../arch/s390x", optional = true }
mold-arch-sparc64 = { path = "../arch/sparc64", optional = true }
mold-arch-m68k = { path = "../arch/m68k", optional = true }
mold-arch-sh4 = { path = "../arch/sh4", optional = true }
mold-arch-sh4be = { path = "../arch/sh4be", optional = true }
mold-arch-loongarch64 = { path = "../arch/loongarch64", optional = true }
mold-arch-loongarch32 = { path = "../arch/loongarch32", optional = true }
mold-arch-x86_64 = { workspace = true, optional = true }
mold-arch-i386 = { workspace = true, optional = true }
mold-arch-arm32 = { workspace = true, optional = true }
mold-arch-arm32be = { workspace = true, optional = true }
mold-arch-arm64 = { workspace = true, optional = true }
mold-arch-arm64be = { workspace = true, optional = true }
mold-arch-riscv64 = { workspace = true, optional = true }
mold-arch-riscv64be = { workspace = true, optional = true }
mold-arch-riscv32 = { workspace = true, optional = true }
mold-arch-riscv32be = { workspace = true, optional = true }
mold-arch-ppc64v2 = { workspace = true, optional = true }
mold-arch-ppc32 = { workspace = true, optional = true }
mold-arch-ppc64v1 = { workspace = true, optional = true }
mold-arch-s390x = { workspace = true, optional = true }
mold-arch-sparc64 = { workspace = true, optional = true }
mold-arch-m68k = { workspace = true, optional = true }
mold-arch-sh4 = { workspace = true, optional = true }
mold-arch-sh4be = { workspace = true, optional = true }
mold-arch-loongarch64 = { workspace = true, optional = true }
mold-arch-loongarch32 = { workspace = true, optional = true }
[dev-dependencies]
mold-tests = { path = "../tests" }