Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .cursor/environment.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
"github.com/PyDevices/pygraphics",
"github.com/PyDevices/palettes",
"github.com/PyDevices/pdwidgets",
"github.com/PyDevices/lvgl-bindings",
"github.com/PyDevices/lvgl-python",
"github.com/PyDevices/lvgl-micropython",
"github.com/PyDevices/lvgl-circuitpython",
"github.com/PyDevices/omnipython-lvgl",
"github.com/PyDevices/mpftp",
"github.com/PyDevices/mip",
"github.com/PyDevices/workbench",
Expand Down
53 changes: 8 additions & 45 deletions scripts/cloud-workspace-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ SIBLINGS=(
micropython-pydevices
audiodsp
pygraphics
lvgl-bindings
lvgl-circuitpython
lvgl-python
lvgl-micropython
omnipython-lvgl
pydevices
mpftp
palettes
Expand Down Expand Up @@ -158,37 +155,9 @@ shallow_clone_if_missing() {
"$url" "$path"
}

# Uninitialized submodule checkout: empty dir or gitlink stub without sources.
is_empty_lvgl_placeholder() {
local d=$1
[[ -d "$d" && ! -L "$d" ]] || return 1
[[ ! -e "$d/src" && ! -e "$d/lvgl.h" ]]
}

ensure_lv_cpython_lvgl_symlink() {
local lvcp_lvgl="$PD/lvgl-python/lvgl"
[[ -d "$PD/lvgl-python" ]] || return 0

if [[ -L "$lvcp_lvgl" ]]; then
return 0
fi
if is_empty_lvgl_placeholder "$lvcp_lvgl"; then
log "replace empty $lvcp_lvgl with symlink -> ../lvgl-bindings/lvgl"
rm -rf "$lvcp_lvgl"
ln -s ../lvgl-bindings/lvgl "$lvcp_lvgl"
return 0
fi
if [[ -e "$lvcp_lvgl" ]]; then
log "skip $lvcp_lvgl (exists, not a symlink — remove manually to relink)"
return 0
fi
log "link $lvcp_lvgl -> ../lvgl-bindings/lvgl"
ln -s ../lvgl-bindings/lvgl "$lvcp_lvgl"
}

verify_ready() {
local name missing=0
for name in micropython-pydevices audiodsp pygraphics lvgl-bindings pydevices gallery palettes pdwidgets; do
for name in micropython-pydevices audiodsp pygraphics omnipython-lvgl pydevices gallery palettes pdwidgets; do
if [[ ! -d "$REPOS/$name/.git" && ! -L "$REPOS/$name" ]]; then
log "ERROR: required repo missing: $REPOS/$name"
missing=1
Expand All @@ -202,12 +171,8 @@ verify_ready() {
log "ERROR: micropython clone missing"
missing=1
fi
if [[ ! -e "$REPOS/lvgl-bindings/lvgl/src" ]]; then
log "ERROR: lvgl-bindings/lvgl submodule not initialized"
missing=1
fi
if [[ ! -L "$PD/lvgl-python/lvgl" ]]; then
log "ERROR: lvgl-python/lvgl is not a symlink to lvgl-bindings/lvgl"
if [[ ! -e "$REPOS/omnipython-lvgl/lvgl/src" ]]; then
log "ERROR: omnipython-lvgl/lvgl submodule not initialized"
missing=1
fi
return "$missing"
Expand All @@ -234,7 +199,7 @@ link_pydevices android-template "$REPOS/android-template"
# modules.lock pins. The repositories below are siblings at the workspace root,
# the layout every build script in the org defaults to.
for s in micropython-pydevices audiodsp pygraphics \
lvgl-bindings lvgl-circuitpython lvgl-python lvgl-micropython; do
omnipython-lvgl; do
[[ -d "$REPOS/$s" || -L "$REPOS/$s" ]] && link_pydevices "$s" "$REPOS/$s"
done

Expand All @@ -250,13 +215,11 @@ if [[ -f "$REPOS/micropython-pydevices/patches/apply_patches.py" ]]; then
|| log "WARNING: apply_patches.py failed; the checkout is unpatched"
fi

if [[ -d "$REPOS/lvgl-bindings/.git" ]]; then
log "init lvgl-bindings/lvgl submodule"
git -C "$REPOS/lvgl-bindings" submodule update --init --depth 1 lvgl
if [[ -d "$REPOS/omnipython-lvgl/.git" ]]; then
log "init omnipython-lvgl/lvgl submodule"
git -C "$REPOS/omnipython-lvgl" submodule update --init --depth 1 lvgl
fi

ensure_lv_cpython_lvgl_symlink

verify_ready || die "workspace verification failed — agents cannot start real work yet"

log "done (workspace root: $PD)"
Loading