Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable "std" feature on linux-raw-sys when "std" feature is enabled #945

Open
notgull opened this issue Nov 26, 2023 · 7 comments
Open

Enable "std" feature on linux-raw-sys when "std" feature is enabled #945

notgull opened this issue Nov 26, 2023 · 7 comments

Comments

@notgull
Copy link
Contributor

notgull commented Nov 26, 2023

As "std" changes API details from linux-raw-sys that is exposed in the public API, this would be a breaking change.

cc #753

@sdroege
Copy link

sdroege commented Dec 9, 2023

This currently means that xattr (1.1.0) and rustix can't be used in the same crate. xattr enables the std feature of linux-raw-sys, and rustix then fails compiling if also the net feature of rustix is enabled.

error[E0308]: mismatched types
  --> src/backend/linux_raw/net/addr.rs:39:32
   |
39 |             unix.sun_path[i] = *b;
   |             ----------------   ^^ expected `i8`, found `u8`
   |             |
   |             expected due to the type of this binding

error[E0308]: mismatched types
    --> src/backend/linux_raw/net/addr.rs:52:32
     |
52   |             id.copy_from_slice(name);
     |                --------------- ^^^^ expected `&[i8]`, found `&[u8]`
     |                |
     |                arguments to this method are incorrect
     |
     = note: expected reference `&[i8]`
                found reference `&[u8]`
[...]

gstreamer-github pushed a commit to sdroege/gst-plugin-rs that referenced this issue Dec 9, 2023
Keep dash-mpd at 0.14.5 and xattr at 1.0.1 because otherwise compilation
fails, see:
  - Stebalien/xattr#44
  - bytecodealliance/rustix#945

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1404>
Stebalien added a commit to Stebalien/xattr that referenced this issue Dec 9, 2023
This reverts rustix support until enabling the "std" feature no longer
causes downstream breakage.

See:

- bytecodealliance/rustix#945
- #44
@edulix
Copy link

edulix commented Dec 9, 2023

I'm having this same issue. Our build suddently is broken:

error[E0308]: mismatched types
  --> /home/vscode/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustix-0.38.27/src/backend/linux_raw/net/addr.rs:39:32
   |
39 |             unix.sun_path[i] = *b;
   |             ----------------   ^^ expected `i8`, found `u8`
   |             |
   |             expected due to the type of this binding

error[E0308]: mismatched types
  --> /home/vscode/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustix-0.38.27/src/backend/linux_raw/net/addr.rs:52:32
   |
52 |             id.copy_from_slice(name);
   |                --------------- ^^^^ expected `&[i8]`, found `&[u8]`
   |                |
   |                arguments to this method are incorrect
   |
   = note: expected reference `&[i8]`
              found reference `&[u8]`
note: method defined here
  --> /rustc/9d871b0617a4b3d6610b7cee0ab5310dcb542c62/library/core/src/slice/mod.rs:3331:12

@edulix
Copy link

edulix commented Dec 9, 2023

BTW Possible temporal quick and dirty fix: depend on rustix = "0.38.26" and it works. It got broken in a patch release..

@Stebalien
Copy link
Contributor

xattr 1.1.1 has been released with a fix (reverts the change). I've yanked 1.1.0 now to prevent his from spreading.

@Stebalien
Copy link
Contributor

(unless your issue is unrelated to xattr)

@sunfishcode
Copy link
Member

I've now submitted #971 with a fix for this.

@sunfishcode
Copy link
Member

#971 is now released in rustix 0.38.28.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants