Skip to content

metpo.Makefile: sheets-config warning log writes an untracked file into src/templates/ on every make #547

Description

@turbomam

Follow-up to a review comment on #544 (#544 (comment)), deferred so #544 can merge.

PR #544 redirects the sheets_config.py stderr to a log instead of /dev/null for debuggability:

SHEETS_CONFIG_WARN_LOG := ../templates/sheets_config_warnings.log
$(shell : > $(SHEETS_CONFIG_WARN_LOG))
...
SRC_URL_MAIN_FROM_YAML := $(shell python3 ../../metpo/sheets_config.py classes 2>>$(SHEETS_CONFIG_WARN_LOG))

Two issues to revisit:

  1. Location. src/templates/sheets_config_warnings.log is not gitignored, and src/templates/ is tracked (holds the committed TSVs). Every make invocation leaves an untracked file there, so working trees read as dirty. src/ontology/tmp/ is already gitignored and is the repo's scratch dir; the log belongs there (and the recipe should ensure the dir exists).

  2. Write-on-parse side effect. $(shell : > ...) runs at Makefile parse time on every invocation, including make clean, host-only targets, and make -n. It also truncates the log each parse, so warnings from a real failing run get wiped by the next harmless make, which undercuts the debuggability goal. Consider writing the log only when a recipe runs, or keeping stderr visible without a file.

No CI impact: artifact-freshness.yml diffs only the ontology artifacts, and no workflow uses git status --porcelain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions