Skip to content

Resolve symbolic links when loading develop.watch.path#661

Merged
jhrotko merged 1 commit intocompose-spec:mainfrom
jhrotko:fix-compose-watch-symbolic-links
Jul 11, 2024
Merged

Resolve symbolic links when loading develop.watch.path#661
jhrotko merged 1 commit intocompose-spec:mainfrom
jhrotko:fix-compose-watch-symbolic-links

Conversation

@jhrotko
Copy link
Copy Markdown
Collaborator

@jhrotko jhrotko commented Jul 10, 2024

Resolve symbolic links in develop.watch.path when loading the project

fixes: docker/compose#11849

@jhrotko jhrotko self-assigned this Jul 10, 2024
@jhrotko jhrotko force-pushed the fix-compose-watch-symbolic-links branch from 670ded9 to 90ae054 Compare July 10, 2024 13:58
@jhrotko jhrotko marked this pull request as ready for review July 10, 2024 13:59
@jhrotko jhrotko requested a review from ndeloof as a code owner July 10, 2024 13:59
@jhrotko jhrotko requested a review from glours July 10, 2024 13:59
@jhrotko jhrotko force-pushed the fix-compose-watch-symbolic-links branch from 90ae054 to b591ed7 Compare July 10, 2024 13:59
@ndeloof
Copy link
Copy Markdown
Collaborator

ndeloof commented Jul 10, 2024

Can't we just rely on https://pkg.go.dev/path/filepath#EvalSymlinks here ?

I also wonder we should do this for all path made absolute, not just watch where this had some side effect, wdyt?

@jhrotko
Copy link
Copy Markdown
Collaborator Author

jhrotko commented Jul 10, 2024

Can't we just rely on https://pkg.go.dev/path/filepath#EvalSymlinks here ?

@ndeloof, the thing is, the directory is a symbolic link and not the file itself. I tried using EvalSymlinks but it was not enough for this case.

I also wonder we should do this for all path made absolute, not just watch where this had some side effect, wdyt?

I was not sure myself. I think the advantage of adding this change here, you do not need to deal with any transformations going further to compose to any watch code flow path. I can see both solutions working fine in this case

@ndeloof
Copy link
Copy Markdown
Collaborator

ndeloof commented Jul 10, 2024

related : golang/go#42201
"No change in consensus, so declined."
Such a pleasure to see golang evolution

Signed-off-by: Joana Hrotko <joana.hrotko@docker.com>
@jhrotko jhrotko force-pushed the fix-compose-watch-symbolic-links branch from b591ed7 to 3eb1d09 Compare July 10, 2024 14:27
@jhrotko jhrotko merged commit 769147e into compose-spec:main Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] docker compose watch does not reflect changes when project directory is a symbolic link

2 participants