Skip to content

Commit 6b45c9e

Browse files
authored
Merge pull request #1223 from pkgxdev/fix-1154
update libsemverator dep
2 parents cfdd250 + 4994bea commit 6b45c9e

File tree

11 files changed

+79
-59
lines changed

11 files changed

+79
-59
lines changed

.github/workflows/cd.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ jobs:
4646
run: gh release upload --clobber
4747
v${{ github.event.inputs.version }}
4848
../$FILENAME.tar.xz
49-
working-directory:
50-
${{ env.FILENAME }}
49+
working-directory: ${{ env.FILENAME }}
5150
env:
5251
# using this token rather than github.token due to `release not found` bug
5352
# https://github.com/pkgxdev/cli/issues/5252
@@ -90,6 +89,15 @@ jobs:
9089
with:
9190
name: srcs
9291

92+
# debian:buster is archived, so we need to fix its sources.list
93+
- name: fix debian:buster
94+
if: ${{ matrix.platform.container == 'debian:buster-slim' }}
95+
run: sed -i 's/deb.debian.org/archive.debian.org/g' /etc/apt/sources.list
96+
97+
- run: |
98+
apt-get update
99+
apt-get install curl gcc perl-modules openssl make xz-utils --yes
100+
93101
- uses: pkgxdev/setup@v4
94102
with:
95103
+: ${{ matrix.platform.pkgs }}

.github/workflows/ci.ca-cert.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
jobs:
1717
build:
1818
runs-on: ubuntu-latest
19-
container: debian:buster-slim
19+
container: debian:bullseye-slim
2020
steps:
2121
- uses: actions/checkout@v5
2222
- run: apt-get update && apt-get install -y curl gcc perl make
@@ -30,7 +30,7 @@ jobs:
3030
test:
3131
needs: build
3232
runs-on: ubuntu-latest
33-
container: debian:buster-slim
33+
container: debian:bullseye-slim
3434
steps:
3535
- uses: actions/download-artifact@v6
3636
with:

.github/workflows/ci.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ jobs:
119119
- run: pkgx -qq git --version
120120
- run: pkgx -s git --version
121121
- run: pkgx -j +git
122-
- run: pkgx git\* --version # test star constraints are valid
122+
- run: pkgx git\* --version # test star constraints are valid
123123
- run: pkgx /usr/bin/awk --version
124124
- run: pkgx +yarnpkg.com yarn --version
125125
- run: pkgx +yarnpkg.com -- yarn --version
@@ -129,9 +129,11 @@ jobs:
129129
- run: pkgx -v +agg
130130
# testing we correctly handle +pkg syntax for pkgs with no env
131131
- run: pkgx +curl.se/ca-certs
132+
# regression test: cargo has deep deps on linux that exercise range intersection
133+
- run: pkgx +cargo
132134

133-
- run: '! pkgx flubber-flubbles' # cmd not found machinery
134-
- run: '! pkgx --sync flubber-flubbles' # cmd not found machinery separate if branch
135+
- run: "! pkgx flubber-flubbles" # cmd not found machinery
136+
- run: "! pkgx --sync flubber-flubbles" # cmd not found machinery separate if branch
135137

136138
# create a fork bomb, but since it’s via pkgx we prevent it
137139
- run: |
@@ -166,7 +168,7 @@ jobs:
166168
pkgx -Q
167169
168170
- run: if [ $(find ~/.pkgx -name .tmp\* -type d | wc -l) -gt 0 ]; then
169-
exit 1;
171+
exit 1;
170172
fi
171173

172174
- name: --shebang test 1
@@ -178,7 +180,7 @@ jobs:
178180
- name: --shebang test 2
179181
run: test $(pkgx -q! echo fail hi) = hi
180182

181-
- name: '@latest'
183+
- name: "@latest"
182184
run: |
183185
pkgx semverator eq $(pkgx krampus=0.2.0 --version) 0.2.0
184186
pkgx semverator gt $(pkgx krampus@latest --version) 0.2.0
@@ -230,7 +232,7 @@ jobs:
230232
test-minimal-container:
231233
needs: fmt
232234
runs-on: ubuntu-latest
233-
container: debian:buster-slim
235+
container: debian:bullseye-slim
234236
steps:
235237
- uses: actions/checkout@v5
236238
- run: apt-get update && apt-get install -y curl make gcc perl

Cargo.lock

Lines changed: 41 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/cli/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "pkgx"
33
description = "Run anything"
44
authors = ["Max Howell <mxcl@me.com>", "Jacob Heider <jacob@pkgx.dev>"]
55
license = "Apache-2.0"
6-
version = "2.7.0"
6+
version = "2.7.1"
77
edition = "2021"
88
repository = "https://github.com/pkgxdev/pkgx"
99

