Skip to content

Relative local package paths added through symlinks are not preserved #4636

@rashidrafeek

Description

@rashidrafeek

When developing the same Project.toml on multiple devices with git, I may add a local package through a symbolic link located in the project root. If I add the package using that relative symlinked path, Pkg rewrites it as a relative path from the project root, but with the symlink resolved.

This breaks portability across devices. The symlink itself may exist on all devices, but point to different absolute locations. Preserving the symlinked relative path would allow the project to work across devices, whereas resolving it makes the recorded path device-specific.

Suppose packages/MyPkg is a symlink in the project root. I run Pkg.add(path="packages/MyPkg"), but Pkg stores a path corresponding to the symlink target instead of preserving packages/MyPkg. On another machine, packages/MyPkg exists but points somewhere else, so the stored path no longer works.

Previously, local package paths were not stored in Project.toml, so this issue did not arise. Now that they are stored there, making changes on one device can modify the local package path in Project.toml, which may not be valid on another device.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions