esp-rs / espflash

Serial flasher utility for Espressif SoCs and modules based on esptool.py
Apache License 2.0
455 stars 110 forks source link

RFC: Rework configuration methods #507

Closed SergioGasquez closed 5 months ago

SergioGasquez commented 7 months ago

At the moment we have several ways of configuring esplfash/cargo-espflash behavior:

The idea would be to simplify and integrate most of this configuration options into a single one.

Related issues: https://github.com/esp-rs/espflash/issues/504, https://github.com/esp-rs/espflash/issues/469

SergioGasquez commented 7 months ago

I'll list some pros and cons about each method:

bjoernQ commented 7 months ago

I never used package metadata (since I never use cargo-espflash) or global config file (didn't knew that exists) but I use env variables for a few things a lot!

e.g. my use-case is I have a few boards attaches, have a terminal open for working with each of them and set ESPFLASH_PORT the right way in each terminal

I don't think we should use env vars as a general config mechanism but for the things we currently support we should definitely keep them. e.g. I have seen people committing their working baud rate (or even serial port) to .cargo/config.toml runner ... makes not too much sense since it depends on your setup what works and what not

In general, those two env vars are also not really config but an alternative way to specify something which is usually given as a command line parameter (we even use a clap feature for that)

TL;DR I don't care much about any config files since I don't use them but please, please, please keep the env vars

kevin-june commented 7 months ago

I use package metata useful in my daily development workflow, specifically the partition_table option. I can envision some projects might use the bootloader option to reference a precompiled bootloader, but I don't do tha tmyself.

While I don't currently use environment variables, I can see how they could be quite convenient.

SergioGasquez commented 6 months ago

Relevant link: configuration file of esptool