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

system: load <libpath>/../pkg if <libpath>/pkg doesn't exist but <libpath>/../pkg does #1413

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

illwieckz
Copy link
Member

Load <libpath>/../pkg if <libpath>/pkg doesn't exist but <libpath>/../pkg does.

This to workaround the fact most file browsers will create a subfolder when extracting an archive that doesn't contain one.

This makes Unvanquished_0.56.0/linux-amd64/daemon load Unvanquished_0.56.0/pkg the same way Unvanquished_0.56.0/daemon loads Unvanquished_0.56.0/pkg.

@illwieckz
Copy link
Member Author

Using FS::RawPath::ListFiles() is overkill but we don't have yet a dedicated function to test that a directory exists.

@illwieckz illwieckz force-pushed the illwieckz/parent-dir-pakpath branch from 68890b0 to 55c0989 Compare November 4, 2024 13:07
@slipher
Copy link
Member

slipher commented Nov 4, 2024

I'm against it. Going into .. to look for resources seems like a fishy and insecure design.

Curiously, this could cause a build in Unvanquished/build to automatically find the repository's pkg/. This could seem "convenient" but I think it is a bad idea. I don't want stuff to unpredictably change behavior based on how you choose the build dir. And testing with only released assets is an often desired use case.

@illwieckz
Copy link
Member Author

If we had a builtin mini-GUI in the engine to run when there is no dpk, we could display a minimal file browser where people could just walk directories for a pakpath (basically going to parent dir and selecting pkg/). I believe Darkplaces does something a bit like that.

I'm also unhappy with the idea of the engine looking at the parent directory. But I'm also unhappy abot the zip thing almost never working as expected. We may also make that mechanism stronger by only looking at the parent dir if the basename of the current dir is something like linux-amd64 (and variants).

@slipher
Copy link
Member

slipher commented Nov 10, 2024

How about adding some extract.sh to the zip file?

Or the README instructions could be changed to recommend moving pkg into the new folder which might be easier.

@illwieckz
Copy link
Member Author

How about adding some extract.sh to the zip file?

It would not solving the problem of starting a binary properly if the solution requires to start a binary properly. Also Linux systems doesn't run .sh file this easily in file browser, making it more complicated than a simple binary.

Or the README instructions could be changed to recommend moving pkg into the new folder which might be easier.

That still needs a README to give instruction, so it doesn't change much. Actually such README instruction to move pkg in may help on macOS.

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.

2 participants