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

Failing to compile 3.1.1 #5

Closed
wathiede opened this issue Jan 31, 2024 · 5 comments
Closed

Failing to compile 3.1.1 #5

wathiede opened this issue Jan 31, 2024 · 5 comments

Comments

@wathiede
Copy link
Contributor

I'm seeing

error[E0599]: no method named `set_reuse_port` found for struct `Socket` in the current scope
   --> .../foundations/foundations/src/telemetry/server.rs:139:12
    |                                                                                                                       
139 |     socket.set_reuse_port(true)?;
    |            ^^^^^^^^^^^^^^ method not found in `Socket`
                               
For more information about this error, try `rustc --explain E0599`.
error: could not compile `foundations` (lib) due to 1 previous error

It would appear this method isn't available unless socket2 is compiled with the all feature, see https://github.com/rust-lang/socket2/blob/master/src/sys/unix.rs#L2134-L2151

wathiede added a commit to wathiede/foundations that referenced this issue Jan 31, 2024
@inikulin
Copy link
Collaborator

Hi, thank you for the contribution.

This makes sense, but I'm confused by the fact that we don't see failures in CI and using the library on our side. Could you share the feature combination that you're using and Rust version?

@Noah-Kennedy
Copy link
Collaborator

What operating system are you on?

@wathiede
Copy link
Contributor Author

wathiede commented Feb 1, 2024

I think I see the problem, and it's probably not worth accepting this pull request.

A minimal fresh project trying to use foundations on my machine works, but when I first tried to use foundations by adding it to an existing program I got the error listed above. By comparing cargo tree output from the working and non-working crates, I realized the Cargo.lock for the broken crate had hyper=0.14.16 which included socket2=0.4.3. If I cargo update that crate things build.

I might still push for this PR, or another that was more specific about the hyper versions (later versions include socket=0.5.5 like foundations do), but I see https://crates.io/crates/socket2/0.4.3 was yanked. So this is really an esoteric issue caused by my stale lockfile.

Sorry for the noise.

@wathiede wathiede closed this as completed Feb 1, 2024
@Noah-Kennedy
Copy link
Collaborator

If we are relying on features in direct dependencies that we are failing to specify, then that is a bug.

If you reopen the PR, either I or @inikulin will merge.

@Noah-Kennedy
Copy link
Collaborator

Merged #6.

Noah-Kennedy added a commit that referenced this issue Feb 12, 2024
This change modifies our docs check to have it behave like `docs.rs`
does and adds a minimal versions check which ensures that the semver
requirements foundations uses for dependency crates are sufficiently
high to ensure that foundations can still be built even with a lockfile
filled with the oldest possible versions of its dependencies.

This would have caught the error that forced us to put out #16 and would
have prevented #5.
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

3 participants