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

Dev Containerの設定 init.sh #9917

Closed
Neko7sora opened this issue Feb 13, 2023 · 7 comments · Fixed by #9921
Closed

Dev Containerの設定 init.sh #9917

Neko7sora opened this issue Feb 13, 2023 · 7 comments · Fixed by #9921
Labels
⚠️bug? This might be a bug

Comments

@Neko7sora
Copy link
Contributor

Neko7sora commented Feb 13, 2023

💡 Summary

image

#9872

🥰 Expected Behavior

以下のコマンドが正常にgitが処理される

$ git config --global --add safe.directory /workspaces/${localWorkspaceFolderBasename}

🤬 Actual Behavior

node ➜ /workspaces/misskey $ git submodule update --init
fatal: detected dubious ownership in repository at '/workspaces/misskey'
To add an exception for this directory, call:

        git config --global --add safe.directory /workspaces/misskey

📝 Steps to Reproduce

  1. Dev Containerで開く

📌 Environment

commit: develop 8d4c5de
Your OS: Windows 11
docker: 4.16.2 (95914)
docker内のgit: 2.39.1

@Neko7sora Neko7sora added the ⚠️bug? This might be a bug label Feb 13, 2023
@Ry0taK
Copy link
Contributor

Ry0taK commented Feb 13, 2023

おそらくなのですが、Git for WindowsでCloneするとこうなるような雰囲気がありそうでした。WSL内でCloneしてVSCodeで開くとどういった挙動になるかご確認頂けますか...?

@Neko7sora
Copy link
Contributor Author

WSL内でCloneしてVSCodeで開くとどういった挙動になるかご確認頂けますか...?

image

同じ挙動になります。

@Ry0taK
Copy link
Contributor

Ry0taK commented Feb 13, 2023

なるほど、ありがとうございます。もう一点確認なのですが、WSL内のClone先はWindows上のディレクトリ (/mnt/配下)のものでしょうか?

@Neko7sora
Copy link
Contributor Author

WSL内のClone先はWindows上のディレクトリ (/mnt/配下)のものです。

@Ry0taK
Copy link
Contributor

Ry0taK commented Feb 13, 2023

承知いたしました。その場合、WSL内のホームディレクトリ (/home/配下)で再度Cloneして頂いたあとにVSCodeで開くと動作するかどうかをご確認いただけますでしょうか...?

@Neko7sora
Copy link
Contributor Author

Neko7sora commented Feb 13, 2023

承知いたしました。その場合、WSL内のホームディレクトリ (/home/配下)で再度Cloneして頂いたあとにVSCodeで開くと動作するかどうかをご確認いただけますでしょうか...?

init.shが自動実行時にエラーが発生し、Dev Containerに再接続して、bashでgit submodule update --initコマンド入力しても、同じエラーが発生します。
image

BTW, init.shset -xe からbashを打つと、
image

@Ry0taK
Copy link
Contributor

Ry0taK commented Feb 13, 2023

調査した結果、以下のような問題を修正する必要がありそう

  1. Git for WindowsでクローンしたリポジトリをDev Container内で開き直すと改行コードの違いによりシェルスクリプトの実行に失敗する -> CONTRIBUTING.mdにその旨を追記しておく
  2. 特定のケースにおいてファイルの権限がめちゃくちゃになるので起動時にファイルの所有者を修正する

(後でプルリク作って送ります)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚠️bug? This might be a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants