Skip to content

Conversation

zbraniecki
Copy link
Member

Depends on #7112 .
Partially resolves #5869 implementing refactor plus documentation, and fixing #6574 .

@zbraniecki zbraniecki requested review from a team and nciric as code owners October 16, 2025 15:06
@zbraniecki zbraniecki force-pushed the host_info branch 10 times, most recently from 7b7864e to 84e83fe Compare October 17, 2025 00:24
Copy link
Member

@Manishearth Manishearth left a comment

Choose a reason for hiding this comment

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

API overall looks quite straightforward

/// assert_eq!(attrs, "foobar-foobaz-fooqux".parse().unwrap());
/// ```
#[cfg(feature = "alloc")]
pub fn extend(&mut self, other: Attributes) {
Copy link
Member

Choose a reason for hiding this comment

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

issue: these are new public APIs, we should consider these carefully

cc @sffc @robertbastian

Copy link
Member Author

Choose a reason for hiding this comment

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

this is reviewed in #7112

Copy link
Member

Choose a reason for hiding this comment

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

Ah, thanks!


/// An error encountered while retrieving the host information
#[derive(Debug, Display)]
pub enum HostInfoError {
Copy link
Member

Choose a reason for hiding this comment

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

thought (non blocking for initial landing): We should eventually consider whether we should split this into fine grained errors. Probably not, most of these are general.

Copy link
Member Author

Choose a reason for hiding this comment

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

I went back and forth on this and ended up coalescing. The original crate had more types of errors but I couldn't find a persona except of "ICU4X code contributor" who would be affected to the point where different classes of errors make sense.

Copy link
Member

Choose a reason for hiding this comment

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

Fair enough.

use crate::error::HostInfoError;

#[derive(Hash, Eq, PartialEq, Debug, Clone, Copy)]
pub enum LocaleCategory {
Copy link
Member

Choose a reason for hiding this comment

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

issue: is this actually pub, or just pub(crate)? Should this be under shared/ or something so that backend-specific stuff is distinct from API?

Copy link
Member Author

Choose a reason for hiding this comment

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

Many different OSes use some parts of POSIX (Android, Mac, Linux, Vega). I'm open to adjust visibility.

Right now it is private.

Copy link
Member

Choose a reason for hiding this comment

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

In that case, this should be pub(crate)

And perhaps the file should be under backends/shared/posix.rs

@zbraniecki
Copy link
Member Author

I'll need help figuring out how to avoid enabling gnome in our CI/CD at least. Right now I tried diabling it in Cargo.toml all-features section but it still gets enabled in many CI/CD commands. :(

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.

Publish env_preferences?

2 participants