Repository: RustPython/RustPython (language: rust)

Issue:
Failed to build/run RustPython, cargo error: unsupported output in build script of rustpython-stdlib v0.4.0
## Summary

`cargo` version: `cargo 1.76.0 (c84b36747 2024-01-18)`

`rustc` version: `rustc 1.76.0 (07dca489a 2024-02-04)`

I tried to run RustPython according to the [Usage](https://github.com/RustPython/RustPython#usage) (after checkout  a2df2f0, tag 0.4.0):

```sh-session
$ > git clone https://github.com/RustPython/RustPython
$ > cd RustPython
$ > cargo run --release demo_closures.py
$ > cargo build --release
```

The last two commands are failed, cargo reported the same error outputs:

```sh-session
   Compiling rustpython-stdlib v0.4.0 (/home/miketsu/Extended/Projects/RustPython/stdlib)
error: unsupported output in build script of `rustpython-stdlib v0.4.0 (/home/miketsu/Extended/Projects/RustPython/stdlib)`: `cargo::rustc-check-cfg=cfg(osslconf, values("OPENSSL_NO_COMP"))`
Found a `cargo::key=value` build directive which is reserved for future use.
Either change the directive to `cargo:key=value` syntax (note the single `:`) or upgrade your version of Rust.
See https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script for more information about build script outputs.
```

## Details

The output from command `cargo run --verbose --release demo_closures.py`:

```sh-session
$ > cargo run --verbose --release demo_closures.py
       Fresh autocfg v1.1.0
       Fresh unicode-ident v1.0.6
       Fresh cfg-if v1.0.0
       Fresh version_check v0.9.4
       Fresh Inflector v0.11.4
       Fresh convert_case v0.4.0
       Fresh either v1.8.1
       Fresh static_assertions v1.1.0
       Fresh proc-macro2 v1.0.79
       Fresh libc v0.2.153
       Fresh paste v1.0.12
       Fresh itertools v0.11.0
       Fresh ryu v1.0.15
       Fresh num-traits v0.2.15
       Fresh memchr v2.7.2
       Fresh quote v1.0.33
       Fresh getopts v0.2.21
       Fresh malachite-base v0.4.4
       Fresh unic-char-range v0.9.0
       Fresh unic-common v0.9.0
       Fresh once_cell v1.19.0
       Fresh syn v1.0.109
       Fresh syn v2.0.32
       Fresh unic-ucd-version v0.9.0
       Fresh unic-char-property v0.9.0
       Fresh getrandom v0.2.14
       Fresh lexical-util v0.8.5
       Fresh embed-doc-image v0.1.4
       Fresh pmutil v0.6.1
       Fresh derive_more v0.99.17
       Fresh crunchy v0.2.2
       Fresh num-integer v0.1.45
       Fresh anyhow v1.0.69
       Fresh lexical-parse-integer v0.8.6
       Fresh typenum v1.16.0
       Fresh matches v0.1.10
       Fresh rustpython-parser-vendored v0.4.0
       Fresh is-macro v0.3.0
       Fresh malachite-nz v0.4.4
       Fresh tiny-keccak v2.0.2
       Fresh generic-array v0.14.6
       Fresh lexical-parse-float v0.8.5
       Fresh unic-ucd-category v0.9.0
       Fresh pkg-config v0.3.26
       Fresh hexf-parse v0.2.1
       Fresh cc v1.0.79
       Fresh phf_generator v0.11.1
       Fresh malachite-q v0.4.4
       Fresh rustpython-parser-core v0.4.0
       Fresh rustpython-literal v0.4.0
       Fresh bitflags v2.5.0
       Fresh hashbrown v0.12.3
       Fresh smallvec v1.10.0
       Fresh siphasher v0.3.10
       Fresh block-buffer v0.10.3
       Fresh phf_codegen v0.11.1
       Fresh malachite v0.4.4
       Fresh log v0.4.17
       Fresh indexmap v1.9.3
       Fresh crypto-common v0.1.6
       Fresh rand_core v0.6.4
       Fresh syn-ext v0.4.0
       Fresh num-complex v0.4.3
       Fresh twox-hash v1.6.3
       Fresh nom8 v0.2.0
       Fresh toml_datetime v0.5.1
       Fresh unicode_names2_generator v1.2.2
       Fresh malachite-bigint v0.2.0
       Fresh glob v0.3.1
       Fresh subtle v2.4.1
       Fresh lz4_flex v0.11.1
       Fresh toml_edit v0.18.1
       Fresh phf_shared v0.11.1
       Fresh aho-corasick v0.7.20
       Fresh digest v0.10.6
       Fresh cfg_aliases v0.1.1
       Fresh regex-syntax v0.6.28
       Fresh ppv-lite86 v0.2.17
       Fresh rustpython-compiler-core v0.4.0 (/home/miketsu/Extended/Projects/RustPython/compiler/core)
       Fresh proc-macro-crate v1.3.0
       Fresh regex v1.7.1
       Fresh rand_chacha v0.3.1
       Fresh rustpython-ast v0.4.0
       Fresh phf v0.11.1
       Fresh semver v1.0.16
       Fresh rustpython-doc v0.3.0 (https://github.com/RustPython/__doc__?tag=0.3.0#8b62ce5d)
       Fresh equivalent v1.0.1
       Fresh zerocopy v0.7.32
       Fresh unicode-width v0.1.10
       Fresh scopeguard v1.1.0
       Fresh textwrap v0.15.2
       Fresh linux-raw-sys v0.4.12
       Fresh vcpkg v0.2.15
       Fresh hashbrown v0.14.3
       Fresh maplit v1.0.2
       Fresh tinyvec_macros v0.1.1
       Fresh parking_lot_core v0.9.7
       Fresh rustix v0.38.32
       Fresh ahash v0.8.11
       Fresh rustpython-derive-impl v0.4.0 (/home/miketsu/Extended/Projects/RustPython/derive-impl)
       Fresh indexmap v2.2.6
       Fresh lock_api v0.4.9
       Fresh tinyvec v1.6.0
       Fresh unicode_names2 v1.2.2
       Fresh rand v0.8.5
       Fresh rustc_version v0.4.0
       Fresh num_enum_derive v0.7.2
       Fresh nibble_vec v0.1.0
       Fresh pmutil v0.5.3
       Fresh unic-emoji-char v0.9.0
       Fresh atty v0.2.14
       Fresh unic-ucd-ident v0.9.0
       Fresh lazy_static v1.4.0
       Fresh rustc-hash v1.1.0
       Fresh bitflags v1.3.2
       Fresh endian-type v0.1.2
       Fresh regex-automata v0.1.10
       Fresh lalrpop-util v0.20.0
       Fresh result-like-derive v0.4.6
       Fresh rustpython-derive v0.4.0 (/home/miketsu/Extended/Projects/RustPython/derive)
       Fresh num_enum v0.7.2
       Fresh bstr v0.2.17
       Fresh radix_trie v0.2.1
       Fresh radium v0.7.0
       Fresh memoffset v0.6.5
       Fresh rustpython-codegen v0.4.0 (/home/miketsu/Extended/Projects/RustPython/compiler/codegen)
       Fresh rustversion v1.0.11
       Fresh unicode-normalization v0.1.22
       Fresh rustpython-parser v0.4.0
       Fresh parking_lot v0.12.1
       Fresh fd-lock v4.0.2
       Fresh memoffset v0.9.1
       Fresh nix v0.28.0
       Fresh rustpython-format v0.4.0
       Fresh thiserror-impl v1.0.38
       Fresh unic-ucd-hangul v0.9.0
       Fresh optional v0.5.0
       Fresh home v0.5.9
       Fresh ascii v1.1.0
       Fresh unicode-segmentation v1.10.1
       Fresh adler v1.0.2
       Fresh cpufeatures v0.2.5
       Fresh heck v0.4.1
       Fresh utf8parse v0.2.0
       Fresh volatile v0.3.0
       Fresh iana-time-zone v0.1.53
       Fresh caseless v0.2.1
       Fresh nix v0.27.1
       Fresh rustpython-compiler v0.4.0 (/home/miketsu/Extended/Projects/RustPython/compiler)
       Fresh rustpython-sre_engine v0.4.0 (/home/miketsu/Extended/Projects/RustPython/vm/sre_engine)
       Fresh crossbeam-utils v0.8.19
       Fresh unic-ucd-normal v0.9.0
       Fresh thiserror v1.0.38
       Fresh nix v0.23.2
       Fresh atomic v0.5.1
       Fresh strum_macros v0.24.3
       Fresh chrono v0.4.37
       Fresh rustpython-common v0.4.0 (/home/miketsu/Extended/Projects/RustPython/common)
       Fresh miniz_oxide v0.7.2
       Fresh rustyline v14.0.0
       Fresh crc32fast v1.3.2
       Fresh result-like v0.4.6
       Fresh libz-sys v1.1.8
       Fresh uuid-macro-internal v1.3.0
       Fresh thread_local v1.1.7
       Fresh uname v0.1.1
       Fresh unic-ucd-bidi v0.9.0
       Fresh which v4.4.0
       Fresh socket2 v0.5.6
       Fresh num_cpus v1.15.0
       Fresh half v1.8.2
       Fresh hex v0.4.3
       Fresh timsort v0.1.2
       Fresh exitcode v1.1.2
       Fresh keccak v0.1.3
       Fresh strum v0.24.1
       Fresh unicode-casing v0.1.0
       Fresh flate2 v1.0.28
       Fresh dns-lookup v2.0.4
       Fresh uuid v1.3.0
       Fresh sha-1 v0.10.1
       Fresh unic-normal v0.9.0
       Fresh sha2 v0.10.6
       Fresh mac_address v1.1.5
       Fresh rustpython-vm v0.4.0 (/home/miketsu/Extended/Projects/RustPython/vm)
       Fresh sha3 v0.10.6
   Compiling rustpython-stdlib v0.4.0 (/home/miketsu/Extended/Projects/RustPython/stdlib)
       Fresh libsqlite3-sys v0.28.0
       Fresh textwrap v0.11.0
       Fresh blake2 v0.10.6
       Fresh md-5 v0.10.5
       Fresh mt19937 v2.0.1
       Fresh csv-core v0.1.10
       Fresh termios v0.3.3
       Fresh gethostname v0.2.3
       Fresh unic-ucd-age v0.9.0
       Fresh page_size v0.4.2
       Fresh dirs-sys-next v0.1.2
       Fresh memmap2 v0.5.8
       Fresh strsim v0.8.0
     Running `/home/miketsu/Extended/Projects/RustPython/target/release/build/rustpython-stdlib-67c085abc0f5b102/build-script-build`
       Fresh base64 v0.13.1
       Fresh xml-rs v0.8.14
       Fresh puruspe v0.2.4
       Fresh ucd v0.1.1
       Fresh adler32 v1.2.0
       Fresh vec_map v0.8.2
       Fresh termcolor v1.2.0
       Fresh ansi_term v0.12.1
       Fresh dyn-clone v1.0.10
       Fresh dirs-next v2.0.0
       Fresh rustpython-pylib v0.4.0 (/home/miketsu/Extended/Projects/RustPython/pylib)
       Fresh env_logger v0.9.3
       Fresh clap v2.34.0
error: unsupported output in build script of `rustpython-stdlib v0.4.0 (/home/miketsu/Extended/Projects/RustPython/stdlib)`: `cargo::rustc-check-cfg=cfg(osslconf, values("OPENSSL_NO_COMP"))`
Found a `cargo::key=value` build directive which is reserved for future use.
Either change the directive to `cargo:key=value` syntax (note the single `:`) or upgrade your version of Rust.
See https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script for more information about build script outputs.
```


Discussion / hints:
@nukemiko Have you tried an (even slightly) newer version of `cargo`/`rustc`?

I'm unable to replicate this with neither:
 - `cargo 1.78.0`/`rustc 1.78.0` 
 - `cargo 1.82.0-nightly`/`rustc 1.82.0-nightly`
 
Using build commands:
```bash
  cargo build --release
```
```bash
  cargo +nightly --release
```
for `1.78.0` and `1.82.0-nightly` respectively

#### While it's true that `1.78.0 != 1.76.0`...
I believe it's close enough: tried building with `+nightly` first, as [the docs](https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html?highlight=rustc-check-cfg#rustc-check-cfg) mention `1.80.0` as the MSRV for that feature... (though that would imply `1.78.0` should fail too, yet it... doesn't? Not willing to speculate on why that might be as I'm no `cargo` expert though)

So I'd try upgrading `cargo`+`rustc` and see how that goes first; unless someone else can replicate this.

-------------------------------------------------------------------------


### Build logs (for `1.78.0`):
  - Freshly cloned repo checked out at `0.4.0`/`a2df2f0`:
```sh
 $ git clone --depth=1 -b 0.4.0 https://github.com/RustPython/RustPython v0.4.0
 $ cd v0.4.0
 $ cargo build --release
   Compiling autocfg v1.1.0
   Compiling proc-macro2 v1.0.79
   Compiling unicode-ident v1.0.6
   Compiling libc v0.2.153
   Compiling syn v1.0.109
   Compiling cfg-if v1.0.0
   Compiling base64 v0.13.1
   Compiling version_check v0.9.4
   Compiling memchr v2.7.2
   Compiling Inflector v0.11.4
   Compiling paste v1.0.12
   Compiling ppv-lite86 v0.2.17
   Compiling siphasher v0.3.10
   Compiling convert_case v0.4.0
   Compiling phf_shared v0.11.1
   Compiling unic-common v0.9.0
   Compiling once_cell v1.19.0
   Compiling num-traits v0.2.15
   Compiling either v1.8.1
   Compiling unic-ucd-version v0.9.0
   Compiling unic-char-range v0.9.0
   Compiling log v0.4.17
   Compiling itertools v0.11.0
   Compiling unic-char-property v0.9.0
   Compiling static_assertions v1.1.0
   Compiling unicode-width v0.1.10
   Compiling ryu v1.0.15
   Compiling getopts v0.2.21
   Compiling bitflags v2.5.0
   Compiling crunchy v0.2.2
   Compiling num-integer v0.1.45
   Compiling quote v1.0.33
   Compiling syn v2.0.32
   Compiling malachite-base v0.4.4
   Compiling anyhow v1.0.69
   Compiling tiny-keccak v2.0.2
   Compiling getrandom v0.2.14
   Compiling rand_core v0.6.4
   Compiling rand_chacha v0.3.1
   Compiling rand v0.8.5
   Compiling ahash v0.8.11
   Compiling typenum v1.16.0
   Compiling lexical-util v0.8.5
   Compiling phf_generator v0.11.1
   Compiling phf_codegen v0.11.1
   Compiling rustpython-parser-vendored v0.4.0
   Compiling unicode_names2_generator v1.2.2
   Compiling generic-array v0.14.6
   Compiling rustpython-parser v0.4.0
   Compiling lexical-parse-integer v0.8.6
   Compiling matches v0.1.10
   Compiling unic-ucd-category v0.9.0
   Compiling lexical-parse-float v0.8.5
   Compiling unicode_names2 v1.2.2
   Compiling twox-hash v1.6.3
   Compiling indexmap v1.9.3
   Compiling core-foundation-sys v0.8.3
   Compiling pmutil v0.6.1
   Compiling hexf-parse v0.2.1
   Compiling pkg-config v0.3.26
   Compiling cc v1.0.79
   Compiling lz4_flex v0.11.1
   Compiling num-complex v0.4.3
   Compiling hashbrown v0.12.3
   Compiling smallvec v1.10.0
   Compiling syn-ext v0.4.0
   Compiling block-buffer v0.10.3
   Compiling crypto-common v0.1.6
   Compiling nom8 v0.2.0
   Compiling phf v0.11.1
   Compiling toml_datetime v0.5.1
   Compiling hashbrown v0.14.3
   Compiling zerocopy v0.7.32
   Compiling equivalent v1.0.1
   Compiling semver v1.0.16
   Compiling subtle v2.4.1
   Compiling glob v0.3.1
   Compiling digest v0.10.6
   Compiling indexmap v2.2.6
   Compiling unic-emoji-char v0.9.0
   Compiling unic-ucd-ident v0.9.0
   Compiling aho-corasick v0.7.20
   Compiling lock_api v0.4.9
   Compiling lalrpop-util v0.20.0
   Compiling rustix v0.38.32
   Compiling parking_lot_core v0.9.7
   Compiling regex-syntax v0.6.28
   Compiling embed-doc-image v0.1.4
   Compiling is-macro v0.3.0
   Compiling derive_more v0.99.17
   Compiling cfg_aliases v0.1.1
   Compiling rustc-hash v1.1.0
   Compiling nix v0.28.0
   Compiling malachite-nz v0.4.4
   Compiling rustpython-parser-core v0.4.0
   Compiling rustpython-literal v0.4.0
   Compiling toml_edit v0.18.1
   Compiling libz-sys v1.1.8
   Compiling regex v1.7.1
   Compiling errno v0.3.8
   Compiling rustpython-doc v0.3.0 (https://github.com/RustPython/__doc__?tag=0.3.0#8b62ce5d)
   Compiling memoffset v0.9.1
   Compiling memoffset v0.6.5
   Compiling vcpkg v0.2.15
   Compiling proc-macro-crate v1.3.0
   Compiling bitflags v1.3.2
   Compiling rustversion v1.0.11
   Compiling tinyvec_macros v0.1.1
   Compiling radium v0.7.0
   Compiling scopeguard v1.1.0
   Compiling textwrap v0.15.2
   Compiling maplit v1.0.2
   Compiling libsqlite3-sys v0.28.0
   Compiling tinyvec v1.6.0
   Compiling rustc_version v0.4.0
   Compiling num_enum_derive v0.7.2
   Compiling nibble_vec v0.1.0
   Compiling pmutil v0.5.3
   Compiling atty v0.2.14
   Compiling caseless v0.2.1
   Compiling atomic v0.5.1
   Compiling system-configuration-sys v0.5.0
   Compiling crossbeam-utils v0.8.19
   Compiling regex-automata v0.1.10
   Compiling endian-type v0.1.2
   Compiling thiserror v1.0.38
   Compiling lazy_static v1.4.0
   Compiling crc32fast v1.3.2
   Compiling bstr v0.2.17
   Compiling radix_trie v0.2.1
   Compiling num_enum v0.7.2
   Compiling fd-lock v4.0.2
   Compiling result-like-derive v0.4.6
   Compiling unicode-normalization v0.1.22
   Compiling malachite-q v0.4.4
   Compiling parking_lot v0.12.1
   Compiling rustpython-vm v0.4.0 (/Users/avril/00PROJ/playground/rpy-vm/v0.4.0/vm)
   Compiling malachite v0.4.4
   Compiling thiserror-impl v1.0.38
   Compiling malachite-bigint v0.2.0
   Compiling iana-time-zone v0.1.53
   Compiling unic-ucd-hangul v0.9.0
   Compiling utf8parse v0.2.0
   Compiling cpufeatures v0.2.5
   Compiling optional v0.5.0
   Compiling home v0.5.9
   Compiling heck v0.4.1
   Compiling volatile v0.3.0
   Compiling unicode-segmentation v1.10.1
   Compiling ascii v1.1.0
   Compiling adler v1.0.2
   Compiling miniz_oxide v0.7.2
   Compiling result-like v0.4.6
   Compiling strum_macros v0.24.3
   Compiling rustpython-sre_engine v0.4.0 (/Users/avril/00PROJ/playground/rpy-vm/v0.4.0/vm/sre_engine)
   Compiling rustyline v14.0.0
   Compiling unic-ucd-normal v0.9.0
   Compiling chrono v0.4.37
   Compiling nix v0.23.2
   Compiling nix v0.27.1
   Compiling uuid-macro-internal v1.3.0
   Compiling rustpython-pylib v0.4.0 (/Users/avril/00PROJ/playground/rpy-vm/v0.4.0/pylib)
   Compiling core-foundation v0.9.3
   Compiling uname v0.1.1
   Compiling which v4.4.0
   Compiling num_cpus v1.15.0
   Compiling socket2 v0.5.6
   Compiling thread_local v1.1.7
   Compiling unic-ucd-bidi v0.9.0
   Compiling strum v0.24.1
   Compiling exitcode v1.1.2
   Compiling hex v0.4.3
   Compiling unicode-casing v0.1.0
   Compiling rustpython-stdlib v0.4.0 (/Users/avril/00PROJ/playground/rpy-vm/v0.4.0/stdlib)
   Compiling keccak v0.1.3
   Compiling half v1.8.2
   Compiling timsort v0.1.2
   Compiling sha3 v0.10.6
   Compiling dns-lookup v2.0.4
   Compiling system-configuration v0.5.0
   Compiling mac_address v1.1.5
   Compiling uuid v1.3.0
   Compiling flate2 v1.0.28
   Compiling unic-normal v0.9.0
   Compiling sha2 v0.10.6
   Compiling sha-1 v0.10.1
   Compiling textwrap v0.11.0
   Compiling blake2 v0.10.6
   Compiling md-5 v0.10.5
   Compiling mt19937 v2.0.1
   Compiling termios v0.3.3
   Compiling page_size v0.4.2
   Compiling memmap2 v0.5.8
   Compiling dirs-sys-next v0.1.2
   Compiling gethostname v0.2.3
   Compiling csv-core v0.1.10
   Compiling rustpython-ast v0.4.0
   Compiling rustpython-compiler-core v0.4.0 (/Users/avril/00PROJ/playground/rpy-vm/v0.4.0/compiler/core)
   Compiling unic-ucd-age v0.9.0
   Compiling adler32 v1.2.0
   Compiling vec_map v0.8.2
   Compiling termcolor v1.2.0
   Compiling ucd v0.1.1
   Compiling puruspe v0.2.4
   Compiling ansi_term v0.12.1
   Compiling xml-rs v0.8.14
   Compiling dyn-clone v1.0.10
   Compiling strsim v0.8.0
   Compiling env_logger v0.9.3
   Compiling dirs-next v2.0.0
   Compiling rustpython-derive-impl v0.4.0 (/Users/avril/00PROJ/playground/rpy-vm/v0.4.0/derive-impl)
   Compiling clap v2.34.0
   Compiling rustpython-codegen v0.4.0 (/Users/avril/00PROJ/playground/rpy-vm/v0.4.0/compiler/codegen)
   Compiling rustpython-format v0.4.0
   Compiling rustpython-common v0.4.0 (/Users/avril/00PROJ/playground/rpy-vm/v0.4.0/common)
   Compiling rustpython-compiler v0.4.0 (/Users/avril/00PROJ/playground/rpy-vm/v0.4.0/compiler)
   Compiling rustpython-derive v0.4.0 (/Users/avril/00PROJ/playground/rpy-vm/v0.4.0/derive)
   Compiling rustpython v0.4.0 (/Users/avril/00PROJ/playground/rpy-vm/v0.4.0)
    Finished `release` profile [optimized] target(s) in 2m 54s
```

(Same exact output running `cargo +nightly build --release`)

Fix patch:
diff --git a/Cargo.toml b/Cargo.toml
index 284567575f..eec5d84a8f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,92 +1,13 @@
 [package]
 name = "rustpython"
-version = "0.4.0"
-authors = ["RustPython Team"]
-edition = "2021"
-rust-version = "1.75.0"
 description = "A python interpreter written in rust."
-repository = "https://github.com/RustPython/RustPython"
-license = "MIT"
 include = ["LICENSE", "Cargo.toml", "src/**/*.rs"]
-
-[workspace]
-resolver = "2"
-members = [
-    "compiler", "compiler/core", "compiler/codegen",
-    ".", "common", "derive", "jit", "vm", "vm/sre_engine", "pylib", "stdlib", "wasm/lib", "derive-impl",
-]
-
-[workspace.dependencies]
-rustpython-compiler-core = { path = "compiler/core", version = "0.4.0" }
-rustpython-compiler = { path = "compiler", version = "0.4.0" }
-rustpython-codegen = { path = "compiler/codegen", version = "0.4.0" }
-rustpython-common = { path = "common", version = "0.4.0" }
-rustpython-derive = { path = "derive", version = "0.4.0" }
-rustpython-derive-impl = { path = "derive-impl", version = "0.4.0" }
-rustpython-jit = { path = "jit", version = "0.4.0" }
-rustpython-vm = { path = "vm", default-features = false, version = "0.4.0" }
-rustpython-pylib = { path = "pylib", version = "0.4.0" }
-rustpython-stdlib = { path = "stdlib", default-features = false, version = "0.4.0" }
-rustpython-sre_engine = { path = "vm/sre_engine", version = "0.4.0" }
-rustpython-doc = { git = "https://github.com/RustPython/__doc__", tag = "0.3.0", version = "0.3.0" }
-
-rustpython-literal = { version = "0.4.0" }
-rustpython-parser-core = { version = "0.4.0" }
-rustpython-parser = { version = "0.4.0" }
-rustpython-ast = { version = "0.4.0" }
-rustpython-format= { version = "0.4.0" }
-# rustpython-literal = { git = "https://github.com/RustPython/Parser.git", version = "0.4.0", rev = "00d2f1d1a7522ef9c85c10dfa5f0bb7178dee655" }
-# rustpython-parser-core = { git = "https://github.com/RustPython/Parser.git", version = "0.4.0", rev = "00d2f1d1a7522ef9c85c10dfa5f0bb7178dee655" }
-# rustpython-parser = { git = "https://github.com/RustPython/Parser.git", version = "0.4.0", rev = "00d2f1d1a7522ef9c85c10dfa5f0bb7178dee655" }
-# rustpython-ast = { git = "https://github.com/RustPython/Parser.git", version = "0.4.0", rev = "00d2f1d1a7522ef9c85c10dfa5f0bb7178dee655" }
-# rustpython-format = { git = "https://github.com/RustPython/Parser.git", version = "0.4.0", rev = "00d2f1d1a7522ef9c85c10dfa5f0bb7178dee655" }
-# rustpython-literal = { path = "../RustPython-parser/literal" }
-# rustpython-parser-core = { path = "../RustPython-parser/core" }
-# rustpython-parser = { path = "../RustPython-parser/parser" }
-# rustpython-ast = { path = "../RustPython-parser/ast" }
-# rustpython-format = { path = "../RustPython-parser/format" }
-
-ahash = "0.8.11"
-ascii = "1.0"
-atty = "0.2.14"
-bitflags = "2.4.1"
-bstr = "0.2.17"
-cfg-if = "1.0"
-chrono = "0.4.37"
-crossbeam-utils = "0.8.19"
-flame = "0.2.2"
-glob = "0.3"
-hex = "0.4.3"
-indexmap = { version = "2.2.6", features = ["std"] }
-insta = "1.38.0"
-itertools = "0.11.0"
-is-macro = "0.3.0"
-junction = "1.0.0"
-libc = "0.2.153"
-log = "0.4.16"
-nix = { version = "0.27", features = ["fs", "user", "process", "term", "time", "signal", "ioctl", "socket", "sched", "zerocopy", "dir", "hostname", "net", "poll"] }
-malachite-bigint = "0.2.0"
-malachite-q = "0.4.4"
-malachite-base = "0.4.4"
-memchr = "2.7.2"
-num-complex = "0.4.0"
-num-integer = "0.1.44"
-num-traits = "0.2"
-num_enum = "0.7"
-once_cell = "1.19.0"
-parking_lot = "0.12.1"
-paste = "1.0.7"
-rand = "0.8.5"
-rustyline = "14.0.0"
-serde = { version = "1.0.133", default-features = false }
-schannel = "0.1.22"
-static_assertions = "1.1"
-syn = "1.0.109"
-thiserror = "1.0"
-thread_local = "1.1.4"
-unicode_names2 = "1.2.0"
-widestring = "1.1.0"
-windows-sys = "0.52.0"
+version.workspace = true
+authors.workspace = true
+edition.workspace = true
+rust-version.workspace = true
+repository.workspace = true
+license.workspace = true
 
 [features]
 default = ["threading", "stdlib", "zlib", "importlib"]
@@ -171,6 +92,93 @@ rev = "2024.02.14"
 [package.metadata.vcpkg.target]
 x86_64-pc-windows-msvc = { triplet = "x64-windows-static-md", dev-dependencies = ["openssl" ] }
 
+[workspace]
+resolver = "2"
+members = [
+    "compiler", "compiler/core", "compiler/codegen",
+    ".", "common", "derive", "jit", "vm", "vm/sre_engine", "pylib", "stdlib", "wasm/lib", "derive-impl",
+]
+
+[workspace.package]
+version = "0.4.0"
+authors = ["RustPython Team"]
+edition = "2021"
+rust-version = "1.78.0"
+repository = "https://github.com/RustPython/RustPython"
+license = "MIT"
+
+[workspace.dependencies]
+rustpython-compiler-core = { path = "compiler/core", version = "0.4.0" }
+rustpython-compiler = { path = "compiler", version = "0.4.0" }
+rustpython-codegen = { path = "compiler/codegen", version = "0.4.0" }
+rustpython-common = { path = "common", version = "0.4.0" }
+rustpython-derive = { path = "derive", version = "0.4.0" }
+rustpython-derive-impl = { path = "derive-impl", version = "0.4.0" }
+rustpython-jit = { path = "jit", version = "0.4.0" }
+rustpython-vm = { path = "vm", default-features = false, version = "0.4.0" }
+rustpython-pylib = { path = "pylib", version = "0.4.0" }
+rustpython-stdlib = { path = "stdlib", default-features = false, version = "0.4.0" }
+rustpython-sre_engine = { path = "vm/sre_engine", version = "0.4.0" }
+rustpython-doc = { git = "https://github.com/RustPython/__doc__", tag = "0.3.0", version = "0.3.0" }
+
+rustpython-literal = { version = "0.4.0" }
+rustpython-parser-core = { version = "0.4.0" }
+rustpython-parser = { version = "0.4.0" }
+rustpython-ast = { version = "0.4.0" }
+rustpython-format= { version = "0.4.0" }
+# rustpython-literal = { git = "https://github.com/RustPython/Parser.git", version = "0.4.0", rev = "00d2f1d1a7522ef9c85c10dfa5f0bb7178dee655" }
+# rustpython-parser-core = { git = "https://github.com/RustPython/Parser.git", version = "0.4.0", rev = "00d2f1d1a7522ef9c85c10dfa5f0bb7178dee655" }
+# rustpython-parser = { git = "https://github.com/RustPython/Parser.git", version = "0.4.0", rev = "00d2f1d1a7522ef9c85c10dfa5f0bb7178dee655" }
+# rustpython-ast = { git = "https://github.com/RustPython/Parser.git", version = "0.4.0", rev = "00d2f1d1a7522ef9c85c10dfa5f0bb7178dee655" }
+# rustpython-format = { git = "https://github.com/RustPython/Parser.git", version = "0.4.0", rev = "00d2f1d1a7522ef9c85c10dfa5f0bb7178dee655" }
+# rustpython-literal = { path = "../RustPython-parser/literal" }
+# rustpython-parser-core = { path = "../RustPython-parser/core" }
+# rustpython-parser = { path = "../RustPython-parser/parser" }
+# rustpython-ast = { path = "../RustPython-parser/ast" }
+# rustpython-format = { path = "../RustPython-parser/format" }
+
+ahash = "0.8.11"
+ascii = "1.0"
+atty = "0.2.14"
+bitflags = "2.4.1"
+bstr = "0.2.17"
+cfg-if = "1.0"
+chrono = "0.4.37"
+crossbeam-utils = "0.8.19"
+flame = "0.2.2"
+glob = "0.3"
+hex = "0.4.3"
+indexmap = { version = "2.2.6", features = ["std"] }
+insta = "1.38.0"
+itertools = "0.11.0"
+is-macro = "0.3.0"
+junction = "1.0.0"
+libc = "0.2.153"
+log = "0.4.16"
+nix = { version = "0.27", features = ["fs", "user", "process", "term", "time", "signal", "ioctl", "socket", "sched", "zerocopy", "dir", "hostname", "net", "poll"] }
+malachite-bigint = "0.2.0"
+malachite-q = "0.4.4"
+malachite-base = "0.4.4"
+memchr = "2.7.2"
+num-complex = "0.4.0"
+num-integer = "0.1.44"
+num-traits = "0.2"
+num_enum = "0.7"
+once_cell = "1.19.0"
+parking_lot = "0.12.1"
+paste = "1.0.7"
+rand = "0.8.5"
+rustyline = "14.0.0"
+serde = { version = "1.0.133", default-features = false }
+schannel = "0.1.22"
+static_assertions = "1.1"
+syn = "1.0.109"
+thiserror = "1.0"
+thread_local = "1.1.4"
+unicode_names2 = "1.2.0"
+widestring = "1.1.0"
+windows-sys = "0.52.0"
+
 # Lints
 
 [workspace.lints.rust]
diff --git a/common/Cargo.toml b/common/Cargo.toml
index 94bee08b7f..354dacc086 100644
--- a/common/Cargo.toml
+++ b/common/Cargo.toml
@@ -1,11 +1,12 @@
 [package]
 name = "rustpython-common"
-version = "0.4.0"
 description = "General python functions and algorithms for use in RustPython"
-authors = ["RustPython Team"]
-edition = "2021"
-repository = "https://github.com/RustPython/RustPython"
-license = "MIT"
+version.workspace = true
+authors.workspace = true
+edition.workspace = true
+rust-version.workspace = true
+repository.workspace = true
+license.workspace = true
 
 [features]
 threading = ["parking_lot"]
diff --git a/compiler/Cargo.toml b/compiler/Cargo.toml
index 3e017dabe6..cb98093c9e 100644
--- a/compiler/Cargo.toml
+++ b/compiler/Cargo.toml
@@ -1,11 +1,12 @@
 [package]
 name = "rustpython-compiler"
-version = "0.4.0"
 description = "A usability wrapper around rustpython-parser and rustpython-compiler-core"
-authors = ["RustPython Team"]
-repository = "https://github.com/RustPython/RustPython"
-license = "MIT"
-edition = "2021"
+version.workspace = true
+authors.workspace = true
+edition.workspace = true
+rust-version.workspace = true
+repository.workspace = true
+license.workspace = true
 
 [dependencies]
 rustpython-codegen = { workspace = true }
diff --git a/compiler/codegen/Cargo.toml b/compiler/codegen/Cargo.toml
index fe0b42ffa2..0fe950be71 100644
--- a/compiler/codegen/Cargo.toml
+++ b/compiler/codegen/Cargo.toml
@@ -1,11 +1,13 @@
 [package]
 name = "rustpython-codegen"
-version = "0.4.0"
 description = "Compiler for python code into bytecode for the rustpython VM."
-authors = ["RustPython Team"]
-repository = "https://github.com/RustPython/RustPython"
-license = "MIT"
-edition = "2021"
+version.workspace = true
+authors.workspace = true
+edition.workspace = true
+rust-version.workspace = true
+repository.workspace = true
+license.workspace = true
+
 
 [dependencies]
 rustpython-ast = { workspace = true, features=["unparse", "constant-optimization"] }
diff --git a/compiler/core/Cargo.toml b/compiler/core/Cargo.toml
index d7727b7138..3d05fc2734 100644
--- a/compiler/core/Cargo.toml
+++ b/compiler/core/Cargo.toml
@@ -1,11 +1,12 @@
 [package]
 name = "rustpython-compiler-core"
 description = "RustPython specific bytecode."
-version = "0.4.0"
-authors = ["RustPython Team"]
-edition = "2021"
-repository = "https://github.com/RustPython/RustPython"
-license = "MIT"
+version.workspace = true
+authors.workspace = true
+edition.workspace = true
+rust-version.workspace = true
+repository.workspace = true
+license.workspace = true
 
 [dependencies]
 rustpython-parser-core = { workspace = true, features=["location"] }
diff --git a/derive-impl/Cargo.toml b/derive-impl/Cargo.toml
index 0eaa2cb499..a843f5d3c5 100644
--- a/derive-impl/Cargo.toml
+++ b/derive-impl/Cargo.toml
@@ -1,11 +1,12 @@
 [package]
 name = "rustpython-derive-impl"
-version = "0.4.0"
 description = "Rust language extensions and macros specific to rustpython."
-authors = ["RustPython Team"]
-repository = "https://github.com/RustPython/RustPython"
-license = "MIT"
-edition = "2021"
+version.workspace = true
+authors.workspace = true
+edition.workspace = true
+rust-version.workspace = true
+repository.workspace = true
+license.workspace = true
 
 [dependencies]
 rustpython-compiler-core = { workspace = true }
diff --git a/derive/Cargo.toml b/derive/Cargo.toml
index d172f90cbb..d38686ce7d 100644
--- a/derive/Cargo.toml
+++ b/derive/Cargo.toml
@@ -1,11 +1,12 @@
 [package]
 name = "rustpython-derive"
-version = "0.4.0"
 description = "Rust language extensions and macros specific to rustpython."
-authors = ["RustPython Team"]
-repository = "https://github.com/RustPython/RustPython"
-license = "MIT"
-edition = "2021"
+version.workspace = true
+authors.workspace = true
+edition.workspace = true
+rust-version.workspace = true
+repository.workspace = true
+license.workspace = true
 
 [lib]
 proc-macro = true
diff --git a/jit/Cargo.toml b/jit/Cargo.toml
index 6fa518979c..cc26eb59a5 100644
--- a/jit/Cargo.toml
+++ b/jit/Cargo.toml
@@ -1,11 +1,12 @@
 [package]
 name = "rustpython-jit"
-version = "0.4.0"
 description = "Experimental JIT(just in time) compiler for python code."
-authors = ["RustPython Team"]
-repository = "https://github.com/RustPython/RustPython"
-license = "MIT"
-edition = "2021"
+version.workspace = true
+authors.workspace = true
+edition.workspace = true
+rust-version.workspace = true
+repository.workspace = true
+license.workspace = true
 
 autotests = false
 
diff --git a/pylib/Cargo.toml b/pylib/Cargo.toml
index d38359bb23..64a9da0219 100644
--- a/pylib/Cargo.toml
+++ b/pylib/Cargo.toml
@@ -1,12 +1,13 @@
 [package]
 name = "rustpython-pylib"
-version = "0.4.0"
-authors = ["RustPython Team"]
 description = "A subset of the Python standard library for use with RustPython"
-repository = "https://github.com/RustPython/RustPython"
 license-file = "Lib/PSF-LICENSE"
-edition = "2021"
 include = ["Cargo.toml", "src/**/*.rs", "Lib/", "!Lib/**/test/", "!Lib/**/*.pyc"]
+authors = ["CPython Developers"]
+version.workspace = true
+edition.workspace = true
+rust-version.workspace = true
+repository.workspace = true
 
 [features]
 freeze-stdlib = []
diff --git a/stdlib/Cargo.toml b/stdlib/Cargo.toml
index 4872b2113e..485855d646 100644
--- a/stdlib/Cargo.toml
+++ b/stdlib/Cargo.toml
@@ -1,11 +1,12 @@
 [package]
 name = "rustpython-stdlib"
-version = "0.4.0"
 description = "RustPython standard libraries in Rust."
-authors = ["RustPython Team"]
-repository = "https://github.com/RustPython/RustPython"
-license = "MIT"
-edition = "2021"
+version.workspace = true
+authors.workspace = true
+edition.workspace = true
+rust-version.workspace = true
+repository.workspace = true
+license.workspace = true
 
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
 
diff --git a/vm/Cargo.toml b/vm/Cargo.toml
index a00ee79a66..251d482ebe 100644
--- a/vm/Cargo.toml
+++ b/vm/Cargo.toml
@@ -1,12 +1,13 @@
 [package]
 name = "rustpython-vm"
-version = "0.4.0"
 description = "RustPython virtual machine."
-authors = ["RustPython Team"]
-repository = "https://github.com/RustPython/RustPython"
-license = "MIT"
-edition = "2021"
 include = ["src/**/*.rs", "Cargo.toml", "build.rs", "Lib/**/*.py"]
+version.workspace = true
+authors.workspace = true
+edition.workspace = true
+rust-version.workspace = true
+repository.workspace = true
+license.workspace = true
 
 [features]
 default = ["compiler"]
diff --git a/vm/sre_engine/Cargo.toml b/vm/sre_engine/Cargo.toml
index e890730a06..28f98a3212 100644
--- a/vm/sre_engine/Cargo.toml
+++ b/vm/sre_engine/Cargo.toml
@@ -1,13 +1,14 @@
 [package]
 name = "rustpython-sre_engine"
-version = "0.4.0"
 authors = ["Kangzhi Shi <shikangzhi@gmail.com>", "RustPython Team"]
 description = "A low-level implementation of Python's SRE regex engine"
-repository = "https://github.com/RustPython/RustPython"
-license = "MIT"
-edition = "2021"
 keywords = ["regex"]
 include = ["LICENSE", "src/**/*.rs"]
+version.workspace = true
+edition.workspace = true
+rust-version.workspace = true
+repository.workspace = true
+license.workspace = true
 
 [dependencies]
 num_enum = { workspace = true }
diff --git a/wasm/lib/Cargo.toml b/wasm/lib/Cargo.toml
index 3b3cd8127c..9b71bbce25 100644
--- a/wasm/lib/Cargo.toml
+++ b/wasm/lib/Cargo.toml
@@ -1,11 +1,12 @@
 [package]
 name = "rustpython_wasm"
-version = "0.4.0"
-authors = ["RustPython Team"]
-license = "MIT"
 description = "A Python-3 (CPython >= 3.5.0) Interpreter written in Rust, compiled to WASM"
-repository = "https://github.com/RustPython/RustPython/tree/main/wasm/lib"
-edition = "2021"
+version.workspace = true
+authors.workspace = true
+edition.workspace = true
+rust-version.workspace = true
+repository.workspace = true
+license.workspace = true
 
 [lib]
 crate-type = ["cdylib", "rlib"]


Test patch: