Comments (4)
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.
@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 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 disablingproc-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.
@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)
- Update near/near-abi-rs to work with alpha release
- Update zeropoolnetwork/bn to work with alpha release HOT 1
- BorshSchema vs custom serialisation HOT 4
- Include discriminant number in `BorshSchema::Enum::variants`
- Rename declarations (tuples, `nil`, `string`, `nonzero_xx` and arrays) HOT 5
- add implementation for `BorshSerialize`, `BorshDeserialize`, `BorshSchema` for `char` HOT 3
- Security Policy violation Branch Protection HOT 2
- Security Policy violation SECURITY.md HOT 2
- Restriction on Serializing Zero-Sized Types Affects Marker Component Usage HOT 7
- derive BoshSerialize fails if the type already uses `W` generic name HOT 4
- BorshSerialize derive fails for structs with packed attribute HOT 4
- Should `std` feature imply `rc` feature and vice-versa? HOT 4
- Read/Write mutable reference in `serialize` and `deserialize_reader` is unnecessary HOT 8
- Old NEAR contracts won't compile with the new `borsh` re-exported from `near-sdk-rs` ("Could not find `borsh`") HOT 5
- equivalent of `#[serde(default)]` HOT 2
- Borsh 2.0? Not planned HOT 2
- Extract `alloc` feature (2.0 candidate)
- `bytes::Bytes` and `bytes::BytesMut` can be complemented with `BorshSchema`
- `bson::oid::ObjectId` can be complemented with `BorshSchema`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from borsh-rs.