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

Configurable virtual fs mounts based on environment variables #1282

Merged
merged 2 commits into from
Sep 30, 2023

Conversation

phantamanta44
Copy link

This PR is a first step towards addressing #651. It allows users (or package maintainers) to customize the Etterna virtual filesystem mounts using environment variables so that the game installation itself can remain immutable while any variable data is stored elsewhere. This is especially necessary for a NixOS release, as the Nix store is read-only.

More specifically, this PR does the following:

  • Causes Etterna to check the env var ETTERNA_ROOT_DIR on startup. If present, its value is used for the path of the main mount; otherwise, the current behaviour is used, namely mounting the installation directory.
  • Causes Etterna to check the env var ETTERNA_ADDITIONAL_ROOT_DIRS on startup. If present, it's parsed as a list of paths that are treated identically to the paths listed in the "AdditionalFolders" setting. The list delimiter is the OS-dependent path separator, namely ; on Windows and : everywhere else.
  • Causes Etterna to check the env var ETTERNA_ADDITIONAL_SONG_DIRS on startup. If present, it's parsed as a list of paths that are treated identically to the paths listed in the "AdditionalSongFolders" setting. As above, the separator is OS-dependent.
  • Adds an ASSET_DIR CMake variable that can be configured to define where game assets should be installed. If absent, defaults to the current behaviour, namely to INSTALL_DIR. The purpose of this change is to allow assets to be separated from the rest of the game data so that they're easier to subsequently copy elsewhere. Could be useful for distribution on some Linux flavours.
  • Makes INSTALL_DIR similarly configurable.
  • Disables the CMake installation commands for crashpad binaries if Etterna is built without crashpad.

This last change comes up because the crashpad build task attempts to run built-in build tools (e.g. extern/crashpad/buildtools/linux64/gn) that fail to run on NixOS because of linking issues. Potentially, a more drastic refactoring of the build tools could fall back to the system installs of the build tools, but that wasn't a priority for me in this PR.

If these changes make it into release, the plan is to then PR nixpkgs with an expression for Etterna. The idea is to wrap the Etterna binary so that the game's root mount is bound to ~/.local/share/etterna in the user's home directory by environment variables, and then to add the game's immutable installation/asset directory as an additional mount.

@poco0317
Copy link
Member

the changes look fine. does it work? i wont test it

@phantamanta44
Copy link
Author

Tested and working on my amd64 nixos install, but that's the only system I have

@poco0317 poco0317 merged commit a872435 into etternagame:develop Sep 30, 2023
10 of 11 checks passed
@fgaz
Copy link

fgaz commented Feb 5, 2024

@phantamanta44 I was looking into packaging etterna for NixOS and found this. How's your package going?

@phantamanta44
Copy link
Author

I have a nixpkgs expression ready to be PR'd, but I'm waiting on an official Etterna release that includes this patch

@fgaz
Copy link

fgaz commented Feb 6, 2024

When that happens feel free to ping me for a review

@poco0317
Copy link
Member

poco0317 commented Feb 9, 2024

although the repo activity is no indicator, it is likely that we will see a release in roughly a month. if you want to pr something to here open at any time. if you mean pr to nix or whatever just keep in mind that whatever you do for the love of god do not point a publicly available repackaging or distribution to anything other than master tags

@mibmo
Copy link

mibmo commented Nov 5, 2024

for the love of god do not point a publicly available repackaging or distribution to anything other than master tags

Why is this? wouldn't it be fine to build against the same commit as the newly released beta clients?

At least for the time being, till a new tag is made. :)

@poco0317
Copy link
Member

poco0317 commented Nov 6, 2024

historically, people that make in-development versions of the game readily available have made giant headaches for us when the users come to us saying they installed something we didnt make and it broke

as for the technically half-released beta clients its kind of in limbo. i would prefer not to have those have separate releases either because the builds themselves can be invalidated at a moments notice. users of the client are accepting that things will probably be broken and not annoy us about it (they still annoy us)

and a full release would have been done by now but im basically alone here and i just dont have the time right now

@mibmo
Copy link

mibmo commented Nov 6, 2024

that's totally fair! I just miss playing the game :) I've wanted to package it for NixOS since ~last november, and found this when getting back to it again - I think I'll just create a draft PR with my derivation, so that the few that specifically search for etterna and nixos together can find it, but it won't be generally available till an actual tagged release. Would that be okay with you? I can add a disclaimer and refer to your comment.

@poco0317
Copy link
Member

poco0317 commented Nov 6, 2024

if its a pr here, yes, do whatever you want. if its a pr somewhere else then im still fine with it existing unmerged as long as that isnt some annoyance to whatever maintainers exist

@mibmo
Copy link

mibmo commented Nov 6, 2024

Okay, perfect! :) I've created NixOS/nixpkgs#353956.

@phantamanta44 & @fgaz: If you two are still interested, I'd very much appreciate some feedback. Perhaps you'll share your expression?

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.

4 participants