fixes deno 1.25.0 (#99)

This commit is contained in:
Max Howell 2022-08-27 14:11:25 -04:00 committed by GitHub
parent 4fdd4dfed2
commit 4f7bce0f85
3 changed files with 35 additions and 10 deletions

View file

@ -42,7 +42,7 @@ jobs:
mkdir .git # no git in our image mkdir .git # no git in our image
#FIXME needed for gdk-pixbuf #FIXME needed for gdk-pixbuf
apt --yes install shared-mime-info apt --yes install shared-mime-info file
;; ;;
macos-11) macos-11)
# screws up a lot of build scripts # screws up a lot of build scripts

View file

@ -6,9 +6,6 @@ relocatable: true
versions: versions:
github: denoland/deno github: denoland/deno
ignore:
- v1.24.z #FIXME compile issues
- v1.23.4 #FIXME ^^
provides: provides:
- bin/deno - bin/deno
@ -19,10 +16,20 @@ interprets:
build: build:
script: | script: |
# https://github.com/denoland/deno/issues/15596
find ext/ffi/tinycc -maxdepth 0 -empty -exec \
git clone https://github.com/TinyCC/tinycc.git {} \;
if test {{ hw.target }} = x86_64-apple-darwin; then
# our LLVM cannot build with deployment target set to 10.6
sed -i.bak s/MACOSX_DEPLOYMENT_TARGET/\#/ ext/ffi/tinycc/Makefile
fi
cargo build --release cargo build --release
mkdir -p "{{ prefix }}"/bin mkdir -p "{{ prefix }}"/bin
mv target/release/deno "{{ prefix }}"/bin mv target/release/deno "{{ prefix }}"/bin
dependencies: dependencies:
git-scm.org: 2 # to build tinycc
rust-lang.org: 1 rust-lang.org: 1
llvm.org: '>=13' # macOS/aarch64 requires this (FIXME only dep where needed) llvm.org: '>=13' # macOS/aarch64 requires this (FIXME only dep where needed)
curl.se: '*' # required to download v8 (python is another option) curl.se: '*' # required to download v8 (python is another option)

View file

@ -12,19 +12,28 @@ args:
- --import-map={{ srcroot }}/import-map.json - --import-map={{ srcroot }}/import-map.json
---*/ ---*/
import { parsePackage, semver, Path, PackageRequirement, PlainObject } from "types" import { parsePackage, semver, Path, PackageRequirement, PlainObject, parsePackageRequirement } from "types"
import usePantry from "hooks/usePantry.ts" import usePantry from "hooks/usePantry.ts"
import useShellEnv, { expand } from "hooks/useShellEnv.ts" import useShellEnv, { expand } from "hooks/useShellEnv.ts"
import { run, undent, isPlainObject } from "utils" import { run, undent, isPlainObject } from "utils"
import { validatePackageRequirement } from "utils/lvl2.ts" import { validatePackageRequirement } from "utils/lvl2.ts"
import useFlags from "hooks/useFlags.ts" import useFlags from "hooks/useFlags.ts"
import useCellar from "hooks/useCellar.ts"
useFlags() const { debug } = useFlags()
//TODO install any other deps //TODO install any other deps
const pantry = usePantry() const pantry = usePantry()
const pkg = parsePackage(Deno.args[0]) const pkg = await (async () => {
if (Deno.args[1] == "--magic") {
const i = await useCellar().resolve(parsePackageRequirement(Deno.args[0]))
return i.pkg
} else {
return parsePackage(Deno.args[0])
}
})()
const self = { const self = {
project: pkg.project, project: pkg.project,
constraint: new semver.Range(pkg.version.toString()) constraint: new semver.Range(pkg.version.toString())
@ -45,7 +54,7 @@ let text = undent`
` `
const tmp = Path.mktemp() const tmp = Path.mktmp({ prefix: `${pkg.project}-${pkg.version}+` })
try { try {
if (yml.test.fixture) { if (yml.test.fixture) {
@ -53,16 +62,25 @@ try {
text += `export FIXTURE="${fixture}"\n\n` text += `export FIXTURE="${fixture}"\n\n`
} }
const cwd = tmp.join("wd").mkdir()
text += `cd "${cwd}"\n\n`
text += await pantry.getScript(pkg, 'test') text += await pantry.getScript(pkg, 'test')
text += "\n" text += "\n"
for await (const [path, {name, isFile}] of pantry.prefix(pkg).ls()) {
if (isFile && name != 'package.yml') path.cp({ into: cwd })
}
const cmd = tmp const cmd = tmp
.join("test.sh") .join("test.sh")
.write({ text, force: true }) .write({ text, force: true })
.chmod(0o500) .chmod(0o500)
await run({ cmd }) await run({ cmd, cwd })
} finally { } finally {
tmp.rm({ recursive: true }) if (!debug) tmp.rm({ recursive: true })
} }
function get_deps() { function get_deps() {