fixes because pantries changed (#2)

This commit is contained in:
Max Howell 2022-10-25 21:55:49 -04:00 committed by GitHub
parent cd86c99e3d
commit 89bb6bf292
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 63 deletions

View file

@ -6,9 +6,6 @@ on:
required: true
type: string
env:
TEA_SECRET: ${{ secrets.TEA_SECRET }}
jobs:
build:
runs-on: ${{ matrix.os }}
@ -42,21 +39,6 @@ jobs:
repository: teaxyz/cli
token: ${{ secrets.TEMP_JACOBS_GITHUB_PAT }}
- run: |
if test -d $TEA_PREFIX/tea.xyz; then
find $TEA_PREFIX/tea.xyz -mindepth 1 -maxdepth 1 -not \( -path $TEA_PREFIX/tea.xyz/var \) -print0 | \
xargs -0 rm -rf
fi
if: ${{ matrix.tag }}
env:
TEA_PREFIX: /opt
- uses: teaxyz/setup@v0
id: tea
with:
srcroot: pantry
prefix: /opt
- name: HACKS
run: |
case ${{ matrix.os }} in
@ -70,23 +52,26 @@ jobs:
#TODO stop using GHA images or chroot or something
for x in /usr/local/*; do sudo mv $x /tmp; done
;;
*)
# self-hosted runner. noop
echo
;;
esac
rm -rf /opt/tea.xyz/var
ln -s $GITHUB_WORKSPACE /opt/tea.xyz/var
- uses: teaxyz/setup@v0
id: tea
with:
srcroot: pantry
prefix: /opt
- name: prepare pantries
run: |
tea --sync
cp -Rv $GITHUB_WORKSPACE/pantry/ /opt/tea.xyz/var/pantry || true
# ^^ || true because I cant figure out how to stop `cp` erroring
# because it doesnt want to copy symlinks that already exist, eg. `src`
- run: pantry/scripts/sort.ts ${{ inputs.projects }}
id: sorted
- run: cli/scripts/install.ts ${{ steps.sorted.outputs.pre-install }}
#FIXME remove later
- run: find /opt -name bin -type d -exec find {} -type f -print0 \; | xargs -0 chmod 777
- run: pantry/scripts/build.ts ${{ steps.sorted.outputs.pkgs }}
id: build
env:
@ -113,9 +98,6 @@ jobs:
test:
needs: [build]
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: tea.xyz/var/pantry/scripts
strategy:
matrix:
include:
@ -133,11 +115,11 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
path: tea.xyz/var/pantry
path: pantry
- uses: actions/checkout@v3
with:
path: tea.xyz/var/cli
path: cli
repository: teaxyz/cli
token: ${{ secrets.TEMP_JACOBS_GITHUB_PAT }}
@ -146,20 +128,16 @@ jobs:
apt-get --yes install libc-dev libstdc++-8-dev libgcc-8-dev
if: ${{ matrix.container != '' }}
- run: |
if test -d $TEA_PREFIX/tea.xyz; then
find $TEA_PREFIX/tea.xyz -mindepth 1 -maxdepth 1 -not \( -path $TEA_PREFIX/tea.xyz/var \) -print0 | \
xargs -0 rm -rf
fi
if: ${{ matrix.tag }}
env:
TEA_PREFIX: ${{ github.workspace }}
- uses: teaxyz/setup@v0
id: tea
with:
srcroot: pantry
prefix: ${{ github.workspace }}
srcroot: tea.xyz/var/pantry
- name: overlay this pantry
run: cp -Rv $GITHUB_WORKSPACE/pantry/ /opt/tea.xyz/var/pantry || true
# ^^ || true because I cant figure out how to stop `cp` erroring
# because it doesnt want to copy symlinks that already exist, eg. `src`
- uses: actions/download-artifact@v3
with:
@ -168,12 +146,9 @@ jobs:
- run: tar xzf artifacts.tgz
working-directory: ${{ steps.tea.outputs.prefix }}
- run: ./test.ts ${{ inputs.projects }}
- run: pantry/scripts/test.ts ${{ inputs.projects }}
bottle:
defaults:
run:
working-directory: tea.xyz/var/pantry/scripts
needs: [test, build]
runs-on: ${{ matrix.platform.os }}
strategy:
@ -188,28 +163,19 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
path: tea.xyz/var/pantry
path: pantry
- uses: actions/checkout@v3
with:
path: tea.xyz/var/cli
path: cli
repository: teaxyz/cli
token: ${{ secrets.TEMP_JACOBS_GITHUB_PAT }}
- run: |
if test -d $TEA_PREFIX/tea.xyz; then
find $TEA_PREFIX/tea.xyz -mindepth 1 -maxdepth 1 -not \( -path $TEA_PREFIX/tea.xyz/var \) -print0 | \
xargs -0 rm -rf
fi
if: ${{ matrix.platform.tag }}
env:
TEA_PREFIX: ${{ github.workspace }}
- uses: teaxyz/setup@v0
id: tea
with:
srcroot: pantry
prefix: ${{ github.workspace }}
srcroot: tea.xyz/var/pantry
- uses: actions/download-artifact@v3
with:
@ -219,19 +185,19 @@ jobs:
- run: tar xzf artifacts.tgz
working-directory: ${{ steps.tea.outputs.prefix }}
- run: ./bottle.ts ${{ needs.build.outputs.built }}
- run: pantry/scripts/bottle.ts ${{ needs.build.outputs.built }}
id: bottle-xz
env:
COMPRESSION: xz
- run: ./bottle.ts ${{ needs.build.outputs.built }}
- run: pantry/scripts/bottle.ts ${{ needs.build.outputs.built }}
id: bottle-gz
env:
COMPRESSION: gz
- name: upload bottles
id: upload
run: ./upload.ts
run: pantry/scripts/upload.ts
--pkgs ${{ needs.build.outputs.built }} ${{ needs.build.outputs.built }}
--srcs ${{ needs.build.outputs.srcs }} ${{ needs.build.outputs.srcs }}
--bottles ${{ steps.bottle-gz.outputs.bottles }} ${{ steps.bottle-xz.outputs.bottles }}

View file

@ -11,7 +11,7 @@ build:
tea.xyz/gx/make: '*'
script: |
./configure --prefix={{ prefix }}
make --jobs {{ hw.concurrency }} install
make --jobs {{hw.concurrency}} install
rm -rf {{prefix}}/share # docs are online
if test {{hw.platform}} = darwin; then

View file

@ -41,7 +41,7 @@ async function __build(pkg: Package): Promise<BuildResult> {
//////// utils
async function calc_deps() {
const deps = await pantry.getDeps(pkg)
const wet = await hydrate([...deps.runtime, ...deps.build], pkg => pantry.getDeps(pkg).then(x => x.runtime))
const wet = await hydrate([...deps.runtime, ...deps.build])
deps.runtime.push(...wet.pkgs)
const resolved = await Promise.all(wet.pkgs.map(pkg => cellar.resolve(pkg)))
return tuplize(deps, wet, resolved)