Add Local.mk optional override include for build paths - #5
Add Local.mk optional override include for build paths#5DrMattChristian wants to merge 20 commits into
Conversation
Updated the link for LT Open Source instructional videos.
Fix README.md formatting
added LT_FLASH=all instruction
fixing spelling mistake
Fix dependency handling and propagate quiet mode in LT builds
The bullet "Don's advice is another option" is unclear to readers (no context on who Don is) and makes the list less neutral. Consider rephrasing the line to describe the link directly. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…g-and-setup Improve README with spelling fixes and setup instructions
|
The LT_VENDOR_TOOLCHAINS_DIR is where the extracted toolchains go. Basically we wanted to include toolchains for the supported platforms, but the vendor distributions were huge so we took the vendor distributions and stripped out all but the gnu tools needed and tarred those up. The Makefile looks for the tools in LT_VENDOR_TOOLCHAINS_DIR and if it doesn't find it, extracts them there from the tarballs. Extracting the toolchains into the LT_VENDOR_TOOLCHAINS_DIR in the user's home directory is suboptimal, but putting it under the os root is not a good solution. Great care was taken to put all build artifacts outside of anything that got checked into git. Putting the LT_TARGETS_DIR at the same level of the repo is also suboptimal but outside the repo. We considered putting LT_VENDOR_TOOLCHAINS_DIR inside of LT_TARGETS_DIR, but decided we liked the simplicity of "make cleanall" (rm -rf ${LT_TARGETS_DIR}). Where we landed was to leave things as-is, with the ability to override LT_VENDOR_TOOLCHAINS_DIR and LT_TARGETS_DIR in your environment. |
|
Thank you for your comprehensive review and comments @RokuDon . I guessed that there were good reasons for these directory placement decisions, but the rationale wasn't exactly clear to me. I couldn't figure it out on my own, at least without full (Roku internal) git repo history/logs. Therefore it sounds like the way forward to avoid polluting $HOME is to keep a local Makefile with uncommitted changes which overrides these LT_VENDOR_TOOLCHAINS_DIR and LT_TARGETS_DIR variables. Perhaps another way would be to optionally include a local Makefile variables file that can override while keeping the Roku-as-designed Makefile intact. I'll think about it. This PR can remain in DRAFT status (WIP, not ready) until a different/better solution can be attempted. Likely I'll totally re-work my approach. |
|
You could edit your .bashrc file to export LT_VENDOR_TOOLCHAINS_DIR and LT_TARGETS_DIR to whatever you want. Or modify or make your own build-setup.sh file to do same. |
Replace the rejected directory-move changes with a minimal Local.mk include that lets users override build variables without modifying environment variables. Changes added on a clean branch: - Add -include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))Local.mk after root derivations but before overridable defaults - Add lt/lt/build/Local.mk to .gitignore - Update LT_TARGET_ROOT doc comment to mention Local.mk override Rationale per upstream design discussion: - Build artifacts must stay outside git (unchanged) - Toolchains must survive make cleanall (unchanged) - Env vars remain the primary override mechanism - Local.mk is a discoverable alternative for scoped overrides - No existing developer workflow is affected
65b0dc6 to
e6953bd
Compare
That's correct, and understood about modifying the shell scripts and setting shell environment variables. I'm looking at the directory customization via the Make configuration as well, with suggested plans forthcoming and in the works. |
|
This PR and change set has been entirely rewritten from scratch. Refer to the updated title, description and very minimal changes. If Roku isn't interested in merging these updated changes then I understand why now. There are alternative workarounds, including me keeping/stashing my own uncommitted changes. |
7d9d385 to
dcbd4a4
Compare
Summary
Replace the previous approach (changing default directory locations) with a minimal
Local.mkinclude that lets users override build variables without modifying environment variables or shell config.Changes
-includeofLocal.mkfrom the build directory (after root derivations, before overridable defaults).gitignoreentry forlt/lt/build/Local.mkLT_TARGET_ROOTto mentionLocal.mkoverrideWhy not just env vars?
Environment variables remain the primary override mechanism (nothing changes for existing users).
Local.mkis an additional option for:Local.mkmentioned in comments and know they can create itUsage
Create
lt/lt/build/Local.mkwith any Makefile variable assignments:The file is gitignored and silently skipped when absent.