platformio / platformio/platformio-core

Provide a `${this.__name__}` variable (like `${this.__env__}` but valid in all sections)

Open
#4,531 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

config
Dominant language
Python
Stars
9.5k
Forks
905
Avg merge
2d 13h
Merged PRs (30d)
2

Description

What kind of issue is this?

  • Feature Request.

Configuration

PlatformIO Version (platformio --version): 6.1.6

Description of problem

As stated in https://github.com/platformio/platformio-core/issues/4480#issuecomment-1404253063, I am using ${this.__env__} to get the environment name in a non-environment section that will later be extended by an environment. This is being rejected as invalid (but it works) so I need the suggested ${this.__name__} to insert the name of the section/environment when the value is being evaluated.

[a]
test_testing_command =
	script.sh
	${platformio.build_dir}/${this.__name__}/test
	${platformio.build_dir}/${this.__name__}/program

[env:b]
extends = a

Where ${this.__name__} is expected to evaluate to b when the test_testing_command is used (this works with ${this.__env__} on 6.1.5).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the configuration variable evaluation path described in the issue and compare how ${this.__env__} is handled in environment and non-environment sections. Use the [a] and [env:b] example to verify that ${this.__name__} resolves to b when the extended test command is used; done means the variable is accepted and evaluates correctly without regressing existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.