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

_symlinks attempts to create multiple symbolic links to .../include #1

Open
olaaaf opened this issue Aug 31, 2023 · 2 comments · May be fixed by #3
Open

_symlinks attempts to create multiple symbolic links to .../include #1

olaaaf opened this issue Aug 31, 2023 · 2 comments · May be fixed by #3

Comments

@olaaaf
Copy link

olaaaf commented Aug 31, 2023

When pkg-config returns paths with multiples of .../include the function _symlinks attempts (and fails via java.io.IOException) to create multiple symbolic links of the same path.

To replicate this issue run pkg-config gtkmm-4.0 --cflags --libs

The simplest solution is to modify the name of the final directory that is created. An attempt to create sub-directories to hold these include directories may, in turn, create cyclical symbolic links inside the system directory.

@magreenblatt
Copy link

A simple fix is to check if the path exists here before trying to create the symlink:

def _symlinks(ctx, basename, srcpaths):
    result = []
    root = ctx.path("")
    base = root.get_child(basename)
    rootlen = len(str(base)) - len(basename)
    for src in [ctx.path(p) for p in srcpaths]:
        dest = base.get_child(src.basename)
        if not dest.exists:
            ctx.symlink(src, dest)
        result += [str(dest)[rootlen:]]
    return result

@olaaaf olaaaf linked a pull request Jul 26, 2024 that will close this issue
@olaaaf
Copy link
Author

olaaaf commented Jul 26, 2024

Sorry I had a pull request ready but removed the forked repo. You can take a look at #3

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 a pull request may close this issue.

2 participants