Skip to content

Commit 2e7ba90

Browse files
committed
update libexec for pkgx^2
no longer produces `v*`.
1 parent 552d4b6 commit 2e7ba90

15 files changed

Lines changed: 44 additions & 30 deletions

File tree

.github/workflows/ci.actions.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ jobs:
2121
steps:
2222
- uses: actions/checkout@v4
2323
with:
24-
path: co # test that things working isn’t just a coincident of PWD == BREKWIT_DIR
24+
path: co # test that things working isn’t just a coincident of PWD == BREKWIT_DIR
2525

26-
- uses: pkgxdev/setup@v2
26+
- uses: pkgxdev/setup@v4
2727

2828
- uses: ./co/build
2929
id: build
@@ -54,8 +54,8 @@ jobs:
5454
steps:
5555
- uses: actions/checkout@v4
5656
with:
57-
path: co # test that things working isn’t just a coincident of PWD == BREKWIT_DIR
58-
- uses: pkgxdev/setup@v2
57+
path: co # test that things working isn’t just a coincident of PWD == BREKWIT_DIR
58+
- uses: pkgxdev/setup@v4
5959
- uses: ./co/download-build-artifact
6060
with:
6161
pkg: ${{ needs.build.outputs.pkg }}
@@ -77,8 +77,8 @@ jobs:
7777
steps:
7878
- uses: actions/checkout@v4
7979
with:
80-
path: co # test that things working isn’t just a coincident of PWD == BREKWIT_DIR
81-
- uses: pkgxdev/setup@v2
80+
path: co # test that things working isn’t just a coincident of PWD == BREKWIT_DIR
81+
- uses: pkgxdev/setup@v4
8282
- uses: ./co/download-build-artifact
8383
with:
8484
pkg: ${{ needs.build.outputs.pkg }}
@@ -100,9 +100,9 @@ jobs:
100100
steps:
101101
- uses: actions/checkout@v4
102102
with:
103-
path: co # test that things working isn’t just a coincident of PWD == BREKWIT_DIR
103+
path: co # test that things working isn’t just a coincident of PWD == BREKWIT_DIR
104104

105-
- uses: pkgxdev/setup@v2
105+
- uses: pkgxdev/setup@v4
106106

107107
- uses: ./co/download-build-artifact
108108
id: dl
@@ -119,14 +119,14 @@ jobs:
119119

120120
- uses: actions/upload-artifact@v4
121121
with:
122-
path: ${{ steps.bottle.outputs.filename }}
123-
name: ${{ steps.bottle.outputs.name }}
122+
path: ${{ steps.bottle.outputs.filename }}
123+
name: ${{ steps.bottle.outputs.name }}
124124

125125
unavailable:
126126
runs-on: ubuntu-latest
127127
steps:
128128
- uses: actions/checkout@v4
129-
- uses: pkgxdev/setup@v2
129+
- uses: pkgxdev/setup@v4
130130

131131
- uses: ./build
132132
id: build
@@ -148,7 +148,7 @@ jobs:
148148
pkgs: ${{ steps.id.outputs.pkgs }}
149149
steps:
150150
- uses: actions/checkout@v4
151-
- uses: pkgxdev/setup@v2
151+
- uses: pkgxdev/setup@v4
152152
- uses: ./id
153153
id: id
154154
with:

.github/workflows/ci.cli.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
container: ${{ matrix.platform.img }}
3535
steps:
3636
- uses: actions/checkout@v4
37-
- uses: pkgxdev/setup@v2
37+
- uses: pkgxdev/setup@v4
3838

3939
# otherwise, we're getting some weird race conditions on CI
4040
- run: pkgx --sync
@@ -47,7 +47,7 @@ jobs:
4747
runs-on: ubuntu-latest
4848
steps:
4949
- uses: actions/checkout@v4
50-
- uses: pkgxdev/setup@v2
50+
- uses: pkgxdev/setup@v4
5151
- uses: ./.github/modify-pantry
5252
- run: test $(bin/bk status) = stark.com/foo
5353
- run: bin/bk build
@@ -71,7 +71,7 @@ jobs:
7171
runs-on: ubuntu-latest
7272
steps:
7373
- uses: actions/checkout@v4
74-
- uses: pkgxdev/setup@v2
74+
- uses: pkgxdev/setup@v4
7575
- run: pkgx --sync # FIXME PKGX_PANTRY_PATH causes auto sync to fail
7676
- name: build
7777
run: |

