Skip to content

Commit

Permalink
chore: Release
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfishcode committed Jun 30, 2023
1 parent 01055f1 commit 963eebf
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 24 deletions.
14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cap-std-workspace"
version = "1.0.16"
version = "2.0.0"

This comment has been minimized.

Copy link
@cgwalters

cgwalters Jul 14, 2023

Contributor

Wait why? What motivates a semver incompatible bump here?

We've been using cap-std in the public APIs of some of our crates, and this will need a chain of semver bumps for those. It's doable but I think it should be well-motivated...

This comment has been minimized.

Copy link
@sunfishcode

sunfishcode Jul 14, 2023

Author Member

cap-std has io-lifetimes as a public dependency, io-lifetimes has socket2 as a public dependency, and socket2 had a semver bump from 0.4 to 0.5. Even though the socket2 dependency is optional, and exists only to provide trait impls for some socket2 types, it's enough to be a breaking change for at least some users, and we can't bump semver for some users and not others.

One option would be for you to remain on cap-std 1.x for now. I'm not aware of any major bugs in cap-std 1.x, and am willing to backport any bug fixes that do arise to cap-std 1.x and continue to do releases for it.

This comment has been minimized.

Copy link
@cgwalters

cgwalters Jul 14, 2023

Contributor

socket2 had a semver bump from 0.4 to 0.5

That's it? OK so now my question moves to that project, and looking at rust-lang/socket2@3aa8d82

I just find myself underwhelmed with the benefits to this semver break.

One option would be for you to remain on cap-std 1.x for now.

If you are committed to releasing 2.0, then we will do the work to port. I don't have enough of a rationale to sticking to 1.0 for any kind of long term.

I just expected a bit more ceremony and motivation in a major semver bump from an important crate like this...

This comment has been minimized.

Copy link
@sunfishcode

sunfishcode Jul 14, 2023

Author Member

There is a potential rationale for sticking to 1.0 if you can foresee needing a semver bump for any other reason in the future. You could just stay on 1.0 for now, and then do one semver bump for both reasons later.

This comment has been minimized.

Copy link
@cgwalters

cgwalters Jul 14, 2023

Contributor

Yes, thanks. I appreciate the offer to continue porting fixes to 1.0. But, I do know how to handle semver bumps. I just am questioning the value of this semver bump and wondering about just how often it might churn in the future.

Backing up, I think it's problematic for libraries which are at 1.0 to depend on < 1.0 in their public API.

If this had been more visible to me earlier, I would have argued for severing the socket2 dependency from io-lifetimes into a separate io-lifetimes-socket2 crate I think. We still could do that right?

This comment has been minimized.

Copy link
@sunfishcode

sunfishcode Jul 14, 2023

Author Member

Yes, severing the socket2 dependency is possible, though it's more involved than just an io-lifetimes-socket2 crate, because cap-std itself has impls for the traits in question, so just moving the socket2 dependency to a different crate wouldn't eliminate cap-std's public dependency on it.

Possibly what I should have done here is delete the FilelikeView/SocketlikeView utilities in io-lifetimes, and the associated traits, altogether, back when io-lifetimes 1.0 was happening. They're useful utilities, and there are several crates that use them, but in retrospect, perhaps they're not worth having socket2 as a public dependency.

Indeed, it's not too late to do that. That said, it would require yet another semver break, and it would need source changes in at least 5 downstream crates that I know of which use those utilities.

And on the other hand, socket2's previous semver bump was over 2 years ago, so another option would be to speculate that maybe it won't have another for a while. I'm open to ideas here.

This comment has been minimized.

Copy link
@cgwalters

cgwalters Jul 15, 2023

Contributor

First I want to emphasize here: Thank you for all the work you do in maintaining this crate and others (and thanks to the socket2 maintainers as well)!. In all conversations like this I think it's important to acknowledge the often not-explicitly-thanked job of working on FOSS.

At the same time, I in turn have other projects that depend on my projects, and this change is requiring new work for me with an IMO low benefit.

For this project (unlike socket2) I did intentionally contribute - not much honestly, certainly less than 1% of the work so far. But it was intentional because I think it's important to try to spend some time looking at and assisting with one's dependencies.

(Also in the case of this crate I think it's just of benefit to all of us to move towards a capability-oriented model...I am dealing with another project written in Go that would really benefit from using fd-relative accesses, but that's another story).

