Process didn't exit successfully: - rustc --crate-name lock_api --edition=2018

Hello. I am trying to make work this project

It requires specific version of transformers

I have tried various version of rustc but still getting this error

Which specific version of rust i need?

Python 3.10.8 (tags/v3.10.8:aaaf517, Oct 11 2022, 16:50:30) [MSC v.1933 64 bit (AMD64)] on win32

rustc 1.41.0 (5e1a79984 2020-01-27)

I tested with newest version of rustc too but still fails same

 Compiling textwrap v0.11.0
           Running `rustc --crate-name textwrap C:\Users\King\.cargo\registry\src\github.com-1ecc6299db9ec823\textwrap-0.11.0\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C metadata=65eec7bbb3cdf0f8 -C extra-filename=-65eec7bbb3cdf0f8 --out-dir C:\Users\King\AppData\Local\Temp\pip-install-ablkymhr\tokenizers_201770b635934fc0aaf386ed5bdd381e\target\release\deps -L dependency=C:\Users\King\AppData\Local\Temp\pip-install-ablkymhr\tokenizers_201770b635934fc0aaf386ed5bdd381e\target\release\deps --extern unicode_width=C:\Users\King\AppData\Local\Temp\pip-install-ablkymhr\tokenizers_201770b635934fc0aaf386ed5bdd381e\target\release\deps\libunicode_width-5f855d5352d382a0.rmeta --cap-lints allow`
         Compiling lock_api v0.3.4
         Compiling number_prefix v0.3.0
         Compiling vec_map v0.8.2
           Running `rustc --crate-name lock_api --edition=2018 C:\Users\King\.cargo\registry\src\github.com-1ecc6299db9ec823\lock_api-0.3.4\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg "feature=\"nightly\"" -C metadata=2fe17ee22c58d967 -C extra-filename=-2fe17ee22c58d967 --out-dir C:\Users\King\AppData\Local\Temp\pip-install-ablkymhr\tokenizers_201770b635934fc0aaf386ed5bdd381e\target\release\deps -L dependency=C:\Users\King\AppData\Local\Temp\pip-install-ablkymhr\tokenizers_201770b635934fc0aaf386ed5bdd381e\target\release\deps --extern scopeguard=C:\Users\King\AppData\Local\Temp\pip-install-ablkymhr\tokenizers_201770b635934fc0aaf386ed5bdd381e\target\release\deps\libscopeguard-38978501dffc7e67.rmeta --cap-lints allow`
           Running `rustc --crate-name number_prefix C:\Users\King\.cargo\registry\src\github.com-1ecc6299db9ec823\number_prefix-0.3.0\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg "feature=\"default\"" --cfg "feature=\"std\"" -C metadata=18e86f8ac15d36d7 -C extra-filename=-18e86f8ac15d36d7 --out-dir C:\Users\King\AppData\Local\Temp\pip-install-ablkymhr\tokenizers_201770b635934fc0aaf386ed5bdd381e\target\release\deps -L dependency=C:\Users\King\AppData\Local\Temp\pip-install-ablkymhr\tokenizers_201770b635934fc0aaf386ed5bdd381e\target\release\deps --cap-lints allow`
         Compiling either v1.8.0
           Running `rustc --crate-name vec_map C:\Users\King\.cargo\registry\src\github.com-1ecc6299db9ec823\vec_map-0.8.2\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C metadata=c1dc532dfe4f0140 -C extra-filename=-c1dc532dfe4f0140 --out-dir C:\Users\King\AppData\Local\Temp\pip-install-ablkymhr\tokenizers_201770b635934fc0aaf386ed5bdd381e\target\release\deps -L dependency=C:\Users\King\AppData\Local\Temp\pip-install-ablkymhr\tokenizers_201770b635934fc0aaf386ed5bdd381e\target\release\deps --cap-lints allow`
           Running `rustc --crate-name either --edition=2018 C:\Users\King\.cargo\registry\src\github.com-1ecc6299db9ec823\either-1.8.0\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C metadata=367d734b841a6246 -C extra-filename=-367d734b841a6246 --out-dir C:\Users\King\AppData\Local\Temp\pip-install-ablkymhr\tokenizers_201770b635934fc0aaf386ed5bdd381e\target\release\deps -L dependency=C:\Users\King\AppData\Local\Temp\pip-install-ablkymhr\tokenizers_201770b635934fc0aaf386ed5bdd381e\target\release\deps --cap-lints allow`
      error[E0557]: feature has been removed
        --> C:\Users\King\.cargo\registry\src\github.com-1ecc6299db9ec823\lock_api-0.3.4\src\lib.rs:91:42
         |
      91 | #![cfg_attr(feature = "nightly", feature(const_fn))]
         |                                          ^^^^^^^^ feature has been removed
         |
         = note: split into finer-grained feature gates

      For more information about this error, try `rustc --explain E0557`.
      error: could not compile `lock_api` due to previous error

      Caused by:
        process didn't exit successfully: `rustc --crate-name lock_api --edition=2018 C:\Users\King\.cargo\registry\src\github.com-1ecc6299db9ec823\lock_api-0.3.4\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg "feature=\"nightly\"" -C metadata=2fe17ee22c58d967 -C extra-filename=-2fe17ee22c58d967 --out-dir C:\Users\King\AppData\Local\Temp\pip-install-ablkymhr\tokenizers_201770b635934fc0aaf386ed5bdd381e\target\release\deps -L dependency=C:\Users\King\AppData\Local\Temp\pip-install-ablkymhr\tokenizers_201770b635934fc0aaf386ed5bdd381e\target\release\deps --extern scopeguard=C:\Users\King\AppData\Local\Temp\pip-install-ablkymhr\tokenizers_201770b635934fc0aaf386ed5bdd381e\target\release\deps\libscopeguard-38978501dffc7e67.rmeta --cap-lints allow` (exit code: 1)
      warning: build failed, waiting for other jobs to finish...
      error: `cargo rustc --lib --message-format=json-render-diagnostics --manifest-path Cargo.toml --release -v --features pyo3/extension-module -- --crate-type cdylib` failed with code 101
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for tokenizers
Failed to build tokenizers
ERROR: Could not build wheels for tokenizers, which is required to install pyproject.toml-based projects