@@ -15,13 +15,13 @@ indicatif = "0.18.3"
1515
nix = { version = "0.30.1", features = ["process"] }
1616
serde_json = "1.0.135"
1717
serde = { version = "1.0", features = ["derive"] }
18-
libpkgx = { version = "0.7.0", path = "../lib" }
18+
libpkgx = { version = "0.7.1", path = "../lib" }
1919
console = { version = "0.16", default-features = false, features = [
2020
"ansi-parsing",
2121
] }
2222

2323
[target.'cfg(not(target_os = "macos"))'.dependencies]
24-
rusqlite = { version = "0.33.0", features = ["bundled"] }
24+
rusqlite = { version = "0.37.0", features = ["bundled"] }
2525
native-tls = { version = "0.2", features = ["vendored"] }
2626
# ^^ this is a transitive dependency
2727
# ^^ we vendor OpenSSL ∵ we want to be standalone and just work inside minimal docker images

crates/cli/src/dump.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@ pub fn dump(
4444
}
4545

4646
let programs = pantry_db::programs_for_project(&project, &conn)?;
47-
let companions = pantry_db::companions_for_projects(&[project.clone()], &conn)?
48-
.iter()
49-
.map(|c| c.to_string())
50-
.collect::<Vec<String>>();
47+
let companions =
48+
pantry_db::companions_for_projects(std::slice::from_ref(&project), &conn)?
49+
.iter()
50+
.map(|c| c.to_string())
51+
.collect::<Vec<String>>();
5152

5253
let pkg = JsonV2Pkg {
5354
path: installation.path,

crates/cli/src/execve.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub fn execve(
4747
// Replace the process with the new command, arguments, and environment
4848
let execve_result = nix_execve(&c_command, &c_args, &c_env);
4949
if execve_result.is_err() {
50-
let errno = execve_result.unwrap_err();
50+
let Err(errno) = execve_result;
5151
return Err(format!("execve failed with errno: {}", errno).into());
5252
}
5353

crates/lib/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "libpkgx"
33
description = "Install and run `pkgx` packages"
44
authors = ["Max Howell <mxcl@me.com>", "Jacob Heider <jacob@pkgx.dev>"]
55
license = "Apache-2.0"
6-
version = "0.7.0"
6+
version = "0.7.1"
77
edition = "2021"
88
repository = "https://github.com/pkgxdev/pkgx"
99

@@ -13,7 +13,7 @@ crate-type = ["cdylib", "rlib"]
1313
[dependencies]
1414
anyhow = "1.0.95"
1515
dirs-next = "2.0"
16-
libsemverator = { version = "0.10.0", features = ["serde"] }
16+
libsemverator = { version = "0.10.1", features = ["serde"] }
1717
serde = { version = "1.0", features = ["derive"] }
1818
serde_yaml = "0.9"
1919
tokio = { version = "1.43", features = ["full", "rt-multi-thread"] }
@@ -33,4 +33,4 @@ fs2 = "0.4.3"
3333
tempfile = "3.16.0"
3434

3535
[target.'cfg(not(target_os = "macos"))'.dependencies]
36-
rusqlite = { version = "0.33.0", features = ["bundled"] }
36+
rusqlite = { version = "0.37.0", features = ["bundled"] }

crates/lib/src/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ fn get_user_agent() -> String {
2929
let os = std::env::consts::OS;
3030
let arch = std::env::consts::ARCH;
3131
let group = env::var("PKGX_USER_AGENT_GROUP");
32-
let name = if group.is_ok() {
33-
format!("pkgx[{}]", group.unwrap())
32+
let name = if let Ok(valid_group) = group {
33+
format!("pkgx[{}]", valid_group)
3434
} else {
3535
"pkgx".to_string()
3636
};

crates/lib/src/install.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,7 @@ where
9898
}
9999
});
100100

101-
let stream = stream
102-
.map_err(|e| futures::io::Error::new(futures::io::ErrorKind::Other, e))
103-
.into_async_read();
101+
let stream = stream.map_err(futures::io::Error::other).into_async_read();
104102
let stream = stream.compat();
105103

106104
// Step 2: Create a XZ decoder
@@ -169,8 +167,7 @@ async fn symlink(installation: &Installation, config: &Config) -> Result<(), Box
169167
};
170168
let most_minor = versions
171169
.iter()
172-
.filter(|(version, _)| minor_range.satisfies(version))
173-
.next_back()
170+
.rfind(|(version, _)| minor_range.satisfies(version))
174171
.ok_or_else(|| {
175172
anyhow::anyhow!(
176173
"Could not find most minor version for {}",
@@ -189,8 +186,7 @@ async fn symlink(installation: &Installation, config: &Config) -> Result<(), Box
189186

190187
let most_major = versions
191188
.iter()
192-
.filter(|(version, _)| major_range.satisfies(version))
193-
.next_back()
189+
.rfind(|(version, _)| major_range.satisfies(version))
194190
.ok_or_else(|| anyhow::anyhow!("Could not find most major version"))?;
195191

196192
if most_major.0 != installation.pkg.version {

0 commit comments

Comments
 (0)