fix(docker): copy stb submodule into dev image to fix Python bindings#341
fix(docker): copy stb submodule into dev image to fix Python bindings#341Geff115 wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (1)Dockerfile*⚙️ CodeRabbit configuration file
Files:
🔇 Additional comments (1)
Release Notes
Contribution Summary
WalkthroughThe Docker development image is updated to include the ChangesDocker Build Context
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 7 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (7 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
|
Hi. Please will you explain more about the problem you faced here. STB was intentionally not included in the image because of the type of library it is (a header-only C++ library). Dawn, however, was included and built into the image because it takes about 30-45 minutes on a normal computer (the image and repository take long enough to get locally). If you weren't able to use STB, I'd like to first verify that it wasn't an accident that occurred when setting up your environment (maybe due to outdated documentation). The Docker container mounts to the project’s directory, so it should've just worked without any problems |
|
Hi @Ryan-Millard, thank you for the clarification! You're right! It was a submodule initialization issue. When I cloned the repo, I didn't initialize the submodules, so So rather than a Dockerfile change, the fix should be a documentation update, adding a note to the setup/contributing docs to remind contributors to initialize submodules after cloning. Would you like me to update the PR to reflect that instead? |
Sure, I'd love that. Thank you so much. I'd prefer it if you'd rather open up another PR, though. Closing this one adds traceability and makes things clean and easy to look back at in the future (for example, cross-referencing this PR in a future conversation). I'm going to close this PR since it doesn't fix a problem in the repository. Please will you reference it when you make the new one. Have a great evening further!🦔🦔🦔 |
|
@coderabbitai, please create an issue for this. Look at the conversation and see that the problem related to this PR was a documentation issue and that it needs to be fixed. Please make sure to link it when the new PR is created to fix the documentation on the Setup & Dependencies ( Additionally, I noticed that I didn't update all the admonitions with Docusaurus's latest version and it looks like they are now broken on all of the pages (specifically when the admonition has a title). Please create a separate issue for this and do not reference this PR in that issue. You may reference the PR that updates the Docusaurus version (#327) and the Setup & Dependencies page as an example of the problem (specifically the "Docker Dev Environment" admonition on line 25). |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 106
Have a great evening! 🦔 |
Summary
The dev Docker image was missing the
stbsubmodule, causing the Pythonbindings build to fail with:
fatal error: stb/stb_image.h: No such file or directory
This meant that running
uv sync --no-build-isolationinside the containerwould always error out, blocking any contributor from setting up the Python
bindings locally.
Root Cause
Dockerfile.devcopiedthird_party/dawninto the image, but never copiedthird_party/stb. Since the Python bindings built via CMake depend on STBfor image loading, the build failed at compile time.
Note: Running
git submodule update --init --recursiveis not a viableworkaround because Dawn's nested sub-submodules include a Google-internal
repository (
chrome-internal.googlesource.com) that requires specialcredentials inaccessible to external contributors.
Fix
Added
COPY third_party/stb third_party/stbtoDockerfile.dev, alongsidethe existing Dawn copy. Contributors must have the
stbsubmodule initializedon their host machine before building the image:
git submodule update --init third_party/stb
Testing
Verified the full setup sequence inside the container succeeds:
uv venv
uv pip install scikit_build_core numpy
uv sync --no-build-isolation
uv run python3 -c "import img2num;"
All steps completed without errors.
Related
Raised by @Ryan-Millard in issue #332 thread. This should close the #340 issue created by @coderabbitai in the thread.