It looks like lock_api version 0.3.4 (released April 10, 2020) had a nightly feature flag which would try to use several bits of functionality that were only available on the nightly compiler at the time. Your crate or one of its dependencies is activating this nightly feature, and because a nightly compiler doesn't make any backwards compatibility guarantees around unstable functionality, upgrading to a newer version of Rust breaks your build.

I'd see if you can find out which of your dependencies is pulling in the lock_api crate and activating its nightly feature flag. From there, you can make a PR to remove the #![cfg_attr(feature = "nightly", feature(const_fn))] annotation because it is now redundant. Otherwise if that functionality is necessary and still unstable, you might be able to bump their lock_api dependency to the latest version (0.4.9) which will work on the latest nightly compiler.

The cargo tree command is a good tool for finding out where a particular dependency comes from and which feature flags are enabled.

1 Like

Ty for detailed reply. I have no idea how to use cargo tree command to find and make the changes you mentioned

Any tutorials guide?

Check out the cargo tree page in the Cargo book.

My suggestion essentially boils down to,

  1. Find out what is pulling in the dodgy version of lock_api (v0.3.4 with the nightly feature enabled), and
  2. Make it not do that

There are a couple ways you could do this:

  • You could upgrade your dependencies to something that doesn't pull in that version of lock_api with that feature flag
  • Make a PR to whichever dependency enables the nightly feature (this is where cargo tree comes in) to make them not use outdated unstable features
  • Make a PR to whichever dependency enables the nightly feature and update them to use lock_api version 0.4.9 (which has a nightly feature that works)

You could also downgrade your nightly compiler to something that worked before, but finding that nightly version is often non-trivial)

This is why it's generally not recommended to use unstable functionality in a library. It forces people to be using a compatible version of the nightly compiler, and something as trivial as upgrading your compiler can break your users - eroding their confidence in Rust' stability (even if the developer deliberately opted into unstable functionality by enabling a nightly feature flag).

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.