Record what stb_image_write.h is and where it came from - #192
Open
HugoFara wants to merge 1 commit into
Open
Conversation
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
approved these changes
Aug 14, 2026
antonio-leblanc
left a comment
Collaborator
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ForeFire publishes wheels to PyPI declaring
license = "GPL-3.0-or-later"withlicense-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 inLICENSE, 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.hmoves tothird_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 thatCommand.cppis the only place that may defineSTB_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 onforefireL's include path as well as the test target's, in both cases as aSYSTEMinclude so-Wall -Wextrastops at code we maintain.Verification
Unit suite 4/4,
runffKML and NetCDF both match within tolerance. Nothing in the test suite reaches the PNG path, soplot[parameter=altitude;cmap=turbo]was run by hand — still a valid 200×200 PNG,stbi_write_pngstill linked intolibforefireL.src/colormap.his not moved. It is generated bytools/, not vendored, sothird_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.