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

fix: assets ending in ".$OS.$ARCH" #71

Merged
merged 1 commit into from
Nov 10, 2024
Merged

Conversation

jdx
Copy link
Contributor

@jdx jdx commented Oct 28, 2024

@autarch
Copy link
Member

autarch commented Nov 3, 2024

Hi, thanks for your PR! I'm pretty finicky about my projects (see this blog post for details), so I rarely merge a PR as-is. I can move forward on your PR in one of two ways:

  1. I check it out locally, fiddle with it as needed, merge it locally, and simply close this PR. This will preserve at least one commit with your name on it, but the PR will show up as closed in your GitHub stats.
  2. If you enable me to push directly to your fork, I can do my fiddling, then force push to your fork and merge the resulting PR. Again, this will preserve at least one commit with your name on it, but you also get credit for the PR merge in your GitHub stats. The only downside is that I will be force pushing directly to your fork.

Please let me know which approach you'd prefer. If I don't hear from you before I get around to working on this PR I'll go with option #1.

Thanks again for your contribution!

Copy link
Member

@autarch autarch left a comment

Choose a reason for hiding this comment

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

Thanks for this fix. This looks good % some small stuff. I can make the changes myself or you can do it if you'd prefer. Please let me know.

ubi/src/os.rs Outdated Show resolved Hide resolved
ubi/src/os.rs Outdated
Comment on lines 72 to 54
pub(crate) static PLATFORM_RE: Lazy<Regex> = Lazy::new(|| {
Regex::new(
&[all_oses_re(), all_arches_re()]
.iter()
.map(|r| format!("({})", r.as_str()))
.join("|"),
)
.unwrap()
});
Copy link
Member

Choose a reason for hiding this comment

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

I think this can be constructed in the extension module by importing the relevant fns from os and arch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

idk how significant it is but won't that involve recompiling the final regex many times?

Copy link
Member

Choose a reason for hiding this comment

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

I thought the use of Lazy would mean it's only compiled once, right?

Copy link
Member

Choose a reason for hiding this comment

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

Or rather, can't Lazy also be used in the extension module? Maybe there's some issue with doing that?

Copy link
Contributor Author

@jdx jdx Nov 10, 2024

Choose a reason for hiding this comment

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

all_oses_re is not wrapped in Lazy and gets called many times, my PR fixes that though

Copy link
Member

Choose a reason for hiding this comment

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

Ah, right. I just pushed a change to make both of these static Lazy<Regex> vars instead of functions.

@jdx jdx force-pushed the sops branch 3 times, most recently from fc37558 to ad27390 Compare November 10, 2024 15:39
@jdx
Copy link
Contributor Author

jdx commented Nov 10, 2024

rebased

Copy link
Member

@autarch autarch left a comment

Choose a reason for hiding this comment

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

LGTM % one very small thing.

ubi/src/extension.rs Outdated Show resolved Hide resolved
@autarch
Copy link
Member

autarch commented Nov 10, 2024

Is it okay if I push to this PR. I want to tweak the commit message before merging.

@jdx
Copy link
Contributor Author

jdx commented Nov 10, 2024

yeah that's fine

@autarch autarch merged commit bc01f7f into houseabsolute:master Nov 10, 2024
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Mise fails to install sops >=3.8.1 via ubi
2 participants