Skip to content

.tool-env generation - #128

Open
hagl wants to merge 1 commit into
mirrexagon:masterfrom
hagl:master
Open

.tool-env generation #128
hagl wants to merge 1 commit into
mirrexagon:masterfrom
hagl:master

Conversation

@hagl

@hagl hagl commented Jul 2, 2026

Copy link
Copy Markdown

The code that generates .tool-env fails to insert line separators between the individual export statements.

On my machine the generated file looks as follows and the OPENOCD_SCRIPTS value gets the export of the next var appended.

export OPENOCD_SCRIPTS=/nix/store/...-idf-v5.5.2/openocd-esp32/share/openocd/scriptsexport ESP_ROM_ELF_DIR=/nix/store/...-esp-rom-elfs-esp-idf-v5.5.2/

Fixes #127

@mornepousse

Copy link
Copy Markdown

Confirmed this fixes #127, tested on x86_64-linux with esp-idf-full.

Root cause is visible in the generated file: wc -l on .tool-env returns 0,
i.e. every export ends up concatenated on a single unterminated line, which
is why the last path picks up the next statement's export.

Before:

$ echo $OPENOCD_SCRIPTS
/nix/store/...-openocd-esp32-esp-idf-v5.5.2/openocd-esp32/share/openocd/scriptsexport
$ [ -d "$OPENOCD_SCRIPTS" ] && echo OUI || echo NON
NON

With this PR applied:

$ echo $OPENOCD_SCRIPTS
/nix/store/...-openocd-esp32-esp-idf-v5.5.2/openocd-esp32/share/openocd/scripts
$ ls "$OPENOCD_SCRIPTS/board" | grep -c '\.cfg$'
442

So openocd board configs such as esp32s3-builtin.cfg are reachable again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OPENOCD_SCRIPTS env var is set to the wrong value

2 participants