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

Keep a clean home #214

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

Conversation

Selebrator
Copy link

Hi Sejsel, thank you for creating the log manager and for distributing the self-contained Linux version.

I have noticed that the ~/.net/ArcdpsLogManager directory is re-created every time I launch your tool. This bothers me a little bit, since I like to keep my home directory clean. I've found that changing IncludeAllContentForSelfExtract from true to false for the build leads to this directory not being created and the application still working just fine.

I have no idea why you chose to enable that option. I also don't know much about what this does, but my understanding is that this option makes sure that everything the application might need is included. Therefore I checked if disabling it removes anything important from the binary. I found that it only flips 1 bit, presumably the bit responsible for the extraction.

$ diff <(xxd GW2Scratch.ArcdpsLogManager.Gtk.true) <(xxd GW2Scratch.ArcdpsLogManager.Gtk.false)                                                                                                          ~/tmp/test
4670433c4670433
< 04743e00: 0000 0100 0000 0000 0000 40b7 a400 0000  ..........@.....
---
> 04743e00: 0000 0000 0000 0000 0000 40b7 a400 0000  ..........@.....

So my guess is that this change has no negative consequences.

Prevents creation of the ~/.net/ArcdpsLogManager directory
@Sejsel
Copy link
Member

Sejsel commented Mar 9, 2024

Oh, I definitely agree that it should not be polluting the home directory like that.

I am going to look a bit deeper into what exactly it does these days (I believe the behavior has changed slightly over time) and see if it can be safely disabled. The thing is, it should be tested if it works without .NET being installed, and possibly even without Gtk being installed (although for that I am not sure it even can work).

@Selebrator
Copy link
Author

I checked that it still works without any .NET stuff installed.

@Selebrator
Copy link
Author

It is also possible to prevent the creation of that $HOME/.net directory by setting the DOTNET_BUNDLE_EXTRACT_BASE_DIR environment variable: https://learn.microsoft.com/en-us/dotnet/core/deploying/single-file/overview?tabs=cli#native-libraries.

I read about the semantics of the IncludeAllContentForSelfExtract option. My understanding is that this is designed to make all bundled files be somewhere in the filesystem, so that a program that wants to load something from disk that it was shipped with it will find it as a file, not in memory. For normal C# dependencies that is not necessary. My guess is that you would use this feature if you shipped some library or application that's not in C# as a dependency.
The log manager does not use this and works perfectly fine without the extraction. Most of the files created in the extracted directory are dlls of dependencies. I confirmed using inotifywait that no other files from the directory are accessed.
Also, my understanding is that if setting IncludeAllContentForSelfExtract=false was problematic for anyone, it would be for everyone.

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