kubernetes / git-sync

A sidecar app which clones a git repo and keeps it in sync with the upstream.
Apache License 2.0
2.13k stars 406 forks source link

Issue with PYTHONPATH Resolution in git-sync 4.0.0 #864

Closed vgutkovsk closed 3 months ago

vgutkovsk commented 4 months ago

When running a script that occasionally executes other scripts synchronized via git-sync, there's an issue with PYTHONPATH resolution in the latest version (4.0.0). Despite updating the symbolic link properly, the main script keeps triggering old files from the previous worktree. This problem doesn't occur with git-sync version 3.6.9, suggesting a potential regression. A comparison between the code for symbolic link creation reveals a change in mechanism: git-sync 4.0.0 now uses os.Symlink instead of the ln command. Although the symbolic links created by both versions appear identical, the issue persists. Assistance in debugging this matter would be greatly appreciated.

thockin commented 4 months ago

os.symlink and ln call the same syscalls. I doubt very much that this is the issue.

Could it be a case of something which has a CWD in the old worktree maybe?

Can you help. Me boil down a repro case?

vgutkovsk commented 3 months ago

Thanks @thockin for the suggestion, there was actually something in the synced directory with CWD, it was not very obvious so took me some time to find it. Closing the issue.