Just use the full build.ts

Fixes issue where we don't install zlib to build zlib even though llvm needs it.

Doing these in steps was a cool demo of our primitives but led to issues due to install all deps up front rather than just before each build so fuck it.
This commit is contained in:
Max Howell 2022-12-21 08:10:10 -05:00
parent cf8e6aef05
commit f4f1413665
3 changed files with 16 additions and 15 deletions

View file

@ -73,13 +73,8 @@ jobs:
- run: /opt/tea.xyz/var/pantry/scripts/sort.ts ${{ inputs.projects }}
id: sorted
- run: /opt/tea.xyz/var/pantry/scripts/build-deps.ts ${{ steps.sorted.outputs.pkgs }}
id: deps
- run: cli/scripts/install.ts ${{ steps.deps.outputs.pkgs }}
# running out of /opt because only pantry.core has these scripts
- run: /opt/tea.xyz/var/pantry/scripts/build.plumbing.ts ${{ steps.sorted.outputs.pkgs }}
- run: /opt/tea.xyz/var/pantry/scripts/build.ts ${{ steps.sorted.outputs.pkgs }}
id: build
env:
GITHUB_TOKEN: ${{ github.token }}

View file

@ -14,13 +14,11 @@ args:
---*/
import { usePantry } from "hooks"
import { Installation } from "types"
import { pkg as pkgutils } from "utils"
import { useFlags, usePrefix } from "hooks"
import { set_output } from "./utils/gha.ts"
import build, { BuildResult } from "./build/build.ts"
import * as ARGV from "./utils/args.ts"
import Path from "path"
useFlags()
@ -52,7 +50,3 @@ await set_output("paths", rv.map(x => x.installation.path), '%0A')
await set_output("relative-paths", rv.map(x => x.installation.path.relative({ to })))
await set_output("srcs", rv.map(x => x.src?.relative({ to }) ?? "~"))
await set_output("srcs-relative-paths", rv.compact(x => x.src?.relative({ to })))
interface InstallationPlus extends Installation {
src: Path
}

View file

@ -13,12 +13,14 @@ args:
- --import-map={{ srcroot }}/import-map.json
---*/
import { usePantry, useFlags, useCellar, useInventory } from "hooks"
import { usePantry, useFlags, useCellar, useInventory, usePrefix } from "hooks"
import { hydrate, install, link } from "prefab"
import { str as pkgstr } from "utils/pkg.ts"
import * as ARGV from "./utils/args.ts"
import { panic } from "utils/error.ts"
import build from "./build/build.ts"
import build, { BuildResult } from "./build/build.ts"
import { set_output } from "./utils/gha.ts"
import { pkg as pkgutils } from "utils"
useFlags()
@ -26,6 +28,7 @@ const pantry = usePantry()
const cellar = useCellar()
const inventory = useInventory()
const raw = await ARGV.toArray(ARGV.pkgs())
const rv: BuildResult[] = []
for (const rq of raw) {
const dry = await pantry.getDeps(rq)
@ -40,6 +43,15 @@ for (const rq of raw) {
}
const pkg = await pantry.resolve(rq)
await build(pkg)
rv.push(await build(pkg))
await link(pkg)
}
if (Deno.env.get("GITHUB_ACTIONS")) {
const to = usePrefix()
await set_output("pkgs", rv.map(x => pkgutils.str(x.installation.pkg)))
await set_output("paths", rv.map(x => x.installation.path), '%0A')
await set_output("relative-paths", rv.map(x => x.installation.path.relative({ to })))
await set_output("srcs", rv.map(x => x.src?.relative({ to }) ?? "~"))
await set_output("srcs-relative-paths", rv.compact(x => x.src?.relative({ to })))
}