Replace nerves_toolchain_ctng dependency with template-based code embedding#148
Replace nerves_toolchain_ctng dependency with template-based code embedding#148
Conversation
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.
@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.
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
fdc2ffe to
e5be2d5
Compare
- 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>
- 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>
…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>
d0f7193 to
6f05c2f
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.