Skip to content

Commit 3697fd1

Browse files
committed
Publish dev versions of the ESP-IDF component from the nightly branch
Projects that need the component before the next release can now pin a dev version from the registry instead of generating the component from an ExecuTorch checkout. A manual run of publish-esp-idf.yml on the nightly branch with version_suffix -dev publishes X.Y.Z-dev.YYYYMMDD of that branch's commit, through the same packing, testing, review and registry checks as a release. The generator's new --version-suffix -dev stamps HEAD's commit date and checks the checkout as it does for a release; --allow-dev-stamp stays the unchecked stamp for local builds. A dev version's kernel bundles need executorch from the component's exact commit. ExecuTorch's nightly wheels are built from the nightly branch's commits, so the plan refuses -dev on any other ref, and -dev is the only suffix it accepts on the nightly branch, which the environment trusts for dev versions alone. Before the build, the new wheel mode of test_espressif_idf_nightly.sh checks that the nightly index has the version's wheels for every platform and Python they are built for, and that each platform's Python 3.11 wheel records that commit. It also refuses a version dated today, since a second nightly the same day, which has happened, replaces that day's wheels; the runbook has the workflow run between 00:00 UTC and the next nightly. Pull requests that touch the workflow or that script rehearse the check, in a job nothing waits on, on the latest finished nightly of the last 60 days that has wheels; since nightly wheels can fail to build for days, finding none only warns. ExecuTorch's wheels declare no torch, so the component's VERSION now records the torch requirement install_requirements.py builds the wheels against, and the index that keeps it, and the new torch mode checks before upload that it resolves there on each platform. The component's README gives the pip commands for releases and dev versions. The nightly index keeps about two months of wheels, so a project moves to a newer dev version, or to the release, before its pin ages out; firmware builds from a committed kernel bundle are unaffected. Dev versions are semver pre-releases, which a version range picks up only if it opts in, so they go to production without reaching projects on releases. They read 1.6.0-dev.YYYYMMDD, as the nightly wheels do, until main's version.txt moves past 1.6.0, and sort below 1.6.0 meanwhile; exact pins are unaffected. Dev runs queue in the nightly branch's concurrency group, so one cannot replace a pending release run. Before the first dev upload, a repo admin adds nightly to the deployment branches of the esp-component-registry environment. The workflow accepts -dev once this change reaches the nightly branch. Authored with Claude Code.
1 parent 840dcb6 commit 3697fd1

7 files changed

Lines changed: 236 additions & 34 deletions

File tree

‎.ci/scripts/test_espressif_idf_nightly.sh‎

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,29 @@
3030
# pytorch/executorch, builds the smoke consumer for ESP32-S3 with it, fails
3131
# if the registry serves files other than <dir>'s archive, and runs the
3232
# build on the emulator.
33+
# test_espressif_idf_nightly.sh wheel <dir> <dev version> <commit>
34+
# Checks that the ExecuTorch nightly wheels of the version's date exist for
35+
# every platform and Python, and that each platform's Python 3.11 wheel was
36+
# built from <commit>, so a project can install the executorch its kernel
37+
# bundles need. Refuses today's nightly, which a later one could replace.
38+
# Logs go under <dir>.
39+
# test_espressif_idf_nightly.sh torch <dir>
40+
# Needs only <dir> from prepare: checks that the torch the component's
41+
# VERSION names resolves from its index on every platform.
3342

3443
set -euo pipefail
3544

3645
et_root=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)
37-
usage="usage: $0 prepare <dir> [stamp options] | build <dir> <shard> <shards> | registry <dir> <URL>"
46+
usage="usage: $0 prepare <dir> [stamp options] | build <dir> <shard> <shards> | registry <dir> <URL> | wheel <dir> <version> <commit> | torch <dir>"
3847
mode=${1:?${usage}}
3948
dir=${2:?${usage}}
4049
mkdir -p "${dir}"
4150
dir=$(cd "${dir}" && pwd)
4251
cd "${et_root}"
4352
targets=(esp32 esp32s3 esp32c3 esp32c5 esp32c6 esp32p4)
53+
# The platforms and Pythons ExecuTorch's wheels are built for.
54+
wheel_platforms=(manylinux_2_28_x86_64 manylinux_2_28_aarch64 macosx_14_0_arm64 win_amd64)
55+
wheel_pythons=(311 312 313 314 315)
4456

