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

Cannot include symbolic link as asset #44

Closed
naokiri opened this issue Sep 2, 2022 · 2 comments · Fixed by #48
Closed

Cannot include symbolic link as asset #44

naokiri opened this issue Sep 2, 2022 · 2 comments · Fixed by #48

Comments

@naokiri
Copy link

naokiri commented Sep 2, 2022

As a library developer, I want to build an lib*-dev.deb package.

Steps to reproduce

$ cargo deb --version
1.38.4
  1. Create symlinks
    # mkdir -p tmp_asset
    # cd tmp_asset
    # ln -sf libfoo.so.0 libfoo.so.0.7.0
    # ln -sf libfoo.so libfoo.so.0.7.0
  1. Add these into assets configuration
[package.metadata.deb]
assets = [["tmp_asset/lib*", "/usr/local/lib/", "777"]]
preserve-symlinks = true
  1. Run cargo deb

Expected

symbolic link is included in the deb package

Actual

cargo-deb: unable to read asset to add to archive: OMIT/libfoo.so

Is there any workaround to make symlinks in deb package?

@kornelski
Copy link
Owner

I've changed symlinks behavior in v1.41.0-beta.1. Please test it.

@patlkli
Copy link

patlkli commented Mar 27, 2023

I believe 02ee084 might have broken symlink assets in a different way.

In Config::resolve_assets, glob::glob is always used to resolve asset source paths, even for non-glob patterns.
Unfortunately glob::glob also always tries to follow symlinks and has no option to disable that (see rust-lang/glob#63).
So if you try to package a dangling symlink (in the source tree that is), you will get an AssetFileNotFound error.

Should I submit a PR to just skip globbing if preserve_symlinks is enabled and the source is a symlink?

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.

3 participants