Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error[E0658]: use of unstable library feature 'local_key_cell_methods' #3

Closed
ChristopherRabotin opened this issue Nov 1, 2023 · 9 comments

Comments

@ChristopherRabotin
Copy link

Hi there,

It seems that one of my dependencies uses your library. Since just a few days ago, the build fails in CI on several WIP branches (nyx-space/nyx#246, nyx-space/nyx#244) on the latest stable rust.

error[E0658]: use of unstable library feature 'local_key_cell_methods'
  --> /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ran-1.1.4/src/generators.rs:25:33
   |
25 | pub fn get_seed() -> u64 { SEED.get() }
   |                                 ^^^
   |
   = note: see issue #92122 <https://github.com/rust-lang/rust/issues/92122> for more information

error[E0658]: use of unstable library feature 'local_key_cell_methods'
  --> /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ran-1.1.4/src/generators.rs:34:10
   |
34 |     SEED.set(seed); 
   |          ^^^
   |
   = note: see issue #92122 <https://github.com/rust-lang/rust/issues/92122> for more information

Any idea how I could fix that issue?

Thanks

@liborty
Copy link
Owner

liborty commented Nov 1, 2023

Are you sure that you (and/or GitHub Actions) are on the latest stable Rust? My 'ran' crate now relies on Rust stable 1.73., as mentioned in its release notes (at the bottom of the Readme file). If you do locally rust update, followed by cargo update, it should all compile just fine again. There is not much I can do about GitHub keeping up to date, though. Let me know if you still have problems.

@liborty
Copy link
Owner

liborty commented Nov 1, 2023

I know that github is always messing around with their nodes and whatnot, so I use a third party Rust toolchain that has never let me down. For your information, here is my .yml file that passes my 'ran' crate tests on github actions with no problems:

name: test

on: push

jobs:
  build:  
    name: random 
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - uses: dtolnay/rust-toolchain@stable
    - run: cargo test --release -- --test-threads=1 --nocapture --color always    
    ```

@ChristopherRabotin
Copy link
Author

Thanks for your rapid response. I seem to be encountering an issue in the macos builds, and I'm not sure why that's the case.

@liborty
Copy link
Owner

liborty commented Nov 1, 2023

If you can not resolve it, you can always go back to ran v 1.1.2. The functionality is the same, the later versions are just even slimmer and faster, that is all.
Also, if you are using my 'ran' crate via one of my other crates, such as 'rstats', you might have to update to the latest version of that one too. Usually 'cargo update' will do it.

@ChristopherRabotin
Copy link
Author

ChristopherRabotin commented Nov 1, 2023 via email

@liborty
Copy link
Owner

liborty commented Nov 1, 2023

In Rust semver, it is usually a good idea to specify the dependencies only by the first one or at most two digits of the version number, it will then upgrade the minor versions automatically.
PS. I sympathize with your predicament of having to use Python :)
PPS. Thanks for your liking of my rstats. I have a number of inter-dependent crates. I should mention that whereas their latest versions are in a consistent state, I obviously can not guarantee consistency amongst various random older versions.

@liborty liborty closed this as completed Nov 1, 2023
@ChristopherRabotin
Copy link
Author

I'm still regularly hitting this hiccup, even just now: https://github.com/nyx-space/nyx/actions/runs/6952467949/job/18916580429 . Sometimes rerunning the build will fix the issue, but not always. I'm just kind of surprised about it. Do you have any tips on what I could do to avoid this issue?

@liborty
Copy link
Owner

liborty commented Nov 22, 2023

Like I said before, this will be caused by an old version of Rust < 1.73.
I looked at your actions file and it is not even clear from it which version of Rust it is using.
If there is any way of specifying Rust >= 1.73, that would fix it.
It is almost certainly caused by an old version getting pulled in somewhere, wherever that might be.
Also, if you are not using the latest version of 'rstats', it is always better to use it.

@ChristopherRabotin
Copy link
Author

I was able to specify the rust toolchain in the CI file: https://github.com/nyx-space/nyx/pull/255/files .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants