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

0.8.0 fails to build on NetBSD #1047

Closed
0323pin opened this issue Aug 29, 2023 · 6 comments
Closed

0.8.0 fails to build on NetBSD #1047

0323pin opened this issue Aug 29, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@0323pin
Copy link

0323pin commented Aug 29, 2023

Description of the bug

0.8.0 fails to build on NetBSD using Rust-1.71.1 due to ioctl-rs

Expected behavior

No response

Actual behavior

Compiling ioctl-rs v0.1.6
error[E0425]: cannot find function ioctl in this scope
--> /usr/pkgsrc/wip/git-branchless/work/vendor/ioctl-rs-0.1.6/src/lib.rs:29:20
|
29 | match unsafe { ioctl(fd, TIOCEXCL) } {
| ^^^^^ not found in this scope
|
help: consider importing this function
|
3 + use libc::ioctl;
|

error[E0425]: cannot find value TIOCEXCL in this scope
--> /usr/pkgsrc/wip/git-branchless/work/vendor/ioctl-rs-0.1.6/src/lib.rs:29:30
|
29 | match unsafe { ioctl(fd, TIOCEXCL) } {
| ^^^^^^^^ not found in this scope
|
help: consider importing this constant
|
3 + use libc::TIOCEXCL;
|

error[E0425]: cannot find function ioctl in this scope
--> /usr/pkgsrc/wip/git-branchless/work/vendor/ioctl-rs-0.1.6/src/lib.rs:37:20
|
37 | match unsafe { ioctl(fd, TIOCNXCL) } {
| ^^^^^ not found in this scope
|
help: consider importing this function
|
3 + use libc::ioctl;
|

error[E0425]: cannot find value TIOCNXCL in this scope
--> /usr/pkgsrc/wip/git-branchless/work/vendor/ioctl-rs-0.1.6/src/lib.rs:37:30
|
37 | match unsafe { ioctl(fd, TIOCNXCL) } {
| ^^^^^^^^ not found in this scope
|
help: consider importing this constant
|
3 + use libc::TIOCNXCL;
|

error[E0425]: cannot find function ioctl in this scope
--> /usr/pkgsrc/wip/git-branchless/work/vendor/ioctl-rs-0.1.6/src/lib.rs:47:20
|
47 | match unsafe { ioctl(fd, TIOCMGET, &mut bits) } {
| ^^^^^ not found in this scope
|
help: consider importing this function
|
3 + use libc::ioctl;
|

error[E0425]: cannot find value TIOCMGET in this scope
--> /usr/pkgsrc/wip/git-branchless/work/vendor/ioctl-rs-0.1.6/src/lib.rs:47:30
|
47 | match unsafe { ioctl(fd, TIOCMGET, &mut bits) } {
| ^^^^^^^^ not found in this scope
|
help: consider importing this constant
|
3 + use libc::TIOCMGET;
|

error[E0425]: cannot find function ioctl in this scope
--> /usr/pkgsrc/wip/git-branchless/work/vendor/ioctl-rs-0.1.6/src/lib.rs:55:20
|
55 | match unsafe { ioctl(fd, TIOCMSET, &bits) } {
| ^^^^^ not found in this scope
|
help: consider importing this function
|
3 + use libc::ioctl;
|

error[E0425]: cannot find value TIOCMSET in this scope
--> /usr/pkgsrc/wip/git-branchless/work/vendor/ioctl-rs-0.1.6/src/lib.rs:55:30
|
55 | match unsafe { ioctl(fd, TIOCMSET, &bits) } {
| ^^^^^^^^ not found in this scope
|
help: consider importing this constant
|
3 + use libc::TIOCMSET;
|

error[E0425]: cannot find function ioctl in this scope
--> /usr/pkgsrc/wip/git-branchless/work/vendor/ioctl-rs-0.1.6/src/lib.rs:63:20
|
63 | match unsafe { ioctl(fd, TIOCMBIS, &bits) } {
| ^^^^^ not found in this scope
|
help: consider importing this function
|
3 + use libc::ioctl;
|

error[E0425]: cannot find value TIOCMBIS in this scope
--> /usr/pkgsrc/wip/git-branchless/work/vendor/ioctl-rs-0.1.6/src/lib.rs:63:30
|
63 | match unsafe { ioctl(fd, TIOCMBIS, &bits) } {
| ^^^^^^^^ not found in this scope
|
help: consider importing this constant
|
3 + use libc::TIOCMBIS;
|

error[E0425]: cannot find function ioctl in this scope
--> /usr/pkgsrc/wip/git-branchless/work/vendor/ioctl-rs-0.1.6/src/lib.rs:71:20
|
71 | match unsafe { ioctl(fd, TIOCMBIC, &bits) } {
| ^^^^^ not found in this scope
|
help: consider importing this function
|
3 + use libc::ioctl;
|

error[E0425]: cannot find value TIOCMBIC in this scope
--> /usr/pkgsrc/wip/git-branchless/work/vendor/ioctl-rs-0.1.6/src/lib.rs:71:30
|
71 | match unsafe { ioctl(fd, TIOCMBIC, &bits) } {
| ^^^^^^^^ not found in this scope
|
help: consider importing this constant
|
3 + use libc::TIOCMBIC;
|

For more information about this error, try rustc --explain E0425.
error: could not compile ioctl-rs (lib) due to 12 previous errors
warning: build failed, waiting for other jobs to finish...
*** Error code 101

Stop.
make[1]: stopped in /usr/pkgsrc/wip/git-branchless
*** Error code 1

Stop.

Version of rustc

1.71.1

Automated bug report

No response

Version of git-branchless

0.8.0

Version of git

No response

@0323pin 0323pin added the bug Something isn't working label Aug 29, 2023
@0323pin
Copy link
Author

0323pin commented Aug 29, 2023

@arxanas The same issue as when 0.7.0 was released :(
#842

@arxanas
Copy link
Owner

arxanas commented Aug 29, 2023

@0323pin unfortunately, the attempt to fix it by separating the problematic dependency into its own crate causes a circular dependency that means it can't be published to Cargo (git-branchless-testing has a normal dependency on git-branchless-lib and git-branchless-lib has a dev-dependency on git-branchless-testing). Some options for you could be:

@0323pin
Copy link
Author

0323pin commented Aug 29, 2023

@arxanas Cheers, I'll try patching ioctl-rs and serial-rs with the unmerged PRs and inject the relevant support
See, dcuddeback/ioctl-rs#5 and dcuddeback/serial-rs#63

Hopefully, I won't hit version mismatch requiring further patches.

@0323pin
Copy link
Author

0323pin commented Aug 30, 2023

@arxanas I've managed to fix the build and merged the update to 0.8.0
It ain't pretty, https://mail-index.netbsd.org/pkgsrc-changes/2023/08/30/msg281603.html

4 patches and injecting a file into vendor/ioctl-rs-0.1.6/src/os/ with NetBSD definitions but, it does the job.

Unfortunately, it doesn't look like the relevant pull requests on ioctl-rs and serial-rs will ever be merged, both crates are simply bit rotting. Have you considered forking these and simply keeping them up-to-date?

Feel free to close this issue and thanks for the hints.

@arxanas
Copy link
Owner

arxanas commented Sep 12, 2023

@0323pin I don't plan to maintain forks myself, but, depending on how you're maintaining the NetBSD package, you can use the existing forked repositories in the patch section of Cargo.toml.

@0323pin
Copy link
Author

0323pin commented Sep 13, 2023

I don't plan to maintain forks myself,

I understand that.

you can use the existing forked repositories in the patch section of Cargo.toml.

Yes, I'm aware of this and it's doable. It won't stop the bitrot, though. Those crates are not being updated.

Don't worry, I'll give it a thought and might consider an alternative solution. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants