Skip to content

stty: refine target configuration - #15360

Open
xtqqczze wants to merge 2 commits into
uutils:mainfrom
xtqqczze:build/stty-targets
Open

xtqqczze wants to merge 2 commits into
uutils:mainfrom
xtqqczze:build/stty-targets

Conversation

@xtqqczze

@xtqqczze xtqqczze commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator
  • Refine the stty target configuration to explicitly exclude unsupported platforms, skipping compilation where it would otherwise fail.
  • Add missing rustix/fs feature.
$ cargo check -q -p uu_stty
error[E0433]: cannot find `fs` in `rustix`
   --> src/uu/stty/src/stty.rs:249:47
    |
249 |                         .custom_flags(rustix::fs::OFlags::NONBLOCK.bits() as i32)
    |                                               ^^ could not find `fs` in `rustix`
    |
note: found an item that was configured out
   --> ~/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustix-1.1.5/src/lib.rs:223:9
    |
221 | #[cfg(feature = "fs")]
    |       -------------- the item is gated behind the `fs` feature
222 | #[cfg_attr(docsrs, doc(cfg(feature = "fs")))]
223 | pub mod fs;
    |         ^^
note: found an item that was configured out
   --> ~/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustix-1.1.5/src/lib.rs:342:16
    |
330 |     linux_raw,
    |     --------- the item is gated here
...
342 | pub(crate) mod fs;
    |                ^^

Relates to: #14912.

Comment thread src/uu/stty/Cargo.toml
doctest = false

[target.'cfg(unix)'.dependencies]
[target.'cfg(all(unix, not(any(target_os = "aix", target_os = "dragonfly"))))'.dependencies]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing clap means we cannot build anyway. Is this worth to increase complexity?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems less complex to be explicit about configuration

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? not(unix) is much simpler and we cannot support aix in any cases.

@xtqqczze xtqqczze Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing clap means we cannot build anyway

what do you mean by this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of our utility depends on clap. So there is no reason to cfg out it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To add check-only CI for less common targets, it would be helpful if commands like the following could succeed:

RUSTC_BOOTSTRAP=1 cargo hack clippy -Zbuild-std \
  --quiet --workspace --all-features \
  --target=powerpc64-ibm-aix

@oech3 oech3 Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But build-std is high cost to run on the all CI. Is threre any pre-built std we can use?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's just an example, -Zbuild-std wouldn't be necessary for most targets.

@oech3 oech3 Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you just want to avoid fetching unnecessary crates? Then, this change is making a sense.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoiding fetching unnecessary crates is another benefit.

@xtqqczze
xtqqczze marked this pull request as ready for review October 15, 2026 10:34
@xtqqczze

Copy link
Copy Markdown
Collaborator Author

@oech3 Would you rebase #15299 onto this to fix the compiler errors?

@oech3

oech3 commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

after one of them was merged

@xtqqczze

Copy link
Copy Markdown
Collaborator Author

@oech3 this should merge before #15299 as uu_stty doesn't currently compile (fails since #15331)

@oech3

oech3 commented Oct 15, 2026 via email

Copy link
Copy Markdown
Contributor

@oech3

oech3 commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

How about merging this by yourself since this looks serious? Collaborator has priv to merge this.

@xtqqczze

Copy link
Copy Markdown
Collaborator Author

No I do not write permissions on main; I've already requested @sylvestre review.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

2 participants