Fix macOS compatibility by making Docker group check Linux-specific #118
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.
Problem
The duckietown-shell package had a macOS compatibility issue in the
check_docker_environment()function. It unconditionally calledcheck_user_in_docker_group(), which uses the Unixgrpmodule to verify that the user is in the "docker" group.While this check is necessary on Linux (where Docker requires users to be in the docker group to avoid using sudo), it's problematic on macOS because:
Solution
This PR makes the docker group check platform-specific by adding a guard that only runs it on Linux:
Before:
After:
Changes
on_macos()helper function for consistency with existingon_linux()functionif on_linux():guardTesting
Impact
This fix ensures the duckietown-shell package works correctly on macOS while maintaining full backwards compatibility with existing Linux installations.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.