Skip to content

Record what stb_image_write.h is and where it came from - #192

Open
HugoFara wants to merge 1 commit into
devfrom
build/vendor-stb-image-write
Open

Record what stb_image_write.h is and where it came from#192
HugoFara wants to merge 1 commit into
devfrom
build/vendor-stb-image-write

Conversation

@HugoFara

Copy link
Copy Markdown
Collaborator

ForeFire publishes wheels to PyPI declaring license = "GPL-3.0-or-later" with license-files = ["LICENSE"]. Every one of those wheels also contains 1,724 lines of nothings/stb, which is not under that licence and is not named in LICENSE, the README, the paper, CITATION.cff, or anywhere else outside the file itself.

Nothing is being violated. stb is dual MIT / public domain, both compatible with GPL-3.0, and its notice travels inside the header. The cost is that we cannot answer questions we will be asked. Which version do you carry? Is upstream's fix for X in it? What third-party code ships in this wheel, under what terms? Each needs someone to already know that one file in src/ is not ours, then diff 1,724 lines against a guess.

The everyday version of the same problem: patch the file to fix something and the next update silently reverts the patch, because nothing records that it is vendored.

What changed

src/stb_image_write.h moves to third_party/, beside doctest, with its version, upstream URL and licence in that directory's README — so all three questions have one place to be answered. The README also notes that Command.cpp is the only place that may define STB_IMAGE_WRITE_IMPLEMENTATION, since the header compiles its implementation wherever that macro appears and a second one is a duplicate-symbol link error rather than anything self-explanatory.

third_party/ is now on forefireL's include path as well as the test target's, in both cases as a SYSTEM include so -Wall -Wextra stops at code we maintain.

Verification

Unit suite 4/4, runff KML and NetCDF both match within tolerance. Nothing in the test suite reaches the PNG path, so plot[parameter=altitude;cmap=turbo] was run by hand — still a valid 200×200 PNG, stbi_write_png still linked into libforefireL.

src/colormap.h is not moved. It is generated by tools/, not vendored, so third_party/ would mislabel it, and where generated sources belong is a layout call for you.

Contributes to #161.


This pull request, including its code changes and this description, was generated by Claude Opus 5, and reviewed manually before submitting.

1724 lines of public-domain code from nothings/stb sat in src/ among our
own, with nothing recording its version, its upstream, or its licence.
Patch it and the next update silently reverts the patch.

It now sits beside doctest, with all three recorded in the README, and a
note that Command.cpp is the only place that may define
STB_IMAGE_WRITE_IMPLEMENTATION.

third_party/ is now on forefireL's include path as well as the test
target's, in both cases as a SYSTEM include, so -Wall -Wextra stops at
code we maintain. PRIVATE on forefireL, since Command.cpp is the only
consumer.

Contributes to #161, which is where the file came to notice: 24 of its
428 warning lines were this one header.

@antonio-leblanc antonio-leblanc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Pure relocation, no code inside the header touched.
Checked that Command.cpp's #include "stb_image_write.h" still resolves through the new third_party include path, and that it's still the only TU defining STB_IMAGE_WRITE_IMPLEMENTATION. SYSTEM on both targets is the right call to keep -Wall/-Wextra off vendored code

Safe to merge.

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.

2 participants