Skip to content
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

build: Move git config ... add safe.directory to a script within .devcontainer #4836

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"install-python-deps": "task install-maturin",
// Disabling because of the issues in #3709
// "install-python-deps": "task install-maturin && task install-pre-commit && pre-commit install-hooks",
"install-npm-dependencies": "task install-npm-dependencies"
"install-npm-dependencies": "task install-npm-dependencies",
"other-post-create": "bash .devcontainer/post_create.sh"
}
}
9 changes: 9 additions & 0 deletions .devcontainer/post_create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#! /bin/sh
#
# Other postCreateCommands that should only run in the Dev Container environment
# Since these are called by the .devcontainer/devcontainer.json's `postCreateCommand`
# they won't affect people building the software natively

git config --global --add safe.directory /workspaces/prql
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I observed the need for the git config ... --add safe.directory ... command in three environments: macOS 12.7.5 on Intel, macOS 14.5 on M2, and Win 11. So there's something about the DevContainer that triggers/requires it. This PR works around it cleanly.

Any thoughts on why this is needed in this repository and not in others?
Have you reported this issue upstream?

In my opinion, this is a problem that should be resolved upstream, and doing something about it here is the wrong direction.


pip install pre-commit