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

Relative paths for src are treated as symlinks #826

Closed
2 tasks done
leungster opened this issue Jun 1, 2024 · 2 comments
Closed
2 tasks done

Relative paths for src are treated as symlinks #826

leungster opened this issue Jun 1, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@leungster
Copy link

What happened?

Given a config where src is a relative path to a file, nfpm forces the filetype to be a symlink.
It appears the cause may be due to the usage of os.Readlink in files.go to check if the src is a symlink or not.
os.Readlink does not convert the input into an absolute path first and will echo back relative paths as is per go docs.

I am using bazel to generate my src files and nfpm config file. Since bazel operates on relative paths, nfpm is forcing all my files to be symlinks in the output artifact.

How can we reproduce this?

Create a nfpm config with a relative path for src.

contents:
  - src: relative/path/foo
    dst: /usr/bin/foo

nfpm version

v2.34.0

Search

  • I did search for other open and closed issues before opening this.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Additional context

No response

@leungster leungster added the bug Something isn't working label Jun 1, 2024
caarlos0 added a commit that referenced this issue Jun 22, 2024
Signed-off-by: Carlos Alexandro Becker <[email protected]>
@caarlos0
Copy link
Member

I cannot reproduce this.

Tried writing a failing test, and it doesn't seem to happen, at least not on linux.

#833

@leungster
Copy link
Author

Thanks for looking into this.

I debugged this a bit more under Bazel and the file was actually a symlink. Bazel is creating symlinks under the execution path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants