-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add devcontainer #148
Comments
- Installs python, git, gdb for dev environment - Python venv created in /tools/venv (in container, not on local machine) with build requirements pre-installed. - vcpkg cloned and setup in /tools/vcpkg. Note the FIXME on VCPKG_FORCE_SYSTEM_BINARIES added to get working on MacOS running a Linux container, as it may need to be made conditional on platform. - PYTHONPATH and PATH setup so integrated terminal works. - First draft of developer guide README.md. - devcontainer.json has cmake and python settings as in Dockerfile
- When running a Linux container on MacOS, the mpg123 library fails with REAL_IS_FIXED, which I think means that this distro/arch combination fails to infer it automatically. As a workaround I explicitly set HAVE_FPU. If this is OK, I can remove the FIXME comment, but it's there for now for discussion in PR.
- Contains various python and C++ debug scenarios. - Copy to .vscode/launch.json to use in development. - See .devcontainer/README.md for full information.
Good idea. I also encountered a problem debugging on MacOs because using the debugger requires the binary to be signed with the correct entitlements (who knows why debug builds are not automatically constructed in this way). It might well be worth having several containers defined in the project directory to help people test/debug on the different platforms. Cross compiling is something that we might eventually need to support in the build system, such as building for Raspberry Pi and other embedded platforms. I don't know how to do this at the moment, but things like this will definitely help. |
- These flags are automatically set via `CMakePresets.json`.
- Added notes on the need to wait while CMake is configuring. This needs to finish for tests to be available.
- It seems that without setting ENV, that vcpkg does not always pick up this variable and setup can fail. Committing here to test on a fresh clone.
- Replace FIXME with clearer comment. So far this setting is only required when building containerized on MacOS, presumably because mgp123 wants specific instructions for cross-compilation or embedded work. Here it is fine to set this, as the Linux-on-MacOS target platform will definitely have an FPU.
Having recently joining the project, I set up my development environment and hit some issues on MacOS. I switched to Linux and then found a few dependencies and paths had to be set. I have captured this info in a
Dockerfile
anddevcontainer.json
which detail the tools anyone will need to spin up a containerised VSCode dev environment. This includes an examplelaunch.json
for debugging C++ and python tests (and additionally debugging C++ launched from python). After getting the Linux dev environment working, I had to make a few more to get it working on MacOS too.This ticket is for tracking my changes for consideration for a PR if it's something you would like to make available to other developers.
(A nice side-effect of these changes is they allow you to run the IDE online through a GitHub codespace too, which can be a very helpful tool for teaching and demonstration)
The text was updated successfully, but these errors were encountered: