Giter Site home page Giter Site logo

Comments (4)

fhunleth avatar fhunleth commented on June 9, 2024 1

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.

fhunleth avatar fhunleth commented on June 9, 2024

We already support injecting cross compilation environment variables via the Nerves system. How is this different?

from nerves.

jjcarstens avatar jjcarstens commented on June 9, 2024

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.

jjcarstens avatar jjcarstens commented on June 9, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.