Comments (9)
The problem is in that Heap
is not Send
.
We decided to mirror the constraints to the std lib in commit 8d819cc.
As a static variable needs to be Sync
, we now require input to the Mutex
to be Send
before we add a Sync
bound ourself. It was a safety bug on our part. See the output of rustc:
src/alloc.rs:64:54: 64:70 note: `*mut u8` cannot be sent between threads safely
src/alloc.rs:64:54: 64:70 note: required because it appears within the type `alloc_buddy_simple::Heap<'static>`
src/alloc.rs:64:54: 64:70 note: required because it appears within the type `core::option::Option<alloc_buddy_simple::Heap<'static>>`
src/alloc.rs:64:54: 64:70 note: shared static variables must have a type that implements `Sync`
While technically correct this breaks semver, since 0.4 is rather new and this is a bug on the others part, I think I am going to leave it this way.
from spin-rs.
Closing due to inactivity.
If you still have some opinion on this, don't hesitate to comment!
from spin-rs.
Sorry, I ran into this just as I went on a trip, but I'm back now.
I understand the rationale for making the change and agree with it.
It's the semver breakage that I'm concerned about (and so are my users). I'm not sure I agree with the "rather new" argument, I developed my code originally against 0.3, but when 0.4.0 came out I noticed everything still worked without any changes in my case so I just updated the dependency to 0.4, expecting it to work in the future.
On the other hand; I'm not sure whether racy code is much better than compile-time errors.
Anyway, no need to dwell on this now, the damage is already done (unless you're willing to make a new 0.4.3 release that's the same as 0.4.0 and continue 0.4.2 as 0.5.0, but that seems cumbersome). I would request you think about breakge when you make changes like these in future though.
from spin-rs.
There is a Cargo blacklist thing that will prevent a specific version from being resolved. (I don't know the name from memory.)
from spin-rs.
I think you mean yank
?
from spin-rs.
Yup, that's the one.
from spin-rs.
Thanks for the input.
At this point yank
ing all 0.4.1+ versions could also cause breakage unfortunately, because of the introduction of new features in 0.4.2.
That 0.4.1 was a breaking change did not occur to me in time. Next time I will be more careful.
from spin-rs.
You could yank 0.4–0.41, which would retroactively make it a proper breaking change. And then the broken ones would be the ones getting the blame too.
from spin-rs.
Not really, because yanking doesn't stop dependencies from being able to download them (no leftpad issues with Rust!)
from spin-rs.
Related Issues (20)
- Inconsistent feature name HOT 2
- `lock_api` feature is not available in version 0.7.1 and 0.8.0. HOT 4
- Cannot borrow `lazy::Lazy<T>` mutably? HOT 5
- Remove `panicked` field from Once's Finish guard HOT 2
- Implement Once::get_mut_unchecked and Once::into_inner_unchecked HOT 4
- unwrap function in MutexGuard? HOT 4
- Request: Add support for atomic-polyfill HOT 7
- `Once::call_once` doesn't guarantee that the given closure is called only if this is the first time `call_once` has been called. HOT 2
- RwLock::try_read is unsound HOT 2
- MIRI build in CI is failing HOT 4
- portable_atomic feature does not compile HOT 2
- CI: Set minimal permissions on GitHub Workflow HOT 3
- Why was spin 0.9.6 yanked? HOT 2
- Unsoundness in `Once::try_call_once()`
- Are `rwlock` and `spin_mutex` compatible with `portable_atomic`? HOT 11
- `Lazy` panics under bare metal environment HOT 10
- Add a Security-Policy
- Add `std` feature with support for thread yielding HOT 1
- Switching to GitHub actions HOT 1
- Need a spinlock that never uses std::thread::yield_now HOT 9
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 spin-rs.