But beyond just assisting with dependencies, an explicit goal for me is to build up "social capital" in the project - for precisely reasons like this, to have a "vote" in discussions.

This comment has been minimized.

Copy link
@cgwalters

cgwalters Jul 15, 2023

Contributor

Anyways back to a technical level, today at least in the ostree crate we just use cap_std::fs::Dir as a way for higher level code to pass down a directory.

I think honesty this is something longer term we want in Rust std - in order to have the capability model widespread in Rust, it's to benefit to all of us to make it as easy as possible to interchange these types.

So I see a few options here:

  • Give up on higher level type safety, and just pass a std::fs::File here, and use conversion APIs between crates (this seems totally viable to me, just sightly less than ideal)
  • Factor out a crate like cap-std-types that will be permanently 1.0 and would just have things like struct DirReference(File) and both cap-std 1.0 and cap-std-2.0 would have From/Into between Dir and cap-std-types::DirReference.
  • Try to push to move DirReference into std

However, it may not just be Dir...I could imagine wanting to return types from cap_tempfile in public APIs.

Finally, we have cap-std-ext which really just needs to be major-semver locked. Due to a historical mistake of exposing rustix in the public API, it will now need to bump to 3.0. That part is fine and trivial. The harder part is the ricochet effect.

(In ostree, we also depend on the glib crate which has also bumped semver, and to avoid a "multiplicative effect" for our sanity we've been trying to combine semver bumps of glib and other semver-incompatible things, so this will need to be rolled with that - again)

This comment has been minimized.

Copy link
@sunfishcode

sunfishcode Jul 18, 2023

Author Member

I do appreciate your contribution, and value your perspective. And I agree, I made a mistake in not giving more heads up before deciding to make a semver bump in cap-std. I'll work to give more in the future.

Give up on higher level type safety, and just pass a std::fs::File here

As you say, this is an option, with tradeoffs.

Factor out a crate like cap-std-types
Try to push to move DirReference into std

DirReference is an interesting question. My guess that a simple newtype that doesn't do any kind of sandboxing woudln't add enough value over just using std::fs::File to be worth making a whole new permenantly-1.0 crate, or even a standard library type. So perhaps the best path forward here is to just to be more careful with cap-std going forward.

description = "Capability-based version of the Rust standard library"
authors = [
"Dan Gohman <dev@sunfishcode.online>",
Expand All @@ -20,12 +20,12 @@ rust-version = "1.63"
#async-std = { version = "1.10.0", features = ["attributes"] }
anyhow = "1.0.37"
#cap-async-std = { path = "cap-async-std", version = "^0.25.0" }
cap-fs-ext = { path = "cap-fs-ext", version = "^1.0.16" }
cap-net-ext = { path = "cap-net-ext", version = "^1.0.16" }
cap-directories = { path = "cap-directories", version = "^1.0.16" }
cap-std = { path = "cap-std", version = "^1.0.16" }
cap-tempfile = { path = "cap-tempfile", version = "^1.0.16" }
cap-rand = { path = "cap-rand", version = "^1.0.16" }
cap-fs-ext = { path = "cap-fs-ext", version = "^2.0.0" }
cap-net-ext = { path = "cap-net-ext", version = "^2.0.0" }
cap-directories = { path = "cap-directories", version = "^2.0.0" }
cap-std = { path = "cap-std", version = "^2.0.0" }
cap-tempfile = { path = "cap-tempfile", version = "^2.0.0" }
cap-rand = { path = "cap-rand", version = "^2.0.0" }
rand = "0.8.1"
tempfile = "3.1.0"
camino = "1.0.5"
Expand Down
4 changes: 2 additions & 2 deletions cap-directories/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cap-directories"
version = "1.0.16"
version = "2.0.0"
description = "Capability-based standard directories for config, cache and other data"
authors = [
"Dan Gohman <dev@sunfishcode.online>",
Expand All @@ -13,7 +13,7 @@ repository = "https://github.com/bytecodealliance/cap-std"
edition = "2021"

[dependencies]
cap-std = { path = "../cap-std", version = "^1.0.16" }
cap-std = { path = "../cap-std", version = "^2.0.0" }
directories-next = "2.0.0"

[target.'cfg(not(windows))'.dependencies]
Expand Down
6 changes: 3 additions & 3 deletions cap-fs-ext/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cap-fs-ext"
version = "1.0.16"
version = "2.0.0"
description = "Extension traits for `Dir`, `File`, etc."
authors = [
"Dan Gohman <dev@sunfishcode.online>",
Expand All @@ -15,8 +15,8 @@ edition = "2021"
[dependencies]
arf-strings = { version = "0.7.0", optional = true }
#cap-async-std = { path = "../cap-async-std", optional = true, version = "^0.25.0" }
cap-std = { path = "../cap-std", optional = true, version = "^1.0.16" }
cap-primitives = { path = "../cap-primitives", version = "^1.0.16" }
cap-std = { path = "../cap-std", optional = true, version = "^2.0.0" }
cap-primitives = { path = "../cap-primitives", version = "^2.0.0" }
io-lifetimes = { version = "2.0.0", default-features = false }
# Enable "unstable" for `spawn_blocking`.
#async-std = { version = "1.10.0", features = ["attributes", "unstable"], optional = true }
Expand Down
6 changes: 3 additions & 3 deletions cap-net-ext/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cap-net-ext"
version = "1.0.16"
version = "2.0.0"
description = "Extension traits for `TcpListener`, `Pool`, etc."
authors = [
"Dan Gohman <dev@sunfishcode.online>",
Expand All @@ -13,7 +13,7 @@ repository = "https://github.com/bytecodealliance/cap-std"
edition = "2021"

[dependencies]
cap-std = { path = "../cap-std", version = "^1.0.16" }
cap-primitives = { path = "../cap-primitives", version = "^1.0.16" }
cap-std = { path = "../cap-std", version = "^2.0.0" }
cap-primitives = { path = "../cap-primitives", version = "^2.0.0" }
rustix = { version = "0.38.0", features = ["net"] }
smallvec = "1.10"
2 changes: 1 addition & 1 deletion cap-primitives/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cap-primitives"
version = "1.0.16"
version = "2.0.0"
description = "Capability-based primitives"
authors = [
"Dan Gohman <dev@sunfishcode.online>",
Expand Down
2 changes: 1 addition & 1 deletion cap-rand/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cap-rand"
version = "1.0.16"
version = "2.0.0"
description = "Capability-based random number generators"
authors = [
"Dan Gohman <dev@sunfishcode.online>",
Expand Down
4 changes: 2 additions & 2 deletions cap-std/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cap-std"
version = "1.0.16"
version = "2.0.0"
description = "Capability-based version of the Rust standard library"
authors = [
"Dan Gohman <dev@sunfishcode.online>",
Expand All @@ -18,7 +18,7 @@ rustdoc-args = ["--cfg=doc_cfg"]

[dependencies]
arf-strings = { version = "0.7.0", optional = true }
cap-primitives = { path = "../cap-primitives", version = "^1.0.16" }
cap-primitives = { path = "../cap-primitives", version = "^2.0.0" }
io-extras = "0.18.0"
io-lifetimes = { version = "2.0.0", default-features = false }
camino = { version = "1.0.5", optional = true }
Expand Down
4 changes: 2 additions & 2 deletions cap-tempfile/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cap-tempfile"
version = "1.0.16"
version = "2.0.0"
description = "Capability-based temporary directories"
authors = [
"Dan Gohman <dev@sunfishcode.online>",
Expand All @@ -13,7 +13,7 @@ repository = "https://github.com/bytecodealliance/cap-std"
edition = "2021"

[dependencies]
cap-std = { path = "../cap-std", version = "^1.0.16" }
cap-std = { path = "../cap-std", version = "^2.0.0" }
uuid = { version = "1.0.0", features = ["v4"] }
camino = { version = "1.0.5", optional = true }

Expand Down
6 changes: 3 additions & 3 deletions cap-time-ext/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cap-time-ext"
version = "1.0.16"
version = "2.0.0"
description = "Extension traits for `SystemClock` and `MonotonicClock`"
authors = [
"Dan Gohman <dev@sunfishcode.online>",
Expand All @@ -13,8 +13,8 @@ repository = "https://github.com/bytecodealliance/cap-std"
edition = "2021"

[dependencies]
cap-primitives = { path = "../cap-primitives", version = "^1.0.16" }
cap-std = { path = "../cap-std", optional = true, version = "^1.0.16" }
cap-primitives = { path = "../cap-primitives", version = "^2.0.0" }
cap-std = { path = "../cap-std", optional = true, version = "^2.0.0" }

[target.'cfg(not(windows))'.dependencies]
rustix = { version = "0.38.0", features = ["time"] }
Expand Down

0 comments on commit 963eebf

Please sign in to comment.