Switch tart.run to vendored binary with non-OSS license so that we can get --net-bridged (#3952)

* Switch tart.run to vendored binary with non-OSS license so that we can get ----net-bridged

* simpler distribution

---------

Co-authored-by: James Reynolds <magnsuviri@me.com>
Co-authored-by: Jacob Heider <jacob@pkgx.dev>
This commit is contained in:
James Reynolds 2023-11-04 14:25:41 -06:00 committed by GitHub
parent 6bcc093fc1
commit 30b1086413
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 26 deletions

View file

@ -1,34 +1,31 @@
distributable:
url: https://github.com/cirruslabs/tart/archive/refs/tags/{{version}}.tar.gz
strip-components: 1
# vendoring for newer versions
# url: https://github.com/cirruslabs/tart/archive/refs/tags/{{version}}.tar.gz
url: https://github.com/cirruslabs/tart/releases/download/{{version}}/tart.tar.gz
warnings:
- vendored
versions:
github: cirruslabs/tart
# NOTE: 1.x uses non-open source license
# https://tart.run/blog/2023/02/11/changing-tart-license/
ignore: /^[1-9]/
github: cirruslabs/tart/releases
platforms:
- darwin/aarch64
build:
dependencies:
rust-lang.org: ^1.54
rust-lang.org/cargo: ^0
# apple.com/xcode: >=14.1
# swift.org: 5
script:
- run: |
curl -L $SOFTNET | tar -zxf - --strip-components=1
cargo install --locked --path . --root {{prefix}}
working-directory: softnet
- swift build --disable-sandbox -c release
- codesign -f -s - --entitlement Resources/tart.entitlements .build/release/tart
- run: cp "$SRCROOT"/.build/release/tart .
working-directory: ${{prefix}}/bin
env:
SOFTNET: https://github.com/cirruslabs/softnet/archive/refs/tags/0.6.2.tar.gz
#FIXME proper system for re-using pre-built binaries
# we must require the vendor to provide signatures against a published public
# key. If they dont then really we should build ourselves or warn the user
# about the fact.
# The thing is, we trust the sources implicitly currently because signing is
# so rare. The only way wide spread signing will occur is via our protocol.
# This only works on macOS, arm64, monterey and above. It requires xcode 14.1 to build
build:
script:
- mkdir -p "{{prefix}}/bin"
- cp -a tart.app "{{prefix}}"
- cp props/tart-shim "{{prefix}}"/bin/tart
provides:
- bin/tart
@ -37,8 +34,8 @@ test:
script:
- ': >empty.ispw'
- OUT=$(tart create
--from-ipsw empty.ipsw
test 2>&1 || true)
--from-ipsw empty.ipsw
test 2>&1 || true)
- 'test "$OUT" = "Error: The restore image failed to load. Unable to create sandbox extensions."'
env:
TART_HOME: $PWD
TART_HOME: $PWD

5
projects/tart.run/tart-shim Executable file
View file

@ -0,0 +1,5 @@
#!/bin/sh
tart="$(cd "$(dirname "$0")/.." && pwd)"/tart.app/Contents/MacOS/tart
exec "$tart" "$@"