Skip to content

Switch to using prebuilt toolchain containers#33

Merged
nchapman merged 2 commits into
developfrom
feature/toolchain-containers
Nov 24, 2025
Merged

Switch to using prebuilt toolchain containers#33
nchapman merged 2 commits into
developfrom
feature/toolchain-containers

Conversation

@nchapman
Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings November 24, 2025 01:03
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes the LessUI build system by switching from locally-built toolchain containers to pre-built containers hosted on GitHub Container Registry (ghcr.io/lessui-hq). This eliminates the need to clone toolchain repositories and build Docker images locally, significantly simplifying the setup process and reducing build times.

Key Changes

  • Replaced git cloning and local Docker building with docker pull from GitHub Container Registry
  • Added force-pull target to easily update to the latest toolchain versions
  • Simplified the clean process to only remove local tags and marker files
  • Updated documentation to reflect the new pre-built container workflow

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread makefile.toolchain Outdated

# Default target: ensure toolchain is built, then launch interactive shell
all: $(INIT_IF_NECESSARY)
docker run --rm -e LOG_FLAGS="$(LOG_FLAGS)" -v $(HOST_WORKSPACE):$(GUEST_WORKSPACE) $(PLATFORM)-toolchain /bin/bash
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The all target at line 41 lacks the @ prefix for the docker run command. This causes the command to be echoed to the console before execution, which is inconsistent with the cleaner output style used in the $(INIT_IF_NECESSARY) target (lines 45-61) where informational messages use @echo. Consider adding @ to line 41 for consistency and cleaner output.

Suggested change
docker run --rm -e LOG_FLAGS="$(LOG_FLAGS)" -v $(HOST_WORKSPACE):$(GUEST_WORKSPACE) $(PLATFORM)-toolchain /bin/bash
@docker run --rm -e LOG_FLAGS="$(LOG_FLAGS)" -v $(HOST_WORKSPACE):$(GUEST_WORKSPACE) $(PLATFORM)-toolchain /bin/bash

Copilot uses AI. Check for mistakes.
Comment thread makefile.toolchain Outdated
# Build all workspace components in Docker (non-interactive)
build: $(INIT_IF_NECESSARY)
docker run --rm -e LOG_FLAGS="$(LOG_FLAGS)" -v $(HOST_WORKSPACE):$(GUEST_WORKSPACE) $(PLATFORM)-toolchain /bin/bash -c '. ~/.bashrc && cd /root/workspace && make' No newline at end of file
docker run --rm -e LOG_FLAGS="$(LOG_FLAGS)" -v $(HOST_WORKSPACE):$(GUEST_WORKSPACE) $(PLATFORM)-toolchain /bin/bash -c '. ~/.bashrc && cd /root/workspace && make'
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The build target at line 70 lacks the @ prefix for the docker run command. This causes the command to be echoed to the console before execution, which is inconsistent with the cleaner output style used in the $(INIT_IF_NECESSARY) target (lines 45-61) where informational messages use @echo. Consider adding @ to line 70 for consistency and cleaner output.

Suggested change
docker run --rm -e LOG_FLAGS="$(LOG_FLAGS)" -v $(HOST_WORKSPACE):$(GUEST_WORKSPACE) $(PLATFORM)-toolchain /bin/bash -c '. ~/.bashrc && cd /root/workspace && make'
@docker run --rm -e LOG_FLAGS="$(LOG_FLAGS)" -v $(HOST_WORKSPACE):$(GUEST_WORKSPACE) $(PLATFORM)-toolchain /bin/bash -c '. ~/.bashrc && cd /root/workspace && make'

Copilot uses AI. Check for mistakes.
Comment thread makefile.toolchain
# Clean Docker image
clean:
cd toolchains/$(PLATFORM)-toolchain && make clean
@docker rmi $(PLATFORM)-toolchain 2>/dev/null || true
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The clean target only removes the local tag $(PLATFORM)-toolchain but doesn't remove the pulled container image $(CONTAINER_IMAGE) from Docker. This means docker pull won't fetch updates after a clean unless force-pull is used. Consider adding @docker rmi $(CONTAINER_IMAGE) 2>/dev/null || true to ensure a fresh pull on the next build, or document that force-pull should be used to get updates after cleaning.

Suggested change
@docker rmi $(PLATFORM)-toolchain 2>/dev/null || true
@docker rmi $(PLATFORM)-toolchain 2>/dev/null || true
@docker rmi $(CONTAINER_IMAGE) 2>/dev/null || true

Copilot uses AI. Check for mistakes.
Comment thread makefile.toolchain Outdated
# make -f makefile.toolchain PLATFORM=miyoomini build # Build all
#
# Adding a new platform:
# 1. Fork union-<platform>-toolchain repo to lessui-hq org
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing article 'the' before 'union--toolchain'. The sentence should read "Fork the union--toolchain repo to lessui-hq org" for better grammar.

Suggested change
# 1. Fork union-<platform>-toolchain repo to lessui-hq org
# 1. Fork the union-<platform>-toolchain repo to lessui-hq org

Copilot uses AI. Check for mistakes.
Comment thread makefile.toolchain Outdated
echo "❌ Container not found: $(CONTAINER_IMAGE)" && \
echo "" && \
echo "To add support for $(PLATFORM):" && \
echo " 1. Fork union-$(PLATFORM)-toolchain to lessui-hq org" && \
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing article 'the' before 'union-$(PLATFORM)-toolchain'. The sentence should read "Fork the union-$(PLATFORM)-toolchain to lessui-hq org" for better grammar and consistency with the corrected instruction at line 14.

Suggested change
echo " 1. Fork union-$(PLATFORM)-toolchain to lessui-hq org" && \
echo " 1. Fork the union-$(PLATFORM)-toolchain to lessui-hq org" && \

Copilot uses AI. Check for mistakes.
Comment thread makefile.toolchain Outdated
# Force pull latest pre-built container (useful for updates)
force-pull:
@echo "Updating $(PLATFORM)-toolchain from $(CONTAINER_REGISTRY)/$(CONTAINER_ORG)..."
@docker pull $(CONTAINER_IMAGE)
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The force-pull target doesn't handle docker pull failures. If the pull fails (e.g., network issue, authentication problem), the subsequent docker tag at line 76 will fail since the image won't exist, but the marker file will still be created at line 77, incorrectly indicating the toolchain is ready. Consider adding error handling similar to lines 48-57, or using set -e in the recipe to stop on first error.

Suggested change
@docker pull $(CONTAINER_IMAGE)
@docker pull $(CONTAINER_IMAGE) || \
(echo "" && \
echo "❌ Failed to pull container: $(CONTAINER_IMAGE)" && \
echo "" && \
echo "Check your network connection, authentication, or image existence." && \
echo "" && \
exit 1)

Copilot uses AI. Check for mistakes.
@nchapman nchapman merged commit e4ed0c0 into develop Nov 24, 2025
4 checks passed
@nchapman nchapman deleted the feature/toolchain-containers branch November 24, 2025 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants