Case-only differences in type names make generated files overwrite each other on case-insensitive filesystems
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- build-system
Research direction
Start by tracing nnvg's output path generation and write flow; the issue points to no specific source file or test. Check how generated paths are represented across target languages, then add coverage for case-only path collisions and verify generation fails before writing either file on a case-insensitive comparison. Done means the collision is rejected consistently on every filesystem and existing non-colliding outputs still work.
Written by the indexing model from the issue text.
Description
Summary
Two DSDL types whose full names differ only in letter case, e.g. ns.Foo.1.0 and ns.foo.1.0, generate output files whose paths differ only in case (Foo_1_0.h, foo_1_0.h). On a case-insensitive filesystem, the default on macOS and Windows, one file silently overwrites the other. nnvg exits 0, and one type's generated code is lost. This affects every target language.
Reproduce
On main at ed853f9, in ghcr.io/opencyphal/toxic:tx26.4.1:
mkdir -p d/ns
printf 'uint8 a\n@sealed\n' > d/ns/Foo.1.0.dsdl
printf 'uint16 b\n@sealed\n' > d/ns/foo.1.0.dsdl # needs a case-sensitive filesystem for the sources
nnvg --target-language=c --outdir out d/ns # exits 0
- Output on a case-sensitive filesystem (Linux):
out/ns/Foo_1_0.handout/ns/foo_1_0.h. Python likewise producesFoo_1_0.pyandfoo_1_0.py. - Output on a case-insensitive filesystem (
--outdiron a macOS volume): onlyout/ns/Foo_1_0.hexists, and it containsuint16_t b, which isfoo's field.Foo's header was overwritten without any error.
Why it isn't caught
pydsdl rejects names that differ only in case, but only while resolving a reference to a type (DataTypeNameCollisionError in _data_type_builder.py). Two target types that don't refer to each other are never compared. Nunavut doesn't check its own output paths either.
Proposal
Before writing anything, refuse generation when two files the run would write have paths that are equal when compared case-insensitively. Check on every filesystem, so the result doesn't depend on where nnvg runs. This applies to all target languages, and changes C and C++ behavior: they refuse instead of silently overwriting.
Context
This comes from the design for #403 (decision D4). There, case-only collisions among the merged members of a Python namespace file are refused and can't be overridden with --force. Detecting them within a single run, for every language, was split out into this issue because it changes C and C++ behavior.
- Dominant language
- Python
- Stars
- 48
- Forks
- 26
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 9
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenCyphal/nunavut
-
build and test dependencies
Difficulty 4/5 3-5 days Newbie friendliness 55/100
OpenCyphal/nunavut#419 ·
Maintainers usually reply within 1 day
-
build and test C++ dependencies
Difficulty 4/5 3-5 days Newbie friendliness 50/100
OpenCyphal/nunavut#418 ·
Maintainers usually reply within 1 day
-
build and test Python
Difficulty 4/5 3-5 days Newbie friendliness 45/100
OpenCyphal/nunavut#416 ·
Maintainers usually reply within 1 day
-
feature under consideration
Difficulty 5/5 Over a week Newbie friendliness 32/100
OpenCyphal/nunavut#413 ·
Maintainers usually reply within 1 day
-
Python
Difficulty 4/5 3-5 days Newbie friendliness 45/100
OpenCyphal/nunavut#412 ·
Maintainers usually reply within 1 day
All issues in OpenCyphal/nunavut
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
py-econometrics/pyfixest#2072 ·
Maintainers usually reply within 1 day
-
~planning docs
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Kromatic-Innovation/athenaeum#3084 ·
Maintainers usually reply within 1 day
-
Bosch Room Thermostat II number entities offer -500 to 3000 °C setpoint limits and a -32768 to 32767 °C outdoor temperaturePossibly taken @zigpy-review-bot claimed this today. Openbot: code audit
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
zigpy/zha-device-handlers#5769 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 Half a day Newbie friendliness 80/100
R0Y00/Xbox2Windows#254 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Kludex/python-multipart#375 ·
Maintainers usually reply within 1 day