Comments (4)
That's really not a good workaround, and I'd recommend against using it. The Nerves system environment variables we expose that should be used are in the docs. Trying to derive values from NERVES_TARGET_TRIPLE
can easily lead to wrong choices. You can see this in the Raspberry Pi Zero's TARGET_*
settings. See https://github.com/nerves-project/nerves_system_rpi0/blob/main/mix.exs#L56-L61. For the Pi Zero, it's important to set the CPU to arm1176jzf_s
, but that information isn't in the target triple.
Rustler Precompiled does the right thing.
I don't support adding this option. If the TARGET_*
environment variables are missing some information, then we should add them there since that's the only sane place for maintaining how to crosscompile. However, since Rustler Precompiled works, I don't think it's needed for this.
from nerves.
We already support injecting cross compilation environment variables via the Nerves system. How is this different?
from nerves.
I think that helps for the case where you have control of the system and have system specific env vars to shove in at the global level. But I don't think that aids users of the systems in being able to inject more (correct me if I'm wrong)
I'm more thinking of the situation where a user might need to set an env var, but it's dependent on what tooling and systems are currently in use (which nerves sets). This article on using rustler with Nerves is what is really driving this idea. They are trying to read Nerves vars in the Mix project in order to set some vars which reference the current system in user before their app starts to compile.
But the way our tooling is setup, that article above only works if it is in a mix project of a dependency but not your root mix project, which is totally inconsistent behavior.
The workaround right now is you have to alias one of the nerves tasks to add a step to put your env stuff in while having access to the Nerves env
aliases: ["nerves.loadpaths": ["nerves.loadpaths", &make_rust_env/1]]
Or we potentially add some callback that can get called after we've set Nerves env vars and let others add more according to the target being compiled for
from nerves.
So I dug around the systems more and I think all the pieces are in there that they would need to create those env vars needed in a different way (like via a make file or env file or something)
But...I also think this option is an easy add for helping this niche situation
from nerves.
Related Issues (20)
- Add step-by-step network connection debugging script
- Add "Systems > Compatibility" documentation
- Pointers to troubleshoot freeze during rpi3 upload task? HOT 3
- Add mix task to display artifact name/information
- openssh-askpass hangs on Manjaro Linux HOT 3
- Maybe move shared bash scripts to Elixir?
- Google linked project web page routes to 404 HOT 1
- Fix JSON handling HOT 1
- Broken packages in Nix-shell file HOT 3
- firmware.patch should handle FAT resources delta updates
- minor issues with FAQ.md HOT 3
- Help Mod bus, TCP/IP HOT 1
- Hardcoded check for GNU Coreutils on MacOS HOT 3
- Elixir 1.15 / OTP 26 support
- `mix firmware` failure during squashfs HOT 9
- Provide more helpful script output with `mix firmware` task errors
- Contributing link in readme is broken
- Formatting in installation instructions are unclear HOT 1
- Failure entering the nerves.system.shell using erlang 26.0.2 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nerves.