Skip to content
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

Feature request: Dump env vars: arduino-cli setenv --fqbn my:precious:board #77

Closed
marcond opened this issue Oct 25, 2018 · 3 comments
Closed
Labels
type: enhancement Proposed improvement

Comments

@marcond
Copy link

marcond commented Oct 25, 2018

I'm just testing arduino-cli and I think it's GREAT. It will simplify so many things.

When I went to test a bootloader I'm working on, I missed an option to output a proper set of environment vars for compilation, matching a given architecture. Something generating an output like this:

$ arduino-cli setenv --fqbn arduino:avr:uno
           -- or --
$ arduino-cli config dump --fqbn arduino:avr:uno
# Vars for arduino:avr:uno
# Generated by arduino-cli-0.3.1-alpha.preview
AVR_GCC_HOME=~/.arduino15/packages/arduino/tools/avr-gcc/5.4.0-atmel3.6.1-arduino2
export AVR_GCC_HOME
PATH=$AVR_GCC_HOME/bin:$PATH
export PATH
MCU=atmega328p
export MCU
F_CPU=16000000L
export F_CPU
INCLUDES=~/.arduino15/packages/arduino/hardware/avr/1.6.23/cores/arduino:~/.arduino15/packages/arduino/hardware/avr/1.6.23/variants/standard
export INCLUDES
# ....and so on....

So I could just arduino-cli setenv --fqbn arduino:avr:uno >myvars.sh and then . myvars.sh afterwards. VERY handy.

I could hack something around this, but I'm lacking free time for some weeks.

Thanks.

@cmaglie cmaglie added the type: enhancement Proposed improvement label Oct 25, 2018
@bxparks
Copy link

bxparks commented Oct 25, 2018

(Drive-by comment...)

I am not sure using environment variables is the best way to achieve this, because it would be too difficult to maintain and debug so many environment variables that might affect the behavior of the command line tools. However, a better place to capture this information might be a config file, say .cli-config.yml.

But you would probably want to capture multiple sets of such parameters. Then it looks like you are asking for something that is similar to the concept of "environments" in the platformio.ini files of PlatformIO.

@marcond
Copy link
Author

marcond commented Nov 5, 2018

Right now I'm looking into the board details feature (#45) just added. It seems that I can use that option to retrieve all the data I need, let's see!

The .cli-config.yml was tempting, however I felt that it might change over time and break things. So I would not like to sneak into cli-config to fetch parameters. Right now I'm testing some options on my own project. About the number of env vars, actually I was not thinking about "all" of them, just the important ones (line tools path, MCU, F_CPU and a few others).

I'm not familiar with environments from platformio, but I'll take a look.

@masci
Copy link
Contributor

masci commented Aug 16, 2019

Closing as board details seems to have fixed the issue.

@masci masci closed this as completed Aug 16, 2019
per1234 added a commit that referenced this issue Aug 9, 2021
Add checks for incorrect src subfolder name case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

4 participants