compose-spec / compose-go

Reference library for parsing and loading Compose YAML files
https://compose-spec.io
Apache License 2.0
350 stars 109 forks source link

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

Closed jhrotko closed 2 months ago

jhrotko commented 2 months ago

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

fixes: https://github.com/docker/compose/issues/11849

ndeloof commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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