-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add VS Code Dev Container Configuration #19597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Add a complete devcontainer environment for building and testing darktable, including Dockerfile with all dependencies, configuration, and documentation. Also update .gitignore to exclude AppDir for AppImage builds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a complete VS Code Dev Container configuration for darktable development, enabling contributors to start building immediately without manual environment setup. The configuration provides a fully-equipped Ubuntu 24.04-based container with all build dependencies, optimized VS Code settings, and comprehensive documentation.
Key Changes:
- Added containerized development environment with pre-installed build dependencies and tools
- Configured VS Code with C/C++ development extensions and appropriate settings
- Provided complete documentation covering build workflows, AppImage creation, and troubleshooting
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| .devcontainer/devcontainer.json | Configures the dev container with build context, VS Code extensions, and automatic git submodule initialization |
| .devcontainer/Dockerfile | Defines Ubuntu 24.04 base image with all required and optional darktable build dependencies |
| .devcontainer/README.md | Provides comprehensive documentation for building, testing, and troubleshooting in the dev container |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Sounds like a nice contribution. I'm not expert on this and so I'd like another dev using VS Code (yeah I'm an Emacs user) to test. |
|
I have some thoughts and questions First and foremost, do we have a position on AI generated code? I see pros and cons. It was used to generate a lot/most of the agx code and provided a new module that's very nice. On the con side, it took a lot of code cleanup to get it merged. If nothing else should it be declared/tagged so that we know what we are dealing with.
How long does it take to compile darktable in a container? On a windows VM with 4 cores it takes 30+ minutes for a full build.
The developers are currently on a lot of different systems using the tools they've come to know and love (even Emacs 😛 ). The varied environments allow bugs that only show up on one or two environments to be caught quickly. Building in a walled garden only ensures that you can build in a walled garden.
Currently the appimage is built from code tested on a variety of systems and we still run into bugs that are appimage specific. So, this may help drive out some of those bugs. However, appimage is another "walled garden" and doesn't guarantee that code that runs in the appimage is bug free when compiled and run on different operating systems/versions. I'm guessing that VS Code will do incremental compiling. I've been bitten many times by incremental compiles that work but fail when built from the top. Just a caution. Overall I think this could be a good thing and maybe bring some more developers into the mix, with the hope that we can finally get some windows developers. But, as I'm looking up at the CI runs I notice that it takes 5 or 6 minutes on Linux/MacOS and it's over an hour on Windows and still going |
|
@wpferguson Thank you for the detailed feedback! Let me address each point: AI-Generated CodeI want to be transparent: I used AI assistance (GitHub Copilot) during development, but with careful human oversight. The workflow was:
This wasn't a one-shot AI generation - it involved significant trial, error, and manual refinement. The AI helped me navigate the codebase faster as a new contributor, but all decisions and validation were human-driven. I'm happy to add a note in the PR if you have guidelines for AI-assisted contributions. Build Time in ContainerOn my machine (ThinkPad T14 Gen 1, AMD Ryzen 5 Pro 4650U, 40 GB RAM, SSD):
This is with all CPU cores available to Docker. Performance will vary based on:
Incremental builds are significantly faster, as VS Code/CMake Tools handle this well. "Walled Garden" Concerns - Valid Point!I completely agree that diverse development environments catch more bugs. This devcontainer is not intended to replace existing development workflows. It's an additional option for:
This is a supplementary tool, not a replacement for native builds on varied systems. Scope and LimitationsThe devcontainer is intentionally limited:
Windows developers would still need native Windows builds - this devcontainer doesn't help with Windows-specific development. Incremental Build ConcernsGood point! The documentation should emphasize clean builds when testing. I can add a note about this in the README. Editor SupportWhile this is VS Code-focused, devcontainers are actually editor-agnostic:
The CI Windows Build TimeRegarding the Windows CI taking over an hour: I believe this is unrelated to this PR. The only file modified outside The devcontainer files ( Suggestion: Re-trigger the Windows CI job to see if it's a transient issue. SummaryThis devcontainer is:
It's meant to lower the barrier to entry while preserving the value of testing on varied real-world systems. Existing developers can continue using their preferred native setups. Happy to make adjustments based on project preferences! Let me know if you'd like any changes to scope or documentation. |
Summary
This PR adds a complete VS Code Dev Container configuration for darktable development, making it easy for contributors to get started with a fully configured build environment.
What's Included
Dev Container Setup
Features
Developer Benefits
Usage
./build.sh --prefix /tmp/dt --build-type RelWithDebInfoScope
This devcontainer is focused on:
It does NOT include:
Testing
I have verified that this configuration successfully:
libcmocka-devinstallation)Documentation
Complete documentation is provided in
.devcontainer/README.mdcovering:Files Changed
Notes
vscode(UID 1000) for proper file permissionspostCreateCommandbuild/directoryThis configuration should make it significantly easier for new contributors to start working on darktable without spending time on environment setup.