Git Product home page Git Product logo

Comments (13)

CryZe avatar CryZe commented on June 30, 2024

Looks like this is because I had default-features = false, which built successfully against the commit, but not against the published 0.5.1. Also not using default-features now pulls in so many build-dependencies that it enables std most of the time regardless. So yeah, I'll stay on the old commit until I can figure out how to get this to properly compile against no_std again.

from hashbrown.

Amanieu avatar Amanieu commented on June 30, 2024

I yanked 0.5.1. It seems that ahash depends on crates which are not no_std.

cc @tkaitchuck

from hashbrown.

Amanieu avatar Amanieu commented on June 30, 2024

I think that marking the const_random crate with #![no_std] should be sufficient here. Everything else is compiled as a proc macro.

from hashbrown.

tkaitchuck avatar tkaitchuck commented on June 30, 2024

It's proc_macro_hack. I've filed an issue here: dtolnay/proc-macro-hack#38
The fix looks simple.

from hashbrown.

dtolnay avatar dtolnay commented on June 30, 2024

Huh? It's fine for the implementation of a proc macro to use std even if the macro is called from crates that are no_std. For example serde_derive supports deriving Serialize and Deserialize in no_std crates but uses plenty of std internally.

Are you trying to write a proc macro where the macro implementation itself is no_std?

from hashbrown.

Amanieu avatar Amanieu commented on June 30, 2024

@dtolnay The issue is that the const_random crate, which uses proc_macro_hack is pulling in libstd. And it seems that this crate is compiled for the target architecture, not the host architecture.

from hashbrown.

dtolnay avatar dtolnay commented on June 30, 2024

The const-random crate is not a proc macro crate, it's fine for that to be no_std and proc-macro-hack supports that just fine. The const-random-macro crate is a proc macro so there should be no reason to make it no_std. A proc macro isn't going to get compiled for the target architecture.

from hashbrown.

CryZe avatar CryZe commented on June 30, 2024

It looks like it's just the missing #![no_std] in const-random. proc-macro-hack should not affect anything. (Although the crates pulled in via the proc macro might, due to the cargo bug where features are activated for the target architecture by accident)

from hashbrown.

tkaitchuck avatar tkaitchuck commented on June 30, 2024

Ok, we can test that. I've added #![no_std] in const_random 0.1.4 and pushed a version of aHash that specifies this version.

from hashbrown.

Amanieu avatar Amanieu commented on June 30, 2024

@tkaitchuck Did you see my pull request? tkaitchuck/constrandom#2

from hashbrown.

tkaitchuck avatar tkaitchuck commented on June 30, 2024

@Amanieu Merged and pushed to github and cargo

from hashbrown.

Amanieu avatar Amanieu commented on June 30, 2024

Unfortunately this still doesn't fix the issue I mentioned in #110:

error: failed to parse manifest at `/home/amanieu/.cargo/registry/src/github.com-1ecc6299db9ec823/const-random-0.1.5/Cargo.toml`

Caused by:
  the cargo feature `public-dependency` requires a nightly version of Cargo, but this is the `stable` channel
See https://doc.rust-lang.org/book/appendix-07-nightly-rust.html for more information about Rust release channels.

from hashbrown.

tkaitchuck avatar tkaitchuck commented on June 30, 2024

@Amanieu Fixed in 0.1.6 which is depended on by aHash 0.2.9

from hashbrown.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.