GithubHelp home page GithubHelp logo

Comments (4)

Fuuzetsu avatar Fuuzetsu commented on June 16, 2024

After surveying some popular crates, it seems that the general approach is to expose some crate = attribute that allows specifying the name explicitly: borsh already supports this I believe. Without it, just breaks if rename happens.

Only a few crates use proc-macro-crate helper that goes via cargo, especially because it makes the macro unpure (goes via filesystem...).

There doesn't seem to be a good solution other than these options...

from borsh-rs.

dj8yfo avatar dj8yfo commented on June 16, 2024

@Fuuzetsu looking up nix doc https://nixos.org/manual/nixpkgs/stable/#compiling-rust-crates-using-nix-instead-of-cargo, it looks like giving up cargo completely is a viable option.

#272 is one of possible ways to resolve this, if adding #[borsh(crate = "borsh")] everywhere, effectively disabling proc-macro-crate checks, isn't too ergonomic.

from borsh-rs.

Fuuzetsu avatar Fuuzetsu commented on June 16, 2024

@Fuuzetsu looking up nix doc https://nixos.org/manual/nixpkgs/stable/#compiling-rust-crates-using-nix-instead-of-cargo, it looks like giving up cargo completely is a viable option.

Hm? Not sure what you mean by this but right, we already do not use cargo during the build.

#272 is one of possible ways to resolve this, if adding #[borsh(crate = "borsh")] everywhere, effectively disabling proc-macro-crate checks, isn't too ergonomic.

Right, making it optional is something I guess. Presumably in cases where one renamed borsh and has a very large number of derives.

FWIW for now we're just using a fork with the proc-macro-crate deleted from the repo all together...

from borsh-rs.

frol avatar frol commented on June 16, 2024

@dj8yfo I don't think we need to introduce a breaking change to borsh-rs to accommodate non-standard use of build systems.

@Fuuzetsu Please, consider contributing to proc-macro-crate so it just supports your build environment.

P.S. I closed this issue to indicate that we don't plan to take any actions on it now as it is outside of the scope of this crate, but if you believe otherwise, please, feel free to comment below

from borsh-rs.

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.