4557
# Runs a command with its output in a log, and shows the log's tail if it fails.
4658
logged() {
@@ -357,6 +369,70 @@ settings_applied() {
357369
[[ "${applied}" == true ]]
358370
}
359371

372+
wheel() {
373+
local version=${3:?${usage}} commit=${4:?${usage}} wheels platform python listing
374+
local missing=()
375+
if [[ "${version}" != *-dev.* ]]; then
376+
echo "FAIL: ${version} is not a dev version" >&2
377+
exit 1
378+
fi
379+
# A second nightly the same day would replace the wheels of this one.
380+
if [[ "${version##*-dev.}" == "$(date -u +%Y%m%d)" ]]; then
381+
echo "FAIL: ${version} is today's nightly, which a later nightly today could replace;" \
382+
"publish it after 00:00 UTC, before the next nightly." >&2
383+
exit 1
384+
fi
385+
listing=$(curl -sSf https://download.pytorch.org/whl/nightly/cpu/executorch/)
386+
listing=$(grep -F "executorch-${version/-dev./.dev}" <<< "${listing}" || true)
387+
for platform in "${wheel_platforms[@]}"; do
388+
for python in "${wheel_pythons[@]}"; do
389+
if ! grep -qF -- "-cp${python}-cp${python}-${platform}.whl" <<< "${listing}"; then
390+
missing+=("cp${python}-${platform}")
391+
fi
392+
done
393+
done
394+
if (( ${#missing[@]} > 0 )); then
395+
echo "FAIL: the nightly index has no ${version} wheel for ${missing[*]}" >&2
396+
exit 1
397+
fi
398+
wheels=$(mktemp -d)
399+
# shellcheck disable=SC2064 # wheels is local, so expand it now.
400+
trap "rm -rf '${wheels}'" EXIT
401+
mkdir -p "${dir}/logs"
402+
for platform in "${wheel_platforms[@]}"; do
403+
logged "${dir}/logs/nightly-wheel-${platform}.log" python -m pip download --no-deps \
404+
--only-binary=:all: --platform "${platform}" --python-version 3.11 \
405+
--implementation cp --index-url https://download.pytorch.org/whl/nightly/cpu \
406+
--dest "${wheels}/${platform}" "executorch==${version/-dev./.dev}"
407+
python - "${wheels}/${platform}"/executorch-*.whl "${commit}" <<'PY'
408+
import re
409+
import sys
410+
import zipfile
411+
412+
wheel, commit = sys.argv[1:]
413+
version_py = zipfile.ZipFile(wheel).read("executorch/version.py").decode()
414+
built = re.search(r"^git_version: .* = '(\w+)'", version_py, re.MULTILINE)
415+
built = built.group(1) if built else None
416+
if built != commit:
417+
sys.exit(f"FAIL: {wheel} was built from {built}, not the component's {commit}")
418+
print(f"OK: {wheel} was built from {commit}")
419+
PY
420+
done
421+
}
422+
423+
torch() {
424+
local version_file="${dir}/component/executorch/VERSION" requirement index platform
425+
requirement=$(sed -n 's/^torch_requirement: *//p' "${version_file}")
426+
index=$(sed -n 's/^torch_index: *//p' "${version_file}")
427+
mkdir -p "${dir}/logs"
428+
for platform in "${wheel_platforms[@]}"; do
429+
logged "${dir}/logs/torch-${platform}.log" python -m pip install --dry-run --no-deps \
430+
--only-binary=:all: --platform "${platform}" --python-version 3.11 \
431+
--implementation cp --target "$(mktemp -d)" --index-url "${index}" "${requirement}"
432+
done
433+
echo "OK: ${requirement} resolves from ${index} on ${wheel_platforms[*]}"
434+
}
435+
360436
# Runs a build on its emulator: build dir, target, log, then idf.py arguments.
361437
run_firmware() {
362438
local build=$1 target=$2 log=$3
@@ -390,5 +466,7 @@ case "${mode}" in
390466
prepare) prepare "$@" ;;
391467
build) build "$@" ;;
392468
registry) registry "$@" ;;
469+
wheel) wheel "$@" ;;
470+
torch) torch ;;
393471
*) echo "unknown mode ${mode}; ${usage}" >&2; exit 1 ;;
394472
esac

‎.github/workflows/publish-esp-idf.yml‎

Lines changed: 64 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
name: Publish ESP-IDF component
22