build/build.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,23 @@ function make_toolchain() {
189189
const d = config.path.home.join('toolchain').rm({ recursive: true }).mkdir('p')
190190
const prefix = useConfig().prefix
191191

192-
const llvm = (bin: string) => prefix.join('llvm.org/v*/bin', bin)
193-
const gcc = (bin: string) => prefix.join('gnu.org/gcc/v*/bin', bin)
194-
const binutils = (bin: string) => prefix.join('gnu.org/binutils/v*/bin', bin)
192+
const dep_bin = (project: string, bin: string): Path => {
193+
const dep = config.deps.gas.find(x => x.pkg.project === project)
194+
if (dep) return dep.path.join('bin', bin)
195+
// fallback: resolve from installed versions
196+
const dir = prefix.join(project)
197+
if (dir.isDirectory()) {
198+
const versions = [...Deno.readDirSync(dir.string)]
199+
.filter(e => e.isDirectory && e.name.startsWith('v'))
200+
.sort((a, b) => a.name.localeCompare(b.name, undefined, { numeric: true }))
201+
if (versions.length) return dir.join(versions.at(-1)!.name, 'bin', bin)
202+
}
203+
throw new Error(`cannot find ${project} installation`)
204+
}
205+
206+
const llvm = (bin: string) => dep_bin('llvm.org', bin)
207+
const gcc = (bin: string) => dep_bin('gnu.org/gcc', bin)
208+
const binutils = (bin: string) => dep_bin('gnu.org/binutils', bin)
195209

196210
const symlink = (names: string[], target: Path) => {
197211
for (const name of names) {

libexec/autoconf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if [ -x /usr/local/bin/pkgx ]; then
55
pkgx=/usr/local/bin/pkgx
66
else
77
# probs this is running in pkgx CI/CD
8-
pkgx="${PKGX_DIR:-$HOME/.pkgx}/pkgx.sh/v*/bin/pkgx"
8+
pkgx="$(ls -d ${PKGX_DIR:-$HOME/.pkgx}/pkgx.sh/v* | tail -1)/bin/pkgx"
99
fi
1010

1111
exec "$pkgx" +gnu.org/autoconf -- autoconf "$@"

libexec/automake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if [ -x /usr/local/bin/pkgx ]; then
55
pkgx=/usr/local/bin/pkgx
66
else
77
# probs this is running in pkgx CI/CD
8-
pkgx="${PKGX_DIR:-$HOME/.pkgx}/pkgx.sh/v*/bin/pkgx"
8+
pkgx="$(ls -d ${PKGX_DIR:-$HOME/.pkgx}/pkgx.sh/v* | tail -1)/bin/pkgx"
99
fi
1010

1111
exec "$pkgx" +gnu.org/automake -- automake "$@"

libexec/curl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if [ -x /usr/local/bin/pkgx ]; then
55
pkgx=/usr/local/bin/pkgx
66
else
77
# probs this is running in pkgx CI/CD
8-
pkgx="${PKGX_DIR:-$HOME/.pkgx}/pkgx.sh/v*/bin/pkgx"
8+
pkgx="$(ls -d ${PKGX_DIR:-$HOME/.pkgx}/pkgx.sh/v* | tail -1)/bin/pkgx"
99
fi
1010

1111
exec "$pkgx" +curl.se -- curl "$@"

libexec/git

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if [ -x /usr/local/bin/pkgx ]; then
55
pkgx=/usr/local/bin/pkgx
66
else
77
# probs this is running in pkgx CI/CD
8-
pkgx="${PKGX_DIR:-$HOME/.pkgx}/pkgx.sh/v*/bin/pkgx"
8+
pkgx="$(ls -d ${PKGX_DIR:-$HOME/.pkgx}/pkgx.sh/v* | tail -1)/bin/pkgx"
99
fi
1010

1111
exec "$pkgx" +git-scm.org -- git "$@"

libexec/install

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if [ -x /usr/local/bin/pkgx ]; then
55
pkgx=/usr/local/bin/pkgx
66
else
77
# probs this is running in pkgx CI/CD
8-
pkgx="${PKGX_DIR:-$HOME/.pkgx}/pkgx.sh/v*/bin/pkgx"
8+
pkgx="$(ls -d ${PKGX_DIR:-$HOME/.pkgx}/pkgx.sh/v* | tail -1)/bin/pkgx"
99
fi
1010

1111
exec "$pkgx" +gnu.org/coreutils -- install "$@"

libexec/libtool

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if [ -x /usr/local/bin/pkgx ]; then
1010
pkgx=/usr/local/bin/pkgx
1111
else
1212
# probs this is running in pkgx CI/CD
13-
pkgx="${PKGX_DIR:-$HOME/.pkgx}/pkgx.sh/v*/bin/pkgx"
13+
pkgx="$(ls -d ${PKGX_DIR:-$HOME/.pkgx}/pkgx.sh/v* | tail -1)/bin/pkgx"
1414
fi
1515

1616
exec "$pkgx" +gnu.org/libtool -- libtool "$@"

libexec/make

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ elif [ -x /usr/local/bin/pkgx ]; then
77
pkgx=/usr/local/bin/pkgx
88
else
99
# probs this is running in pkgx CI/CD
10-
pkgx="${PKGX_DIR:-$HOME/.pkgx}/pkgx.sh/v*/bin/pkgx"
10+
pkgx="$(ls -d ${PKGX_DIR:-$HOME/.pkgx}/pkgx.sh/v* | tail -1)/bin/pkgx"
1111
fi
1212

1313
exec "$pkgx" +gnu.org/make -- make "$@"

0 commit comments

Comments
 (0)