Remove cxx and autocxx

Notably this gets rid of the Cargo target directory inside build directories,
in favor of "target/" at workspace root.
This commit is contained in:
Johannes Altmanninger 2024-01-07 21:38:49 +01:00
parent 8a67abfeaa
commit 29bd6eebd0
16 changed files with 29 additions and 970 deletions

View File

@ -48,9 +48,6 @@ endif()
# - address, because that occurs for our mkostemp check (weak-linking requires us to compare `&mkostemp == nullptr`).
add_compile_options(-Wall -Wextra -Wno-comment -Wno-address)
# Get extra C++ files from Rust.
get_property(FISH_EXTRA_SOURCES TARGET fish-rust PROPERTY fish_extra_cpp_files)
if ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"))
add_compile_options(-Wunused-template -Wunused-local-typedef -Wunused-macros)
endif()
@ -61,9 +58,6 @@ add_compile_options(-fno-exceptions)
# Undefine NDEBUG to keep assert() in release builds.
add_definitions(-UNDEBUG)
# Allow including Rust headers in normal (not bindgen) builds.
add_definitions(-DINCLUDE_RUST_HEADERS)
# Enable large files on GNU.
add_definitions(-D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE

739
Cargo.lock generated
View File

@ -13,147 +13,12 @@ dependencies = [
"version_check",
]
[[package]]
name = "aho-corasick"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86b8f9420f797f2d9e935edf629310eb938a0d839f984e25327f3c7eed22300c"
dependencies = [
"memchr",
]
[[package]]
name = "aquamarine"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a941c39708478e8eea39243b5983f1c42d2717b3620ee91f4a52115fd02ac43f"
dependencies = [
"itertools 0.9.0",
"proc-macro-error",
"proc-macro2",
"quote",
"syn 1.0.109",
]
[[package]]
name = "atty"
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
dependencies = [
"hermit-abi",
"libc",
"winapi",
]
[[package]]
name = "autocfg"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "autocxx"
version = "0.23.1"
source = "git+https://github.com/fish-shell/autocxx?branch=fish#f9ed164fed6a35a572d19f1495b0691e4b3fd92b"
dependencies = [
"aquamarine",
"autocxx-macro",
"cxx",
"moveit",
]
[[package]]
name = "autocxx-bindgen"
version = "0.62.0"
source = "git+https://github.com/fish-shell/autocxx-bindgen?branch=fish#a229d3473bd90d2d10fc61a244408cfc1958934a"
dependencies = [
"bitflags 1.3.2",
"cexpr",
"clang-sys",
"itertools 0.10.5",
"lazy_static",
"lazycell",
"log",
"peeking_take_while",
"proc-macro2",
"quote",
"regex",
"rustc-hash",
"shlex",
"syn 1.0.109",
"which",
]
[[package]]
name = "autocxx-build"
version = "0.23.1"
source = "git+https://github.com/fish-shell/autocxx?branch=fish#f9ed164fed6a35a572d19f1495b0691e4b3fd92b"
dependencies = [
"autocxx-engine",
"env_logger",
"indexmap",
"syn 1.0.109",
]
[[package]]
name = "autocxx-engine"
version = "0.23.1"
source = "git+https://github.com/fish-shell/autocxx?branch=fish#f9ed164fed6a35a572d19f1495b0691e4b3fd92b"
dependencies = [
"aquamarine",
"autocxx-bindgen",
"autocxx-parser",
"cc",
"cxx-gen",
"indexmap",
"indoc",
"itertools 0.10.5",
"log",
"miette",
"once_cell",
"prettyplease",
"proc-macro2",
"quote",
"regex",
"rustversion",
"serde_json",
"strum_macros",
"syn 1.0.109",
"tempfile",
"thiserror",
"version_check",
]
[[package]]
name = "autocxx-macro"
version = "0.23.1"
source = "git+https://github.com/fish-shell/autocxx?branch=fish#f9ed164fed6a35a572d19f1495b0691e4b3fd92b"
dependencies = [
"autocxx-parser",
"proc-macro-error",
"proc-macro2",
"quote",
"syn 1.0.109",
]
[[package]]
name = "autocxx-parser"
version = "0.23.1"
source = "git+https://github.com/fish-shell/autocxx?branch=fish#f9ed164fed6a35a572d19f1495b0691e4b3fd92b"
dependencies = [
"indexmap",
"itertools 0.10.5",
"log",
"once_cell",
"proc-macro2",
"quote",
"serde",
"serde_json",
"syn 1.0.109",
"thiserror",
]
[[package]]
name = "bitflags"
version = "1.3.2"
@ -170,17 +35,15 @@ checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635"
name = "cc"
version = "1.0.79"
source = "git+https://github.com/mqudsi/cc-rs?branch=fish#cdc3a376eb0f56c2fb2cf640cc0e9192feaa621b"
dependencies = [
"jobserver",
]
[[package]]
name = "cexpr"
version = "0.6.0"
name = "cc"
version = "1.0.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"
checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0"
dependencies = [
"nom",
"jobserver",
"libc",
]
[[package]]
@ -195,17 +58,6 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "clang-sys"
version = "1.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f"
dependencies = [
"glob",
"libc",
"libloading",
]
[[package]]
name = "cloudabi"
version = "0.0.3"
@ -215,87 +67,12 @@ dependencies = [
"bitflags 1.3.2",
]
[[package]]
name = "codespan-reporting"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e"
dependencies = [
"termcolor",
"unicode-width",
]
[[package]]
name = "cxx"
version = "1.0.81"
source = "git+https://github.com/fish-shell/cxx?branch=fish#3064cb46c16fa1eb5398870f2f4e830c4ca071b8"
dependencies = [
"cc",
"cxxbridge-flags",
"cxxbridge-macro",
"link-cplusplus",
"widestring",
]
[[package]]
name = "cxx-build"
version = "1.0.81"
source = "git+https://github.com/fish-shell/cxx?branch=fish#3064cb46c16fa1eb5398870f2f4e830c4ca071b8"
dependencies = [
"cc",
"codespan-reporting",
"once_cell",
"proc-macro2",
"quote",
"scratch",
"syn 1.0.109",
]
[[package]]
name = "cxx-gen"
version = "0.7.81"
source = "git+https://github.com/fish-shell/cxx?branch=fish#3064cb46c16fa1eb5398870f2f4e830c4ca071b8"
dependencies = [
"codespan-reporting",
"proc-macro2",
"quote",
"syn 1.0.109",
]
[[package]]
name = "cxxbridge-flags"
version = "1.0.81"
source = "git+https://github.com/fish-shell/cxx?branch=fish#3064cb46c16fa1eb5398870f2f4e830c4ca071b8"
[[package]]
name = "cxxbridge-macro"
version = "1.0.81"
source = "git+https://github.com/fish-shell/cxx?branch=fish#3064cb46c16fa1eb5398870f2f4e830c4ca071b8"
dependencies = [
"proc-macro2",
"quote",
"syn 1.0.109",
]
[[package]]
name = "either"
version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07"
[[package]]
name = "env_logger"
version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7"
dependencies = [
"atty",
"humantime",
"log",
"regex",
"termcolor",
]
[[package]]
name = "errno"
version = "0.2.8"
@ -307,24 +84,13 @@ dependencies = [
"winapi",
]
[[package]]
name = "errno"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f"
dependencies = [
"errno-dragonfly",
"libc",
"windows-sys",
]
[[package]]
name = "errno-dragonfly"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
dependencies = [
"cc",
"cc 1.0.83",
"libc",
]
@ -333,24 +99,13 @@ name = "fast-float"
version = "0.2.0"
source = "git+https://github.com/fish-shell/fast-float-rust?branch=fish#9590c33a3f166a3533ba1cbb7a03e1105acec034"
[[package]]
name = "fastrand"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764"
[[package]]
name = "fish-rust"
version = "0.1.0"
dependencies = [
"autocxx",
"autocxx-build",
"bitflags 2.4.0",
"cc",
"cxx",
"cxx-build",
"cxx-gen",
"errno 0.2.8",
"cc 1.0.79",
"errno",
"fast-float",
"git-version",
"hexponent",
@ -401,21 +156,9 @@ dependencies = [
"proc-macro-hack",
"proc-macro2",
"quote",
"syn 1.0.109",
"syn",
]
[[package]]
name = "glob"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
[[package]]
name = "hashbrown"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
[[package]]
name = "hashbrown"
version = "0.13.2"
@ -425,49 +168,11 @@ dependencies = [
"ahash",
]
[[package]]
name = "heck"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
[[package]]
name = "hermit-abi"
version = "0.1.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
dependencies = [
"libc",
]
[[package]]
name = "hexponent"
version = "0.3.1"
source = "git+https://github.com/fish-shell/hexponent?branch=fish#71febaf2ffa3c63ea50a70aa4308293d69bd709c"
[[package]]
name = "humantime"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
[[package]]
name = "indexmap"
version = "1.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
dependencies = [
"autocfg",
"hashbrown 0.12.3",
"serde",
]
[[package]]
name = "indoc"
version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfa799dd5ed20a7e349f3b4639aa80d74549c81716d9ec4f994c9b5815598306"
[[package]]
name = "itertools"
version = "0.9.0"
@ -477,21 +182,6 @@ dependencies = [
"either",
]
[[package]]
name = "itertools"
version = "0.10.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473"
dependencies = [
"either",
]
[[package]]
name = "itoa"
version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38"
[[package]]
name = "jobserver"
version = "0.1.26"
@ -507,43 +197,12 @@ version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "lazycell"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
[[package]]
name = "libc"
version = "0.2.147"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3"
[[package]]
name = "libloading"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f"
dependencies = [
"cfg-if 1.0.0",
"winapi",
]
[[package]]
name = "link-cplusplus"
version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d240c6f7e1ba3a28b0249f774e6a9dd0175054b52dfbb61b16eb8505c3785c9"
dependencies = [
"cc",
]
[[package]]
name = "linux-raw-sys"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503"
[[package]]
name = "lock_api"
version = "0.3.4"
@ -565,51 +224,7 @@ version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "718e8fae447df0c7e1ba7f5189829e63fd536945c8988d61444c19039f16b670"
dependencies = [
"hashbrown 0.13.2",
]
[[package]]
name = "memchr"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
[[package]]
name = "miette"
version = "5.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59bb584eaeeab6bd0226ccf3509a69d7936d148cf3d036ad350abe35e8c6856e"
dependencies = [
"miette-derive",
"once_cell",
"thiserror",
"unicode-width",
]
[[package]]
name = "miette-derive"
version = "5.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.28",
]
[[package]]
name = "minimal-lexical"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
[[package]]
name = "moveit"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7d756ffe4e38013507d35bf726a93fcdae2cae043ab5ce477f13857a335030d"
dependencies = [
"cxx",
"hashbrown",
]
[[package]]
@ -624,16 +239,6 @@ dependencies = [
"libc",
]
[[package]]
name = "nom"
version = "7.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
dependencies = [
"memchr",
"minimal-lexical",
]
[[package]]
name = "num-derive"
version = "0.3.3"
@ -642,7 +247,7 @@ checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d"
dependencies = [
"proc-macro2",
"quote",
"syn 1.0.109",
"syn",
]
[[package]]
@ -679,7 +284,7 @@ dependencies = [
"cfg-if 0.1.10",
"cloudabi",
"libc",
"redox_syscall 0.1.57",
"redox_syscall",
"smallvec",
"winapi",
]
@ -700,17 +305,11 @@ name = "pcre2-sys"
version = "0.2.4"
source = "git+https://github.com/fish-shell/rust-pcre2?branch=master#813a4267546e5ca8ff349c9c67d65e52a82172d2"
dependencies = [
"cc",
"cc 1.0.83",
"libc",
"pkg-config",
]
[[package]]
name = "peeking_take_while"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
[[package]]
name = "pkg-config"
version = "0.3.27"
@ -723,51 +322,17 @@ version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
[[package]]
name = "prettyplease"
version = "0.1.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86"
dependencies = [
"proc-macro2",
"syn 1.0.109",
]
[[package]]
name = "printf-compat"
version = "0.1.1"
source = "git+https://github.com/fish-shell/printf-compat.git?branch=fish#ff460021ba11e2a2c69e1fe04cb1961d6a75be15"
dependencies = [
"bitflags 1.3.2",
"itertools 0.9.0",
"itertools",
"libc",
"widestring",
]
[[package]]
name = "proc-macro-error"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
dependencies = [
"proc-macro-error-attr",
"proc-macro2",
"quote",
"syn 1.0.109",
"version_check",
]
[[package]]
name = "proc-macro-error-attr"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
dependencies = [
"proc-macro2",
"quote",
"version_check",
]
[[package]]
name = "proc-macro-hack"
version = "0.5.20+deprecated"
@ -837,126 +402,20 @@ version = "0.1.57"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
[[package]]
name = "redox_syscall"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29"
dependencies = [
"bitflags 1.3.2",
]
[[package]]
name = "regex"
version = "1.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a"
dependencies = [
"aho-corasick",
"memchr",
"regex-automata",
"regex-syntax",
]
[[package]]
name = "regex-automata"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax",
]
[[package]]
name = "regex-syntax"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2"
[[package]]
name = "rsconf"
version = "0.1.0"
source = "git+https://github.com/mqudsi/rsconf?branch=master#39b6841b373c5c32fcc5333fa17f01be42ad3217"
dependencies = [
"cc",
"cc 1.0.79",
]
[[package]]
name = "rustc-hash"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
[[package]]
name = "rustix"
version = "0.38.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f"
dependencies = [
"bitflags 2.4.0",
"errno 0.3.2",
"libc",
"linux-raw-sys",
"windows-sys",
]
[[package]]
name = "rustversion"
version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4"
[[package]]
name = "ryu"
version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741"
[[package]]
name = "scopeguard"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
name = "scratch"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152"
[[package]]
name = "serde"
version = "1.0.183"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.183"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.28",
]
[[package]]
name = "serde_json"
version = "1.0.104"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c"
dependencies = [
"itoa",
"ryu",
"serde",
]
[[package]]
name = "serial_test"
version = "0.4.0"
@ -976,34 +435,15 @@ checksum = "d08338d8024b227c62bd68a12c7c9883f5c66780abaef15c550dc56f46ee6515"
dependencies = [
"proc-macro2",
"quote",
"syn 1.0.109",
"syn",
]
[[package]]
name = "shlex"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3"
[[package]]
name = "smallvec"
version = "1.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970"
[[package]]
name = "strum_macros"
version = "0.24.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59"
dependencies = [
"heck",
"proc-macro2",
"quote",
"rustversion",
"syn 1.0.109",
]
[[package]]
name = "syn"
version = "1.0.109"
@ -1015,59 +455,6 @@ dependencies = [
"unicode-ident",
]
[[package]]
name = "syn"
version = "2.0.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "tempfile"
version = "3.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc02fddf48964c42031a0b3fe0428320ecf3a73c401040fc0096f97794310651"
dependencies = [
"cfg-if 1.0.0",
"fastrand",
"redox_syscall 0.3.5",
"rustix",
"windows-sys",
]
[[package]]
name = "termcolor"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6"
dependencies = [
"winapi-util",
]
[[package]]
name = "thiserror"
version = "1.0.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "1.0.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.28",
]
[[package]]
name = "thread_local"
version = "1.1.7"
@ -1084,12 +471,6 @@ version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c"
[[package]]
name = "unicode-width"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b"
[[package]]
name = "version_check"
version = "0.9.4"
@ -1102,17 +483,6 @@ version = "0.11.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]]
name = "which"
version = "4.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269"
dependencies = [
"either",
"libc",
"once_cell",
]
[[package]]
name = "widestring"
version = "1.0.2"
@ -1125,7 +495,7 @@ version = "0.1.0"
dependencies = [
"proc-macro2",
"quote",
"syn 1.0.109",
"syn",
]
[[package]]
@ -1144,83 +514,8 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]]
name = "winapi-util"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
dependencies = [
"winapi",
]
[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows-sys"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
dependencies = [
"windows-targets",
]
[[package]]
name = "windows-targets"
version = "0.48.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f"
dependencies = [
"windows_aarch64_gnullvm",
"windows_aarch64_msvc",
"windows_i686_gnu",
"windows_i686_msvc",
"windows_x86_64_gnu",
"windows_x86_64_gnullvm",
"windows_x86_64_msvc",
]
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc"
[[package]]
name = "windows_aarch64_msvc"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3"
[[package]]
name = "windows_i686_gnu"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241"
[[package]]
name = "windows_i686_msvc"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00"
[[package]]
name = "windows_x86_64_gnu"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953"
[[package]]
name = "windows_x86_64_msvc"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"

View File

@ -10,21 +10,6 @@ edition = "2021"
# TODO: Move fish-rust to src, make it the root package of this workspace
[patch.crates-io]
cc = { git = "https://github.com/mqudsi/cc-rs", branch = "fish" }
cxx = { git = "https://github.com/fish-shell/cxx", branch = "fish" }
cxx-gen = { git = "https://github.com/fish-shell/cxx", branch = "fish" }
autocxx = { git = "https://github.com/fish-shell/autocxx", branch = "fish" }
autocxx-build = { git = "https://github.com/fish-shell/autocxx", branch = "fish" }
autocxx-bindgen = { git = "https://github.com/fish-shell/autocxx-bindgen", branch = "fish" }
[patch.'https://github.com/fish-shell/cxx']
cc = { git = "https://github.com/mqudsi/cc-rs", branch = "fish" }
[patch.'https://github.com/fish-shell/autocxx']
cc = { git = "https://github.com/mqudsi/cc-rs", branch = "fish" }
[profile.release]
overflow-checks = true
@ -42,9 +27,7 @@ fast-float = { git = "https://github.com/fish-shell/fast-float-rust", branch="fi
hexponent = { git = "https://github.com/fish-shell/hexponent", branch="fish" }
printf-compat = { git = "https://github.com/fish-shell/printf-compat.git", branch="fish" }
autocxx = "0.23.1"
bitflags = "2.4.0"
cxx = "1.0"
errno = "0.2.8"
lazy_static = "1.4.0"
libc = "0.2.137"
@ -63,10 +46,7 @@ rand_pcg = "0.3.1"
serial_test = "0.4.0"
[build-dependencies]
autocxx-build = "0.23.1"
cc = { git = "https://github.com/mqudsi/cc-rs", branch = "fish" }
cxx-build = { git = "https://github.com/fish-shell/cxx", branch = "fish" }
cxx-gen = { git = "https://github.com/fish-shell/cxx", branch = "fish" }
rsconf = { git = "https://github.com/mqudsi/rsconf", branch = "master" }
[lib]

View File

@ -23,8 +23,6 @@ endif()
set(fish_rust_target "fish-rust")
set(fish_autocxx_gen_dir "${CMAKE_BINARY_DIR}/fish-autocxx-gen/")
set(FISH_CRATE_FEATURES)
if(NOT DEFINED CARGO_FLAGS)
# Corrosion doesn't like an empty string as FLAGS. This is basically a no-op alternative.
@ -43,15 +41,6 @@ corrosion_import_crate(
FLAGS "${CARGO_FLAGS}"
)
# We need the build dir because cxx puts our headers in there.
# Corrosion doesn't expose the build dir, so poke where we shouldn't.
if (Rust_CARGO_TARGET)
set(rust_target_dir "${CMAKE_BINARY_DIR}/cargo/build/${_CORROSION_RUST_CARGO_TARGET}")
else()
set(rust_target_dir "${CMAKE_BINARY_DIR}/cargo/build/${_CORROSION_RUST_CARGO_HOST_TARGET}")
corrosion_set_hostbuild(${fish_rust_target})
endif()
# Temporary hack to propogate CMake flags/options to build.rs. We need to get CMake to evaluate the
# truthiness of the strings if they are set.
set(CMAKE_WITH_GETTEXT "1")
@ -67,8 +56,6 @@ string(JOIN "," CURSES_LIBRARY_LIST ${CURSES_LIBRARY} ${CURSES_EXTRA_LIBRARY})
# Tell Cargo where our build directory is so it can find config.h.
corrosion_set_env_vars(${fish_rust_target}
"FISH_BUILD_DIR=${fish_binary_dir}"
"FISH_AUTOCXX_GEN_DIR=${fish_autocxx_gen_dir}"
"FISH_RUST_TARGET_DIR=${rust_target_dir}"
"PREFIX=${CMAKE_INSTALL_PREFIX}"
# Temporary hack to propogate CMake flags/options to build.rs.
"CMAKE_WITH_GETTEXT=${CMAKE_WITH_GETTEXT}"
@ -79,20 +66,3 @@ corrosion_set_env_vars(${fish_rust_target}
"LOCALEDIR=${CMAKE_INSTALL_FULL_LOCALEDIR}"
"CURSES_LIBRARY_LIST=${CURSES_LIBRARY_LIST}"
)
# this needs an extra fish-rust due to the poor source placement
target_include_directories(${fish_rust_target} INTERFACE
"${rust_target_dir}/cxxbridge/${fish_rust_target}/fish-rust/src/"
"${fish_autocxx_gen_dir}/include/"
)
# Tell fish what extra C++ files to compile.
define_property(
TARGET PROPERTY fish_extra_cpp_files
BRIEF_DOCS "Extra C++ files to compile for fish."
FULL_DOCS "Extra C++ files to compile for fish."
)
set_property(TARGET ${fish_rust_target} PROPERTY fish_extra_cpp_files
"${fish_autocxx_gen_dir}/cxx/gen0.cxx"
)

View File

@ -64,69 +64,19 @@ fn main() {
}
let rust_dir = env!("CARGO_MANIFEST_DIR");
let target_dir =
std::env::var("FISH_RUST_TARGET_DIR").unwrap_or(format!("{}/{}", rust_dir, "target/"));
let cpp_fish_src_dir = format!("{}/{}", rust_dir, "src/");
// Where cxx emits its header.
let cxx_include_dir = format!("{}/{}", target_dir, "cxxbridge/rust/");
// If FISH_BUILD_DIR is given by CMake, then use it; otherwise assume it's at build.
let fish_build_dir =
std::env::var("FISH_BUILD_DIR").unwrap_or(format!("{}/{}", rust_dir, "build/"));
println!("cargo:rustc-env=FISH_BUILD_DIR={fish_build_dir}");
// Where autocxx should put its stuff.
let autocxx_gen_dir = std::env::var("FISH_AUTOCXX_GEN_DIR")
.unwrap_or(format!("{}/{}", fish_build_dir, "fish-autocxx-gen/"));
let mut build = cc::Build::new();
// Add to the default library search path
build.flag_if_supported("-L/usr/local/lib/");
rsconf::add_library_search_path("/usr/local/lib");
let mut detector = Target::new_from(build).unwrap();
// Keep verbose mode on until we've ironed out rust build script stuff
// Note that if autocxx fails to compile any rust code, you'll see the full and unredacted
// stdout/stderr output, which will include things that LOOK LIKE compilation errors as rsconf
// tries to build various test files to try and figure out which libraries and symbols are
// available. IGNORE THESE and scroll to the very bottom of the build script output, past all
// these errors, to see the actual issue.
detector.set_verbose(true);
detect_features(detector);
// Emit cxx junk.
// This allows "Rust to be used from C++"
// This must come before autocxx so that cxx can emit its cxx.h header.
let source_files = vec![
"fish-rust/src/fish_key_reader.rs",
"fish-rust/src/fish_indent.rs",
"fish-rust/src/fish.rs",
];
cxx_build::bridges(&source_files)
.flag_if_supported("-std=c++11")
.include(&cpp_fish_src_dir)
.include(&fish_build_dir) // For config.h
.include(&cxx_include_dir) // For cxx.h
.flag("-Wno-comment")
.compile("fish-rust");
// Emit autocxx junk.
// This allows "C++ to be used from Rust."
let include_paths = [&cpp_fish_src_dir, &fish_build_dir, &cxx_include_dir];
let mut builder = autocxx_build::Builder::new("fish-rust/src/ffi.rs", include_paths);
// Use autocxx's custom output directory unless we're being called by `rust-analyzer` and co.,
// in which case stick to the default target directory so code intelligence continues to work.
if std::env::var("RUSTC_WRAPPER").map_or(true, |wrapper| {
!(wrapper.contains("rust-analyzer") || wrapper.contains("intellij-rust-native-helper"))
}) {
// We need this reassignment because of how the builder pattern works
builder = builder.custom_gendir(autocxx_gen_dir.into());
}
let mut b = builder.build().unwrap();
b.flag_if_supported("-std=c++11")
.flag("-Wno-comment")
.compile("fish-rust-autocxx");
rsconf::rebuild_if_paths_changed(&source_files);
}
/// Dynamically enables certain features at build-time, without their having to be explicitly

View File

@ -41,11 +41,6 @@ bitflags! {
}
}
impl From<EnvMode> for autocxx::c_int {
fn from(val: EnvMode) -> Self {
autocxx::c_int(i32::from(val.bits()))
}
}
impl From<EnvMode> for u16 {
fn from(val: EnvMode) -> Self {
val.bits()

View File

@ -1,8 +0,0 @@
use autocxx::prelude::*;
// autocxx has been hacked up to know about this.
pub type wchar_t = u32;
include_cpp! {
#include "common.h"
}

View File

@ -491,7 +491,8 @@ fn cstr_from_osstr(s: &OsStr) -> CString {
.unwrap()
}
fn main() -> i32 {
#[no_mangle]
extern "C" fn fish_main() -> i32 {
let mut args: Vec<WString> = env::args_os()
.map(|osstr| str2wcstring(osstr.as_bytes()))
.collect();
@ -824,11 +825,3 @@ fn fish_xdm_login_hack_hack_hack_hack(cmds: &mut Vec<OsString>, args: &[WString]
}
return result;
}
#[cxx::bridge]
mod fish_ffi {
extern "Rust" {
#[cxx_name = "rust_main"]
fn main() -> i32;
}
}

View File

@ -709,7 +709,8 @@ fn char_is_escaped(text: &wstr, idx: usize) -> bool {
count_preceding_backslashes(text, idx) % 2 == 1
}
fn fish_indent_main() -> i32 {
#[no_mangle]
extern "C" fn fish_indent_main() -> i32 {
PROGRAM_NAME.set(L!("fish_indent")).unwrap();
topic_monitor_init();
@ -1123,10 +1124,3 @@ fn html_colorize(text: &wstr, colors: &[HighlightSpec]) -> Vec<u8> {
fn no_colorize(text: &wstr) -> Vec<u8> {
wcs2string(text)
}
#[cxx::bridge]
mod fish_indent_ffi {
extern "Rust" {
fn fish_indent_main() -> i32;
}
}

View File

@ -366,7 +366,8 @@ fn parse_flags(continuous_mode: &mut bool, verbose: &mut bool) -> bool {
true
}
fn fish_key_reader_main() -> i32 {
#[no_mangle]
extern "C" fn fish_key_reader_main() -> i32 {
PROGRAM_NAME.set(L!("fish_key_reader")).unwrap();
let mut continuous_mode = false;
let mut verbose = false;
@ -382,10 +383,3 @@ fn fish_key_reader_main() -> i32 {
setup_and_process_keys(continuous_mode, verbose);
}
#[cxx::bridge]
mod fish_key_reader_ffi {
extern "Rust" {
fn fish_key_reader_main() -> i32;
}
}

View File

@ -48,7 +48,6 @@ mod fallback;
mod fd_monitor;
mod fd_readable_set;
mod fds;
mod ffi;
mod fish;
mod fish_indent;
mod fish_key_reader;

View File

@ -6,7 +6,6 @@ use std::pin::Pin;
use std::sync::Mutex;
use crate::common::{charptr2wcstring, wcs2zstring};
use crate::ffi::wchar_t;
use crate::fish::PACKAGE_NAME;
#[cfg(test)]
use crate::tests::prelude::*;
@ -69,14 +68,14 @@ fn wgettext_init_if_necessary() {
/// gettext function, wgettext takes care of setting the correct domain, etc. using the textdomain
/// and bindtextdomain functions. This should probably be moved out of wgettext, so that wgettext
/// will be nothing more than a wrapper around gettext, like all other functions in this file.
pub fn wgettext_impl_do_not_use_directly(text: Cow<'static, [wchar_t]>) -> &'static wstr {
pub fn wgettext_impl_do_not_use_directly(text: Cow<'static, [u32]>) -> &'static wstr {
assert_eq!(text.last(), Some(&0), "should be nul-terminated");
// Preserve errno across this since this is often used in printing error messages.
let err = errno();
wgettext_init_if_necessary();
#[allow(clippy::type_complexity)]
static WGETTEXT_MAP: Lazy<Mutex<HashMap<Cow<'static, [wchar_t]>, Pin<Box<WString>>>>> =
static WGETTEXT_MAP: Lazy<Mutex<HashMap<Cow<'static, [u32]>, Pin<Box<WString>>>>> =
Lazy::new(|| Mutex::new(HashMap::new()));
let mut wmap = WGETTEXT_MAP.lock().unwrap();
let v = match wmap.entry(text) {

View File

@ -1,39 +0,0 @@
// Prototypes for various functions, mostly string utilities, that are used by most parts of fish.
#ifndef FISH_COMMON_H
#define FISH_COMMON_H
#include "config.h" // IWYU pragma: keep
#include <errno.h>
#include <limits.h>
// Needed for va_list et al.
#include <stdarg.h> // IWYU pragma: keep
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h> // IWYU pragma: keep
#endif
#include <sys/types.h>
#include <termios.h>
#include <algorithm>
#include <cstdint>
#include <cwchar>
#include <functional>
#include <initializer_list>
#include <iterator>
#include <memory>
#include <mutex>
#include <string>
#include <utility>
#include <vector>
#ifndef HAVE_STD__MAKE_UNIQUE
/// make_unique implementation
namespace std {
template <typename T, typename... Args>
std::unique_ptr<T> make_unique(Args &&...args) {
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}
} // namespace std
#endif
using std::make_unique;
#endif // FISH_COMMON_H

View File

@ -1,21 +1,3 @@
//
// The main loop of the fish program.
/*
Copyright (C) 2005-2008 Axel Liljencrantz
extern "C" int fish_main();
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "fish.rs.h"
int main() { return rust_main(); }
int main() { return fish_main(); }

View File

@ -1,20 +1,3 @@
// The fish_indent program.
/*
Copyright (C) 2014 ridiculous_fish
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "fish_indent.rs.h"
extern "C" int fish_indent_main();
int main() { return fish_indent_main(); }

View File

@ -1,25 +1,3 @@
// A small utility to print information related to pressing keys. This is similar to using tools
// like `xxd` and `od -tx1z` but provides more information such as the time delay between each
// character. It also allows pressing and interpreting keys that are normally special such as
// [ctrl-C] (interrupt the program) or [ctrl-D] (EOF to signal the program should exit).
// And unlike those other tools this one disables ICRNL mode so it can distinguish between
// carriage-return (\cM) and newline (\cJ).
//
// Type "exit" or "quit" to terminate the program.
#include "config.h" // IWYU pragma: keep
#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#include <termios.h>
#include <unistd.h>
#include <cstring>
#include <cwchar>
#include <string>
#include <vector>
#include "common.h"
#include "fish_key_reader.rs.h"
extern "C" int fish_key_reader_main();
int main() { return fish_key_reader_main(); }