-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Proposal: Multi-platform package-based Zephyr SDK #37255
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
Comments
I'm in favor of this proposal, especially the flexibility of releasing new versions of the host tools and toolchain independently. One additional thought for helping brand new users get up and running, what are people's thoughts on bundling a Linux virtual machine that already has the all the necessary host tools, toolchains, and even the Zephyr source already installed? The distributed source could be tied to the latest LTS release. |
We've been using that docker image for quite some time now, mostly Just Works: thesofproject/sof@40c9bb2e304d0 |
We are already doing something similar with the Docker image, but the main problem with Docker is that it is painfully slow. There is an ongoing discussion about this. |
I haven't seen much about docker performance at that link. Isn't the whole point of containers to be leaner and faster than virtual machines? Can you elaborate? |
I meant there is an ongoing discussion about container-based (including Docker) approach there (sorry for the confusion, I could have phrased it better).
In theory, yes; but, I (and many others who I work with) have seen Docker-based build process taking almost 2x as long as native or VM-based build. I assume the performance issues are mostly I/O-bound. Outside Docker:
Inside Docker:
|
As mentioned before, we already have a Docker image for that. While this is a good solution for some, it certainly is not for many. Most developers prefer to have the tools they need installed directly on their operating system, and Docker is not a good option on macOS or Windows anyway. So I propose we continue to offer the Docker image all the same, but we should not rely on it as the main mechanism to start developing on Zephyr. |
I think we should have some rpm package format and possibly dropping snap's on linux. |
rpm support does sound reasonable, especially noting that there are many developers on Fedora.
I am not sure about that. There are many different types and versions of Linux distributions with different dependencies. We might be able to (sort of) get away with the toolchains by statically linking everything, but that is not really feasible for the host tools, and we will need something like Yocto to address this -- and that's where Snap, which provides a known base system, comes into play. I think native deb (for the latest Ubuntu LTS) and rpm (for the latest RHEL release, which should also be compatible with the relevant version of Fedora) packages + Snap (for the rest) would be a reasonable target. |
So I think My 2 cents would be either we try and poll people to see if they'd use a Snap and/or mark the support as experimental to start with. Not sure if we'd have some way to track downloads or access with hosting a snap. |
By "existing tarball," do you mean tarball with Yocto sysroot? If so, in the context of per-component distribution (tarball), we will need to distribute Yocto sysroot per component (e.g. QEMU tarball containing its own sysroot, OpenOCD tarball containing its own sysroot, ...), which can be quite wasteful due to the duplicates.
Snap is indeed developed and maintained by Canonical Ltd, which is the company responsible for Ubuntu. Regardless of the ownership and politics, objectively speaking, Snap seemed to be our best option for cross-distro support while keeping things sane (i.e. without Yocto sysroot per component). For those who are not familiar with Snap, it provides Ubuntu Core base environment on which packaged programs can run -- meaning, as long as you build your program targeting Ubuntu Core (which is just a stripped down version of Ubuntu), it will work on all distros supported by Snap, and that includes Arch, Debian, Fedora, Kali, openSUSE, RHEL, Solus, elementary OS, GalliumOS, Linux Mint, Raspberry Pi OS and Ubuntu.
I think marking it experimental would be a good starting point as you suggest. I am sure the users who are on the distros that are not supported by our deb and rpm packages will appreciate the value of having Snap packages. For the majority of users who can just install the deb and rpm packages though, Snap support would be meaningless.
Snapcraft, which is the platform used for building and distributing Snap packages, provides statistics. |
Re: Renaming "Zephyr SDK" because the term "SDK" refers to "BSP" (as discussed in the last TSC meeting) My suggestion is to rename "Zephyr SDK" to "Zephyr Tools," because it is quite literally a collection of tools for Zephyr development. |
Would we merge the nettools into this? Maybe 'buildtools' |
Toolchain WG proposals, see individual proposals. |
Proposal 1:
|
|
|
Comments from the Toolchain WG meeting today (2021-08-10)
Please let me know if I missed any. |
@stephanosio it seems And brew doesn't suffer the snap limitations. Note: I have zero experience with brew on Linux, so if you have already tried and found that it's not worth the effort, please comment. |
There are quite a few problems with Homebrew on Linux (aka. Linuxbrew):
IMO, no. 3 is really a showstopper. As per the last week's discussion, we can drop Snap and provide Yocto-based "universal" tarballs for the people who are not on the mainstream distros like Ubuntu and Fedora. |
Thanks, completely agree, brew is not an alternative on Linux. |
Regarding windows support - that is absolutely not necessary because windows has very nice Ubuntu support through WSL2 and zephyr builds on that without any issues. |
Until you want to flash/debug your targets and do many other USB stuff, and also you want to integrate directly to a native Windows IDE. |
@mkschreder : Although WSL2 works nicely, it adds a whole new layer of complexity which we want to shield users from. |
While you can use WSL2 to flash/debug (I wrote about it here) and I do, many companies still require use of Windows and Windows tools. Even still, when we do trainings, more than 2/3rds of participants are on Windows for their personal machines. Having Windows support is rather important, for better or for worse :) |
After having spent some time trying to package, build, sell, .. the Zephyr SDK in an appealing way, I actually feel that something like this proposal is probably the best possible solution to the distribution problem. Almost all package managers have this concept of adding an external mirror or package source. Zephyr should simply host a repository for various package managers. The CI SDK build already does the whole matrix. Why not e.g. throw .rpms or .debs into the mix as well? I would suggest for macOS and Windows to just distribute binary packages for use in the repositories (distributed via chocolatey or homebrew). The reason that I say this, is that it's far easier for big companies to look at a certain preferred package format and to approve certain external repositories than it is keep up with what's happening in a few dozen GitHub projects. |
(quotes mine) Perfect solution except for the small implementation detail of the "packaging hero" capable of juggling many different VMs to deploy, test and release simultaneously across all the wildly different operating systems and packaging formats. Not forgetting some server administration skills and the knowledge of how various online repos are structured. Most of this should of course be automated but it still seems like a very large amount of work. There is probably a reason why people packaging Linux software are most often different from the ones writing it (despite crazy amounts of automation) and why brand new Linux packaging solutions like snap, AppImage, Flatpack and what not are being aggressively explored.
Thank you. Low-tech = missing nice things but Just Working.
Having to manage not just one but two systems is significant overhead and sharing across both systems can be super painful: https://github.com/thesofproject/sof/blob/0a4b1d62d5/scripts/sudo-cwd.sh On the other hand, this image is FANTASTIC for CI and as a reference for quickly finding configuration problems, thanks for it! |
Hi @stephanosio, This issue, marked as an RFC, was opened a while ago and did not get any traction. Please confirm the issue is correctly assigned and re-assign it otherwise. Please take a moment to review if the issue is still relevant to the project. If it is, please provide feedback and direction on how to move forward. If it is not, has already been addressed, is a duplicate, or is no longer relevant, please close it with a short comment explaining the reason. Thanks! |
|
I would avoid snap. Better to provide native packages (deb, apk etc) if packaging support is needed. |
Introduction (non-technical overview)
The Zephyr SDK, also known as sdk-ng, has several limitations that affect its usability as well as overall developer experience.
Problem description
Proposed change
Detailed proposal (technical)
A proof-of-concept was implemented last year (2020) to assess the feasibility of supporting Linux, macOS and Windows through Snap/APT, Homebrew and Chocolatey, respectively.
Definitions
A set of target-specific compilation tools (e.g. binutils, gcc and gdb).
A set of development tools to be used on the host operating system (e.g. QEMU, OpenOCD)
A collection of software tools that automates the process of installing, upgrading, configuring and removing programs.
A compiled program that is distributed through and managed by the package management system.
A compiled program that is compressed into and distributed as single archive file (e.g.
.tar.gz
and.zip
).Can be used as a source for building a distribution package.
A mechanism provided by CMake that can be used to locate a component of compatible version installed on the system through the CMake package registry.
Can be integrated into a
distribution archive
anddistribution package
.Problem description (technical)
Proposed change (technical)
find_package
command. For example:find_package(zephyr-crosstool-arm 10.0.1.3 EXACT ...)
.find_package(zephyr-qemu 5.1.0.15 EXACT ...)
.find_package
command shall allow manually specifying the CMake package search path in order to allow using the SDK component installations that are not registered in the CMake package registry.HINTS
option. For example,find_package(zephyr-crosstool-arm 10.0.1.3 EXACT ... HINTS $ENV{ZEPHYR_SDK_INSTALL_DIR})
.gccmajor.gccminor.zcommon.ztarget
format where:gccmajor
andgccminor
are the base gcc major and minor version numbers.zcommon
is a version number that is incremented when a Zephyr-specific change that is common to all targets is made.ztarget
is a version number that is incremented when a Zephyr-specific change that is limited to a specific target is made.10.1.x.x
, starting at10.1.0.0
.10.1.0.1
(note that the toolchains for the rest of the targets need not be newly released, and they remain at10.1.0.0
).10.1.1.0
(this ensures that all target toolchains with the version number10.1.1.x
have the same base feature and makes it easier to track feature updates).sdk-ng
repository tozephyr-crosstool
and move host tool components out to the relevant fork repositoriesmeta-zephyr-sdk
directory).zephyr-v5.1.0
based on thev5.1.0
tag with the Zephyr-specific patches applied on top).zephyrproject-rtos/zephyr-crosstool
repository (oldsdk-ng
repository).mingw-w64
).zephyr-crosstool
repository shall be "distribution archive" (.tar.gz
for Linux and.zip
for Windows), which is used as source for building the distribution packages, or used as-is by the users that prefer to not use package management system-based distribution.zephyrproject-rtos/qemu
repository.qemu
repository shall be "distribution archive."zephyrproject-rtos/openocd
repository.qemu
repository shall be "distribution archive."zephyrproject-rtos/bossa
repository.qemu
repository shall be "distribution archive."stephanosio/snap-zephyr
for preliminary implementation.zephyrproject-rtos/packages-snap
package source repository.zephyr-crosstool
and host tool package definitions.stephanosio/deb-zephyr
for preliminary implementation.zephyrproject-rtos/packages-deb
package source repository.zephyr-crosstool
and host tool package definitions.stephanosio/homebrew-zephyr
for preliminary implementation.zephyrproject-rtos/packages-homebrew
package source repository.zephyr-crosstool
and host tool package definitions.stephanosio/chocolatey-zephyr
for preliminary implementation.zephyrproject-rtos/packages-chocolatey
package source repository.zephyr-crosstool
and host tool package definitions.main
branch) should not be getting these "bleeding-edge" update releases. To address that, multiple package release channels (e.g. stable, candidate, beta, edge) should be available to which developers can subscribe as they need.main
branch.zephyr-crosstool
was 10.1.1.0 andzephyr-qemu
was 5.1.1.0, the "Zephry SDK bundle for Zephyr v2.7" will contain the aforementioned versions of the SDK components.HINTS
to the CMakefind_package
command (basically same idea asZEPHYR_SDK_INSTALL_DIR
now).Concerns and FAQ
find_package
command.find_package
commandHINTS
option.Alternatives
The text was updated successfully, but these errors were encountered: