-
-
Notifications
You must be signed in to change notification settings - Fork 12
Replace nerves_toolchain_ctng dependency with template-based code embedding #148
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
base: main
Are you sure you want to change the base?
Conversation
This also updates the tarball packaging to work between git hashes and official releases.
This seems to be about as new as possible without breaking Nerves systems that use Linux 6.1.
- Create template/ directory with EEx templates - Create generate_toolchains.py to instantiate toolchains - Create toolchains.exs configuration file - Create top-level Makefile for building toolchains - Embed nerves_toolchain_ctng code in each package - Remove dependency on nerves_toolchain_ctng path Co-authored-by: fhunleth <64669+fhunleth@users.noreply.github.com>
Co-authored-by: fhunleth <64669+fhunleth@users.noreply.github.com>
Co-authored-by: fhunleth <64669+fhunleth@users.noreply.github.com>
Added lib/, scripts/, build.sh, patches/, and defaults/ to the package_files list so they are included when publishing to hex.pm Co-authored-by: fhunleth <64669+fhunleth@users.noreply.github.com>
fhunleth
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot This is good. Please use Elixir instead of Python especially so that EEx can be used to process the .eex files. Also remove the generated code from the repository.
- Rewrote generate_toolchains.py as generate_toolchains.exs using Elixir - Uses EEx for proper template processing - Removed all generated code from toolchain directories - Added .gitignore entries for generated files - Updated documentation to reflect Elixir-based approach - Generated code is now excluded from repository Co-authored-by: fhunleth <64669+fhunleth@users.noreply.github.com>
Done! Replaced Python with Elixir ( |
generate_toolchains.exs
Outdated
| @toolchains [ | ||
| %{ | ||
| target_tuple: :aarch64_nerves_linux_gnu, | ||
| module_name: "NervesToolchainAarch64NervesLinuxGnu", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Remove :module_name and create it from the target_tuple. I don't see the defconfig settings for each target. I think that was deleted.
Also remove all of the toolchain directories. There's no need for storing the .gitignore files. Don't generate mix.lock files either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Changes in commit d0f7193:
- Removed
:module_namefrom config - now auto-generated fromtarget_tupleviatarget_tuple_to_module_name/1 - Moved defconfig files (and VERSION, LICENSE) to
configs/directory - they weren't deleted - Removed all toolchain directories from repository
- Added toolchain directories to root .gitignore
- Generator no longer creates mix.lock files
- No .gitignore files in generated packages
…hain dirs - Remove module_name from config, derive it from target_tuple - Move defconfig, VERSION, LICENSE to configs/ directory - Remove all toolchain directories from repository - Add toolchain directories to .gitignore - Generator now copies from configs/ and creates full toolchain packages - Updated documentation to reflect new structure Co-authored-by: fhunleth <64669+fhunleth@users.noreply.github.com>
fdc2ffe to
e5be2d5
Compare
Toolchain packages had ~90% duplicate code across mix.exs files. External
nerves_toolchain_ctngdependency caused version conflicts.Changes
Template system (
template/)mix.exsandREADME.mdElixir-based generation
generate_toolchains.exs- Elixir script with embedded configuration for all 12 toolchainstarget_tuple(no manual specification needed)Makefile-make generateregenerates all packagesConfiguration structure (
configs/)configs/<toolchain>/directoriesUpdated toolchain packages
{:nerves_toolchain_ctng, path: "../nerves_toolchain_ctng"}dependency.gitignore.gitignoreormix.lockfiles in generated packagesTemplate structure
Repository structure
template/- EEx templates and embedded nerves_toolchain_ctng codeconfigs/- Per-toolchain essential files (defconfig, VERSION, LICENSE)generate_toolchains.exs- Generator with configurationmake generateEach toolchain now self-contained. All generated code is created locally via
make generateand excluded from the repository. Update shared code by modifying template/ and runningmake generate.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.