Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

new: Allow mapping libc values #20

Merged
merged 2 commits into from
Mar 4, 2024
Merged

Conversation

Phault
Copy link
Contributor

@Phault Phault commented Mar 2, 2024

Some projects use different casing, naming or omits whatever is considered the default. To account for this, the interpolated libc can be customized using [install.libc] similarly to [install.arch].

Ran into this while creating a Biome plugin, as it omits the libc part if gnu is used.

Some projects use different casing, naming or omits whatever is considered the default. To account for this, the interpolated libc can be customized using [install.libc] similarly to [install.arch].
@milesj milesj self-requested a review March 2, 2024 19:48
src/schema.rs Outdated
@@ -18,10 +18,24 @@ pub struct DetectSchema {
pub version_files: Option<Vec<String>>,
}

#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq)]
#[serde(rename_all = "lowercase")]
pub enum HostLibc {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let me pull this over into the system_env crate, as it'll be useful there also.

@milesj
Copy link
Contributor

milesj commented Mar 3, 2024

@Phault Landed and published the crates for this moonrepo/proto#426

If you want to update the deps and use that, this should be good to go.

@Phault
Copy link
Contributor Author

Phault commented Mar 4, 2024

@Phault Landed and published the crates for this moonrepo/proto#426

If you want to update the deps and use that, this should be good to go.

Great, I've updated it to use that now. 👍

@@ -180,13 +180,15 @@ fn interpolate_tokens(

// Avoid detecting musl unless requested
if value.contains("{libc}") {
let libc = HostLibc::detect(env.os);
Copy link
Contributor

Choose a reason for hiding this comment

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

There's a new env.libc you can use here, since detect won't work in wasm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh, didn't realize the implementation of is_musl was different. Glad you caught it.

@milesj
Copy link
Contributor

milesj commented Mar 4, 2024

I'll land this and make the change so I can get it in the next release.

Thanks!

@milesj milesj merged commit fe6599a into moonrepo:master Mar 4, 2024
8 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants