Skip to content

Example Bazel build #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from
Draft

Example Bazel build #119

wants to merge 22 commits into from

Conversation

rauhul
Copy link
Collaborator

@rauhul rauhul commented May 3, 2025

No description provided.

iCMDdev and others added 22 commits January 14, 2025 11:00
Provide new examples demonstrating how to run Swift Embedded on the Raspberry Pi 4B and 5 single-board computers, in a baremetal fashion, without an underlying operating system. The provided examples showcase how to blink the onboard green LED using Swift MMIO.
As seen at FOSDEM 2025

Note: ignore formatting for now
Updates to match latest swift-format configuration in swift-mmio.
* Make stm32-blink sample building as both Mach-O and ELF
* Use STM_BOARD env var to select which board to target on stm32-blink example
* Fix python lint issues in Tools/elf2hex.py
Updates the stm32-uart-echo and stm32-neopixel examples to use a swiftpm
toolset.json to specify various compiler and linker flags. Also updates
the Makefiles to leverage swiftpm to link the executable instead of
manually linking using `ld` directly.
Instead of having users manually manage python venvs this commit
migrates the python scripts to use `uv` which can handle installing
script dependencies automatically. Additionally it doesn't require
sourcing a venv setup script in every shell where you want to build.

A further improvement on the swift swift side should also be made to use
swiftly to manage swift toolchain versions instead of the `TOOLCHAINS`
env variable.
Switches from manually running various compilers and linkers to using
SwiftPM for most of the leg work. Additionally switches from -Osize to
-O which has notably better runtime performance.
Replaces the register definitions used by the stm32-lcd-logo example to
use ones generated by svd2swift leveraging swift-mmio. Additionally
refactors much of the example code to have fewer layers of abstraction
as they make the code much harder to follow.
Updates the various GitHub workflows to use a common "Install Swift"
action using swiftly and a .swift-version file at the repo root. This
allows us to drop the swift version from each of the workflows and makes
it easier for users to reproduec the CI environment.

Future:
- Add a workflow which auto updates this file.
- Update READMEs to suggest install swift using swiftly.
Updates the install swift action to skip a bunch of apt packages we don't use.
Removes the legacy build.sh script used to build the pico-blink firmware
and replaces it with a makefile leveraging SwiftPM + a new pico.json
toolset file. This means we no longer have to handle build flags in the
build script directly and SwiftPM can handle invoking the linker.
Updates github workflows to reigger on any pull request and creation of
new pull requests.
Not yet complete workflow which automatically updates the `.swift-version` file in this repo.
Initial pass at migrating documentation from swiftlang/swift to a more
accessible location and reformatting it into a docc catalog. I've added
a number of placeholder pages for additional documentation to be written.
Community members are very welcome to help contribute to this
documentation.
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.

4 participants