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

Fix #34 -- Don't remove files with a hidden component #50

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ralsina
Copy link

@ralsina ralsina commented Aug 25, 2024

This may not be a perfect fix but at least it makes the behaviour more predictable.

Without this, what files get baked into the binary depends on the path where you are building the software.

Specifically, when packaging for Arch Linux, packages are built inside ~/.cache which meant no files were ever accepted.

Copy link
Collaborator

@straight-shoota straight-shoota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it would be better to restrict this PR to the relevant change in loader.cr.
Lint and formatter updates could go into a separate one.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: What's happening with this file?

@ralsina
Copy link
Author

ralsina commented Aug 26, 2024

I believe it would be better to restrict this PR to the relevant change in loader.cr. Lint and formatter updates could go into a separate one.

Done, removed that from here.

@ralsina
Copy link
Author

ralsina commented Sep 17, 2024

Is there any way to get this merged? This is a popular shard and this is a real bug

@straight-shoota
Copy link
Collaborator

ping @schovi

@zw963
Copy link

zw963 commented Sep 19, 2024

It’s seem like just not get hidden file/folder baked into binary, this behavior is expected, those codes were added intentionally, to avoid the user added hidden user data to the binary accidentally, i consider it is not a bug.

@straight-shoota
Copy link
Collaborator

@zw963 This is a very limiting design joice. The user should decide which files they want to bake, and there's no good reason to categorially exclude path components that start with a dot. Especially considering that the hidden file semantics are just a convention on POSIX systems. On Windows for example path components starting with a dot are not considered hidden.

@ralsina
Copy link
Author

ralsina commented Sep 19, 2024 via email

@zw963
Copy link

zw963 commented Sep 19, 2024

In Arch Linux, for example, source-based packages are built inside .cache which means you get nothing in the binary

Why would you add .cache into the binary, i am understand correct, what you means is ~/.cache in Arch Linux, right?

To be honest, I can't really think of a scenario where you would need to add dot file to binary, even on windows.

@ralsina
Copy link
Author

ralsina commented Sep 19, 2024

In Arch Linux, for example, source-based packages are built inside .cache which means you get nothing in the binary

Why would you add .cache into the binary, i am understand correct, what you means is ~/.cache in Arch Linux, right?

To be honest, I can't really think of a scenario where you would need to add dot file to binary, even on windows.

Looks like the bug description is not clear enough.

It's not just that you can't add foo/.bar into the binary. You can't add .foo/bar either.

Further, if you want to add foo/bar but you are building in /.quux making the full path /.quux/foo/bar it will not be added to the binary.

This means the result of baking a directory into the binary depend not only on the relative path of the file you want to put in the binary but ON THE PATH WHERE THE CODE IS LOCATED.

I am not adding .cache into the binary. The tools to build binaries from source build them inside .cache

For example, pikaur would use ~/.cache/pikaur/pkg/foo to build the package foo
Since having any component in the path start with "." prevents a file from being baked, that meant NOTHING gets into the binary. Not a single file.

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 this pull request may close these issues.

3 participants