diff --git a/.github/workflows/stdout_renderer.yml b/.github/workflows/stdout_renderer.yml index 61f2a7d42..26eba903f 100644 --- a/.github/workflows/stdout_renderer.yml +++ b/.github/workflows/stdout_renderer.yml @@ -23,20 +23,30 @@ jobs: # run: Renderer/Stdout/run-example.sh stdout_renderer_macos: - name: Run stdout renderer on macOS + name: Run stdout renderer on macOS (${{ matrix.backend }}) strategy: fail-fast: false matrix: os: [macos-15] xcode-version: ["26.3"] release: [2024] + backend: [AttributeGraph, Compute] + include: + - backend: AttributeGraph + attributegraph: "1" + compute: "0" + - backend: Compute + attributegraph: "0" + compute: "1" runs-on: - self-hosted - ${{ matrix.os }} env: OPENSWIFTUI_WERROR: 0 OPENSWIFTUI_TARGET_RELEASE: ${{ matrix.release }} - OPENSWIFTUI_USE_LOCAL_DEPS: 1 + OPENSWIFTUI_OPENATTRIBUTESHIMS_ATTRIBUTEGRAPH: ${{ matrix.attributegraph }} + OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE: ${{ matrix.compute }} + OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE_BINARY: 0 GH_TOKEN: ${{ github.token }} steps: - uses: actions/checkout@v4 diff --git a/Example/README.md b/Example/README.md index dcc27d4f6..eb13ac9ed 100644 --- a/Example/README.md +++ b/Example/README.md @@ -17,13 +17,14 @@ Since OpenAttributeGraph is not yet completed, you need to configure an AG backe This example defaults to Apple's private AttributeGraph framework through `mise.toml`. -Or use the Compute module: +To use Compute instead, run setup with the Compute mise environment: ```shell -export OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE=1 -export OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE_USE_BINARY=1 +./setup.sh --compute ``` +The Compute environment is defined in `mise.compute.toml`. It disables the private AttributeGraph framework and uses `OpenSwiftUIProject/Compute` from source on the `main` branch. + ## Generate Project The recommended setup path is the local setup script: @@ -34,6 +35,14 @@ The recommended setup path is the local setup script: The script trusts and installs the tools declared by `Example/mise.toml`, then runs Tuist through `mise exec` so the pinned Tuist version is used. +To generate the project with Compute: + +```shell +./setup.sh --compute +``` + +This uses `mise --env compute`, which loads `Example/mise.compute.toml` for `mise install`, `tuist install`, and `tuist generate`. + To run the steps manually: ```shell @@ -43,6 +52,15 @@ mise exec -- tuist install mise exec -- tuist generate --no-open ``` +Or with Compute: + +```shell +mise trust mise.compute.toml +mise --env compute install +mise --env compute exec -- tuist install +mise --env compute exec -- tuist generate --no-open +``` + By default, the generated Debug Example targets include LookInsideServer. You can switch the debug inspector server before running `tuist install` and `tuist generate`: ```shell diff --git a/Example/mise.compute.toml b/Example/mise.compute.toml new file mode 100644 index 000000000..52994336e --- /dev/null +++ b/Example/mise.compute.toml @@ -0,0 +1,6 @@ +[tools] +tuist = "4.193.0" + +[env] +OPENSWIFTUI_OPENATTRIBUTESHIMS_ATTRIBUTEGRAPH = "0" +OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE = "1" \ No newline at end of file diff --git a/Example/setup.sh b/Example/setup.sh index 56e8dd6e3..0fc2923d4 100755 --- a/Example/setup.sh +++ b/Example/setup.sh @@ -3,9 +3,38 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)" +MISE_ARGS=() + +usage() { + printf '%s\n' \ + "Usage: $(basename "$0") [--compute]" \ + "" \ + "Options:" \ + " --compute Use mise.compute.toml while installing tools and generating the project." +} + +while [[ $# -gt 0 ]]; do + case "$1" in + --compute) + MISE_ARGS=(--env compute) + ;; + -h|--help) + usage + exit 0 + ;; + *) + usage >&2 + exit 2 + ;; + esac + shift +done cd "$SCRIPT_DIR" mise trust "$SCRIPT_DIR/mise.toml" -mise install -mise exec -- tuist install -mise exec -- tuist generate --no-open +if [[ ${#MISE_ARGS[@]} -gt 0 ]]; then + mise trust "$SCRIPT_DIR/mise.compute.toml" +fi +mise "${MISE_ARGS[@]}" install +mise "${MISE_ARGS[@]}" exec -- tuist install +mise "${MISE_ARGS[@]}" exec -- tuist generate --no-open diff --git a/Package.resolved b/Package.resolved index 8393ba764..1d1c1b5cb 100644 --- a/Package.resolved +++ b/Package.resolved @@ -16,7 +16,7 @@ "location" : "https://github.com/OpenSwiftUIProject/OpenAttributeGraph", "state" : { "branch" : "main", - "revision" : "2f3beaf322a340e4600478409f75efef52418ffa" + "revision" : "f20328ed3fb97159624c171e204dba29f942a1eb" } }, { diff --git a/Renderer/Stdout/run-example.sh b/Renderer/Stdout/run-example.sh index e39099abc..181fc85bc 100755 --- a/Renderer/Stdout/run-example.sh +++ b/Renderer/Stdout/run-example.sh @@ -6,12 +6,12 @@ cd "$(dirname "${BASH_SOURCE[0]}")" case "$(uname -s)" in Darwin) - export OPENSWIFTUI_OPENATTRIBUTESHIMS_ATTRIBUTEGRAPH=1 - export OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE=0 + export OPENSWIFTUI_OPENATTRIBUTESHIMS_ATTRIBUTEGRAPH="${OPENSWIFTUI_OPENATTRIBUTESHIMS_ATTRIBUTEGRAPH:-1}" + export OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE="${OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE:-0}" ;; *) - export OPENSWIFTUI_OPENATTRIBUTESHIMS_ATTRIBUTEGRAPH=0 - export OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE=1 + export OPENSWIFTUI_OPENATTRIBUTESHIMS_ATTRIBUTEGRAPH="${OPENSWIFTUI_OPENATTRIBUTESHIMS_ATTRIBUTEGRAPH:-0}" + export OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE="${OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE:-1}" export OPENSWIFTUI_LIB_SWIFT_PATH="$(swiftly use --print-location)/usr/lib/swift" ;; esac