33
# Publishes pytorch/executorch to the ESP Component Registry: RC tags to the
4-
# staging registry, release tags to staging and then production. The archive
4+
# staging registry, release tags to staging and then production, and on demand
5+
# a dev version of a nightly branch commit for early adopters. The archive
56
# is built and tested on the ESP-IDF releases the component supports before
67
# any upload, and each upload is followed by a consumer build that resolves
78
# the version from that registry. See the release runbook in
@@ -14,7 +15,7 @@ on:
1415
workflow_dispatch:
1516
inputs:
1617
version_suffix:
17-
description: 'Version suffix: empty at a release tag, -rc.N at an RC tag, ~N for a packaging respin on release/X.Y'
18+
description: 'Version suffix: empty at a release tag, -rc.N at an RC tag, ~N for a packaging respin on release/X.Y, -dev for the dev version of the nightly branch'
1819
type: string
1920
default: ''
2021
registry:
@@ -33,6 +34,7 @@ on:
3334
- .github/workflows/publish-esp-idf.yml
3435
- .ci/scripts/upload_espressif_idf_component.sh
3536
- .ci/scripts/espressif_idf_upload_requirements.txt
37+
- .ci/scripts/test_espressif_idf_nightly.sh
3638

3739
# Runs for one tag or branch go one at a time; runs for different ones, such as
3840
# an RC awaiting approval and its release, do not hold each other up.
@@ -59,6 +61,7 @@ jobs:
5961
shell: bash
6062
env:
6163
EVENT: ${{ github.event_name }}
64+
REF: ${{ github.ref }}
6265
REF_NAME: ${{ github.ref_name }}
6366
VERSION_SUFFIX: ${{ inputs.version_suffix }}
6467
REGISTRY: ${{ inputs.registry }}
@@ -79,8 +82,18 @@ jobs:
7982
fi
8083
;;
8184
workflow_dispatch)
82-
if [[ ! "${VERSION_SUFFIX}" =~ ^(-rc\.[1-9][0-9]*|~[1-9][0-9]*)?$ ]]; then
83-
echo "::error::version_suffix must be empty, -rc.N or ~N, not '${VERSION_SUFFIX}'."
85+
if [[ ! "${VERSION_SUFFIX}" =~ ^(-rc\.[1-9][0-9]*|~[1-9][0-9]*|-dev)?$ ]]; then
86+
echo "::error::version_suffix must be empty, -rc.N, ~N or -dev, not '${VERSION_SUFFIX}'."
87+
exit 1
88+
fi
89+
# A dev version's users install the nightly wheel of its commit.
90+
if [[ "${VERSION_SUFFIX}" == -dev && "${REF}" != refs/heads/nightly ]]; then
91+
echo "::error::a dev version is published from the nightly branch, not ${REF}."
92+
exit 1
93+
fi
94+
# The environment trusts the nightly branch for dev versions only.
95+
if [[ "${REF}" == refs/heads/nightly && "${VERSION_SUFFIX}" != -dev ]]; then
96+
echo "::error::the nightly branch publishes dev versions only, with version_suffix -dev."
8497
exit 1
8598
fi
8699
if [[ "${VERSION_SUFFIX}" == -rc.* && "${REGISTRY}" == production ]]; then
@@ -136,26 +149,68 @@ jobs:
136149
unset SCCACHE_BUCKET SCCACHE_S3_KEY_PREFIX
137150
CONDA_ENV=$(conda env list --json | jq -r '.envs | .[-1]')
138151
conda activate "${CONDA_ENV}"
152+
nightly=.ci/scripts/test_espressif_idf_nightly.sh
153+
suffix="${{ needs.plan.outputs.suffix }}"
154+
# A tag names its version; a dispatch appends its suffix to version.txt.
155+
expected="${{ needs.plan.outputs.version }}"
156+
expected="${expected:-$(cat version.txt)${suffix}}"
157+
# Before the build: a dev version's users install the nightly wheels of
158+
# its commit.
159+
if [[ "${suffix}" == -dev ]]; then
160+
expected=$(bash examples/espressif/build_idf_component.sh --version --version-suffix -dev)
161+
bash "${nightly}" wheel "${RUNNER_ARTIFACT_DIR}" "${expected}" "$(git rev-parse HEAD)"
162+
fi
139163
source .ci/scripts/utils.sh
140164
install_executorch --use-pt-pinned-commit --minimal
141165
if [[ "${{ needs.plan.outputs.rehearsal }}" == true ]]; then
142166
# A pull request rehearses the release stamp at a throwaway local tag.
143167
git tag -f "v$(cat version.txt)"
144168
fi
145-
# A tag names its version; a dispatch appends its suffix to version.txt.
146-
expected="${{ needs.plan.outputs.version }}"
147-
expected="${expected:-$(cat version.txt)${{ needs.plan.outputs.suffix }}}"
148-
bash .ci/scripts/test_espressif_idf_nightly.sh prepare "${RUNNER_ARTIFACT_DIR}" \
149-
--version-suffix "${{ needs.plan.outputs.suffix }}"
169+
bash "${nightly}" prepare "${RUNNER_ARTIFACT_DIR}" --version-suffix "${suffix}"
150170
version=$(cat "${RUNNER_ARTIFACT_DIR}/version")
151171
if [[ "${version}" != "${expected}" ]]; then
152172
echo "FAIL: generated version ${version}, expected ${expected}" >&2
153173
exit 1
154174
fi
175+
bash "${nightly}" torch "${RUNNER_ARTIFACT_DIR}"
155176
echo "Packed pytorch/executorch ${version}"
156177
# Nothing downstream reads the unpacked component.
157178
rm -r "${RUNNER_ARTIFACT_DIR}/component"
158179
180+
# A pull request rehearses the dev version's wheel check on the latest
181+
# finished nightly that has wheels. Nightly wheels fail to build for days at a
182+
# time, so finding none only warns, and nothing waits on this job.
183+
dev-wheel-rehearsal:
184+
name: Rehearse the dev version's wheel check
185+
needs: plan
186+
if: needs.plan.outputs.rehearsal == 'true'
187+
runs-on: ubuntu-22.04
188+
steps:
189+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
190+
with:
191+
persist-credentials: false
192+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
193+
with:
194+
python-version: '3.11'
195+
- run: |
196+
set -euo pipefail
197+
# The nightly index keeps about two months of wheels.
198+
git fetch -q --shallow-since='61 days ago' origin \
199+
+refs/heads/nightly:refs/remotes/origin/nightly
200+
listing=$(curl -sSf https://download.pytorch.org/whl/nightly/cpu/executorch/)
201+
today=$(date -u +%Y%m%d)
202+
for commit in $(git rev-list --first-parent origin/nightly); do
203+
day=$(TZ=UTC git log -1 --format=%cd --date=format-local:%Y%m%d "${commit}")
204+
version="$(git show "${commit}:version.txt")-dev.${day}"
205+
if [[ "${day}" != "${today}" ]] \
206+
&& grep -qF "executorch-${version/-dev./.dev}" <<< "${listing}"; then
207+
bash .ci/scripts/test_espressif_idf_nightly.sh wheel "${RUNNER_TEMP}/wheel" \
208+
"${version}" "${commit}"
209+
exit 0
210+
fi
211+
done
212+
echo "::warning::no nightly of the last 60 days has wheels; the dev wheel check went unrehearsed."
213+
159214
dry-run:
160215
name: Registry validation on ${{ matrix.registry }} (upload --dry-run)
161216
needs: [docker-image, package]

‎examples/espressif/README.md‎

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ both with `executorch_add_model` and `executorch_add_kernels` (see the
4242
component's `README.md`). Application pipelines built on the runtime
4343
(for example wake word front ends and detectors) stay with the
4444
application.
45-
Consumers need ESP-IDF, plus the `executorch` Python package of the
46-
same release to make kernel bundles — no host CMake build, no flatc.
45+
Consumers need ESP-IDF, plus the `executorch` Python package the
46+
component was built from to make kernel bundles (see the component's
47+
`README.md`) — no host CMake build, no flatc.
4748
`idf_component_smoke/` is a minimal consumer that CI generates, builds
4849
and runs on the emulator (`.ci/scripts/test_espressif_idf_component.sh`).
4950
`idf_component_consumer/` builds the same app from the packed component
@@ -78,6 +79,15 @@ serves the tested files, and runs it on the emulator.
7879
`examples/espressif/`, `.ci/`, `.github/` and `docs/`, and run the
7980
workflow on `release/X.Y` with `version_suffix` `~N`. A release whose
8081
publishing failed in CI is published as a respin once the CI is fixed.
82+
- A dev version, `X.Y.Z-dev.YYYYMMDD`, lets projects use the component
83+
before a release. Run the workflow on the `nightly` branch with
84+
`version_suffix` `-dev`, `registry` `production` and `dry_run` cleared,
85+
between 00:00 UTC and the next nightly (around 11:30 UTC), so that it
86+
publishes the last nightly of a finished day. Projects resolve from
87+
production, where a version range picks up a pre-release only if it opts
88+
in. The run publishes only if that day's ExecuTorch nightly wheels, on
89+
every platform, were built from the same commit, because projects install
90+
them to make their kernel bundles.
8191
- A manual run only validates unless `dry_run` is cleared. With `registry`
8292
`production`, it uploads to staging first. Uploads skip versions the
8393
registry already has, so **Re-run failed jobs** retries with the same
@@ -88,13 +98,15 @@ Each upload waits for a reviewer of the `esp-component-registry`
8898
environment, the only place the registries accept uploads from: on each
8999
registry, `pytorch/executorch`'s trusted uploader names this repository and
90100
that environment. Before approving an upload, check that the run's ref and
91-
commit are the release's announced tag and commit. Before approving the
92-
staging upload, dispatch the nightly matrix (`nightly-espressif-idf.yml`)
93-
on the tag and wait for it to pass; it also covers ESP-IDF master, the
94-
all-ops build and the macOS and Windows configure jobs. Approve the
95-
production upload once `executorch` X.Y.Z is on PyPI, since a project
96-
needs it to make kernel bundles, and the release owner has built a
97-
project against the version on staging.
101+
commit are the release's announced tag and commit, or for a dev version,
102+
the `nightly` branch. Before approving the staging upload of a release or
103+
RC, dispatch the nightly matrix (`nightly-espressif-idf.yml`) on the tag
104+
and wait for it to pass; it also covers ESP-IDF master, the all-ops build
105+
and the macOS and Windows configure jobs. A dev version has only its own
106+
run's builds. Approve the production upload once, for a release,
107+
`executorch` X.Y.Z is on PyPI, since a project needs it to make kernel
108+
bundles, and the release owner has built a project against the version on
109+
staging.
98110

99111
The one-time setup goes in this order, because GitHub creates a missing
100112
environment, unprotected, as soon as a workflow names it:
@@ -103,7 +115,8 @@ environment, unprotected, as soon as a workflow names it:
103115
delete `v*` tags, since the environment trusts those tags.
104116
2. Create the `esp-component-registry` environment with required
105117
reviewers, self-review prevented, no admin bypass, and deployments
106-
limited to `v*` tags and `release/*` branches.
118+
limited to `v*` tags and `release/*` branches, plus `nightly` before the
119+
first dev version.
107120
3. Create the `pytorch` namespace on the staging registry.
108121
4. On each registry, make this repository and that environment
109122
`pytorch/executorch`'s trusted uploader.

‎examples/espressif/build_idf_component.sh‎

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@
2222
# release/X.Y, after vX.Y.Z, and differ from
2323
# it only under examples/espressif/, .ci/,
2424
# .github/ and docs/.
25+
# --version-suffix -dev X.Y.Z-dev.<HEAD's commit date in UTC>,
26+
# published from the nightly branch.
2527
# --allow-dev-stamp X.Y.Z-dev.<HEAD's commit date in UTC>, for
2628
# builds from any commit; never published.
27-
# The first three also refuse uncommitted changes to what the generator
28-
# reads, and every stamp needs ExecuTorch at the top of its own git checkout.
29+
# All but --allow-dev-stamp also refuse uncommitted changes to what the
30+
# generator reads, and every stamp needs ExecuTorch at the top of its own git
31+
# checkout.
2932
#
3033
# Derived from examples/arduino/build_arduino_library.sh with an ESP-IDF
3134
# output layout and the shared ESP-IDF PAL. The component vendors every
@@ -143,12 +146,14 @@ ET_VERSION=$(cat "$ET_ROOT/version.txt")
143146
if [[ ! "$ET_VERSION" =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$ ]]; then
144147
stamp_error "version.txt must contain an ExecuTorch version in X.Y.Z form."
145148
fi
149+
DEV_SUFFIX="-dev.$(TZ=UTC git -C "$ET_ROOT" log -1 --format=%cd --date=format-local:%Y%m%d)"
146150
if [ "$ALLOW_DEV_STAMP" = true ]; then
147151
if [ "$VERSION_SUFFIX_GIVEN" = true ]; then
148152
stamp_error "--allow-dev-stamp picks the suffix; drop --version-suffix."
149153
fi
150-
VERSION_SUFFIX="-dev.$(TZ=UTC git -C "$ET_ROOT" log -1 --format=%cd --date=format-local:%Y%m%d)"
154+
VERSION_SUFFIX="$DEV_SUFFIX"
151155
fi
156+
STAMP_SUFFIX="$VERSION_SUFFIX"
152157
# A release commit can carry its last RC's tag too.
153158
HEAD_TAGS=$(git -C "$ET_ROOT" tag --points-at HEAD 2>/dev/null || true)
154159
head_has_tag() {
@@ -199,25 +204,28 @@ case "$VERSION_SUFFIX" in
199204
$CHANGED"
200205
fi
201206
;;
207+
-dev)
208+
VERSION_SUFFIX="$DEV_SUFFIX"
209+
;;
202210
*)
203211
# The only other suffix is the one --allow-dev-stamp picks.
204212
if [ "$ALLOW_DEV_STAMP" = false ]; then
205-
stamp_error "--version-suffix must be empty, -rc.N or ~N, not $VERSION_SUFFIX; --allow-dev-stamp makes a development stamp."
213+
stamp_error "--version-suffix must be empty, -rc.N, ~N or -dev, not $VERSION_SUFFIX; --allow-dev-stamp makes an unpublished development stamp."
206214
fi
207215
;;
208216
esac
209217
if [ "$ALLOW_DEV_STAMP" = false ]; then
210218
CHANGES=$(uncommitted_changes)
211219
if [ -n "$CHANGES" ]; then
212-
stamp_error "a release, RC or respin stamp needs a checkout without uncommitted changes to what the generator reads, but found:
220+
stamp_error "a published stamp needs a checkout without uncommitted changes to what the generator reads, but found:
213221
$CHANGES"
214222
fi
215223
fi
216224
ET_COMPONENT_VERSION="$ET_VERSION$VERSION_SUFFIX"
217225
if [ "$ALLOW_DEV_STAMP" = true ]; then
218226
STAMP_OPTION=" --allow-dev-stamp"
219227
elif [ "$VERSION_SUFFIX_GIVEN" = true ]; then
220-
STAMP_OPTION=" --version-suffix '$VERSION_SUFFIX'"
228+
STAMP_OPTION=" --version-suffix '$STAMP_SUFFIX'"
221229
else
222230
STAMP_OPTION=""
223231
fi
@@ -682,11 +690,25 @@ sed -e "s/@ET_COMPONENT_VERSION@/$ET_COMPONENT_VERSION/" -e "s/@ET_COMMIT@/$ET_S
682690
"$TEMPLATE_DIR/idf_component.yml.in" > "$OUT_DIR/idf_component.yml"
683691

684692
ET_DIRTY=$(uncommitted_changes)
693+
# The torch that install_requirements.py installs to build ExecuTorch's wheels,
694+
# which declare none, and the index that keeps it.
695+
TORCH_REQUIREMENT=$(sed -n 's/.*"\(torch==[^"]*\)" if use_pytorch_nightly.*/\1/p' \
696+
"$ET_ROOT/install_requirements.py")
697+
if [ -z "$TORCH_REQUIREMENT" ]; then
698+
echo "ERROR: install_requirements.py names no torch==X for the wheel builds." >&2; exit 1
699+
fi
700+
if [[ "$TORCH_REQUIREMENT" == *.dev* ]]; then
701+
TORCH_INDEX=https://download.pytorch.org/whl/nightly/cpu
702+
else
703+
TORCH_INDEX=https://download.pytorch.org/whl/cpu
704+
fi
685705
{
686706
echo "# GENERATED by examples/espressif/build_idf_component.sh -- do not edit."
687707
echo "executorch_version: $ET_VERSION"
688708
echo "component_version: $ET_COMPONENT_VERSION"
689709
echo "executorch_commit: $ET_SHA${ET_DIRTY:+ (tree had uncommitted changes)}"
710+
echo "torch_requirement: $TORCH_REQUIREMENT"
711+
echo "torch_index: $TORCH_INDEX"
690712
echo "generator: examples/espressif/build_idf_component.sh --out $OUT_DIR_AS_GIVEN$STAMP_OPTION"
691713
echo "kernel_libraries:"
692714
for entry in "${LIBRARIES[@]}"; do

0 commit comments

Comments
 (0)