Skip to content

Conversation

@OPNA2608
Copy link
Contributor

20250422_22h22m42s_grim

Bagoosker

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Apr 22, 2025
@nix-owners nix-owners bot requested a review from Redhawk18 April 22, 2025 20:39
@Redhawk18
Copy link
Member

Fetched latest irrlicht was getting overridden by fixed irrlicht rev, meaning that irrlicht would never get an update

idk man, this is kinda risky. Remember what we talked about before? The reason that engine isn't versioned is because its an unstable rolling release. The only way to pin the version correctly is to have a bot like nixpkgs upkeep run the script every week to check for update.

@Redhawk18
Copy link
Member

The next time you update this package it won't compile because the engine will be outdated.

@Redhawk18
Copy link
Member

Okay I built it in x64 and it does compile, but theres no core? Was there a pr that went through with me getting pinged?

@OPNA2608
Copy link
Contributor Author

Remember what we talked about before? The reason that engine isn't versioned is because its an unstable rolling release.

IIRC that was about ocgcore getting bundled, which this isn't touching. This is unlocking the pinning of the irrlicht rendering engine from a fixed 2yo Git revision to "whatever is the latest commit when an edopro update is found".

  • New edopro version doesn't compile against the 2yo irrlicht pin, so an update of it is needed
  • The update script fetched the latest irrlicht rev, but then overrode it with a pin, so it would never get updated automatically
  • Irrlicht updates only get applied when a new edopro tag is found anyway, so unpinning this shouldn't apply any incompatible updates to older versions

Or am I misremembering things?

The next time you update this package it won't compile because the engine will be outdated.

The time I tried to update the package, it wouldn't compile because irrlicht was outdated.

Was there a pr that went through with me getting pinged?

AFAIK, the only meaningful change was c868f57. But that happened in a PR to staging, and gets more-or-less reverted in this PR.

Okay I built it in x64 and it does compile, but theres no core?

I only have aarch64 hardware left right now, for which there is no core available anyway, so unable to test this part. Assuming you waited abit to make sure the core doesn't just get loaded late (always took afew secs or so on my machine):

  • Does the same happen with the currently-packaged version, or is this exclusive to the bump suggested here?
  • Did the repository get fetched properly at runtime (check repositories top in the top-left)? if not, close the game, delete ~/.local/share/edopro/repositories, restart, and don't do anything until everything in that menu is listed as 100% complete.
    There's a pop-up that you may get suggesting to switch into a Wayland mode if you're running it on Wayland, accepting this will interrupt any downloads and restart the game, require the above steps to fix (ran into that one afew times...).
  • If none of this solves it: Does ~/.local/share/edopro/repositories/delta-puppet/bin/libocgcore.so look correct (file, ldd, ...)? You may need to attempt to load it via another / a custom application to see any loader issues from it, edopro might not forward that information.

@Redhawk18
Copy link
Member

Redhawk18 commented Apr 23, 2025

The update script fetched the latest irrlicht rev, but then overrode it with a pin, so it would never get updated automatically
Irrlicht updates only get applied when a new edopro tag is found anyway, so unpinning this shouldn't apply any incompatible updates to older versions

I disagree, we are taking a package that was automatic and adding manual requirements to updating it again. We should use a bot like @r-ryantm to update the package automatically. If I enjoyed updating packages manually I wouldn't have wrote the update script. I just forgot to add the bot.

I only have aarch64 hardware left right now, for which there is no core available anyway, so unable to test this part. Assuming you waited abit to make sure the core doesn't just get loaded late (always took afew secs or so on my machine):

I have no idea, I compared the 24.11 version to this pr and checked everything and I can't figure out the problem but I am sure it doesn't work.

@OPNA2608
Copy link
Contributor Author

OPNA2608 commented Apr 23, 2025

I disagree, we are taking a package that was automatic and adding manual requirements to updating it again.

What "manual requirement" are you talking about? Currently, there is a manual requirement (irrlicht rev pin inside of the script) which I'm removing to make it more automatic (latest irrlicht whenever new edopro tag is found).

I invite you to run the update on current master via standard means (nix-shell maintainers/scripts/update.nix --argstr package edopro), and observe that building the resulting update fails due to the manual pinning of the irrlicht repo inside of the update script not updating irrlicht. As is, this just doesn't work for automatic updating. Removing the pin inside of the script should make it work again (sans changes that the updateScript can't handle, like having to remove the patches entry).

We should use a bot like @r-ryantm to update the package automatically.

@r-ryantm runs the script on a schedule. It will run into the aforementioned build error, and should thus never open a bump PR on its own, because it (correctly) assumes that the update is borked.

If I enjoyed updating packages manually I wouldn't have wrote the update script.

You'll need to keep up with upstream releases anyway, whether by following the repo or by periodically running the updateScript of packages you maintain (nix-shell maintainers/scripts/update.nix --argstr maintainer redhawk) to look for any issues. updateScripts can be broken by upstream changes. Derivations can need extra changes that the automation can't do for you. Manual work is inevitable, you can only delay it. And right now, this needs manual work 🙂.

I just forgot to add the bot.

You cannot "add" the bot. The bot runs automatically. It runs .passthru.updateScript, or if that's missing, look for (IIRC) newer versions on Repology and the likes. Neither can currently handle (I repeat):

  • The patches entry now being part of the updated src, leading to a patch application error, so the build fails
  • Irrlicht never getting updated as part of the current updateScript, which leads to a build error due to the library being too outdated for the new release, so the build fails

@Redhawk18
Copy link
Member

I disagree, we are taking a package that was automatic and adding manual requirements to updating it again.

What "manual requirement" are you talking about? Currently, there is a manual requirement (irrlicht rev pin inside of the script) which I'm removing to make it more automatic (latest irrlicht whenever new edopro tag is found).

OOPS MY BAD LMAO. I pinned that for testing and forgot to remove it. I was confused because I knew I wrote the logic you're describing.

@Redhawk18
Copy link
Member

The last problem then is that the core doesn't work. It is there, I checked through dolphin and it is statically linked.

@OPNA2608
Copy link
Contributor Author

No problem!

So:

Does ~/.local/share/edopro/repositories/delta-puppet/bin/libocgcore.so look correct

New version, new repo: ~/.local/share/edopro/repositories/delta-bagooska is where we need to look now, which is cloned from https://github.com/ProjectIgnis/DeltaBagooska. And unlike DeltaPuppetOfStrings, it doesn't have ocgcore libraries yet.

Presumably, new libraries only get uploaded there to override the bundled ocgcore from upstream's downloads. So we prolly do need to build an ocgcore library, to provide a base core in situations like this. We just can't build edopro with the assumption that it will only use that core, like we tried & failed to in the past, because eventually DeltaBagooska will have ocgcore libraries, and script updates will require a newer core. So we still wouldn't need to keep up with upstream's core updates, we just need to provide a base version and configure the game to check the repo for a newer version like it does right now.

I don't have a solution for that right now, but I'll play around abit. Marking this a draft, since without a core there's no singleplayer functionality.

@OPNA2608 OPNA2608 marked this pull request as draft April 23, 2025 17:48
@Redhawk18
Copy link
Member

Thats a fair point, this is a sticky issue because typically you don't want to have pr's that look like edopro: 40.1.4 -> 40.1.4 but if we bundled the core thats what we would have to do, and we would increase the amount of maintenance by 10 or 100 times.

- Error output was not getting printed to stderr, so running it via update.nix wouldn't display the error
- Fetched latest irrlicht was getting overridden by fixed irrlicht rev, meaning that irrlicht would never get an update
Unlike last time, we still build edopro to look in downloaded script repos for updated ocgcores.
We just patch it so it can find & load the ocgcore from its release tag first, in case the
scripts download doesn't have a core.
@Redhawk18
Copy link
Member

I like this, as I understand we packaged a fallback core but we still allow for downloaded cores? In case wouldn't we still require lua in edopro?

  • What happens if all we have is an outdated arm version and it downloads a new x86 version?
  • What happens if theres an incorrect fallback?

@OPNA2608
Copy link
Contributor Author

Does ~/.local/share/edopro/repositories/delta-puppet/bin/libocgcore.so look correct

New version, new repo: ~/.local/share/edopro/repositories/delta-bagooska is where we need to look now

The new version wouldn't actually clone delta-bagooska unless you deleted ~/.local/share/edopro: ~/.local/share/edopro/config/configs.json contains some config data that gets loaded at runtime (script repo to clone, servers to connect to, etc). I adjusted the launcher to always copy that from the assets download, so it always matches the version we're running.

Maybe this should be done for some of the other files as well, like the cacert.pem and scripts, with an option to disable this behaviour via an envvar to allow for local development of scripts and the likes? The delta repos only seem to have scripts for cards added after the corresponding release, so I expect this to be missing abunch of cards now - any card added after 40.1.4 - unless we also copy scripts from assets.

This might need a deeper look into how we should handle this.


I like this, as I understand we packaged a fallback core but we still allow for downloaded cores?

Correct. There is no upstream option for this exact use case (load base ocgcore from a specific location, without disabling loading of updated cores from repo downloads), so I had to patch the location where the base ocgcore is looked up.

In case wouldn't we still require lua in edopro?

Yes, ocgcore still needs Lua. The latest version (which the submodule from edopro points at) builds its own Lua from a submodule. We can tell it to build against our Lua again (lua5_4 now). Our patch for linking against it would likely still be necessary though, so I'll look into submitting that upstream.

  • What happens if all we have is an outdated arm version and it downloads a new x86 version?

The script repo will have multiple ocgcore builds for different platforms. edopro version 41 added support for aarch64-linux, so I would expect them to have adjusted the corresponding code to load the correct ocgcore builds. Once one gets pushed to the repo, I can let you know if it loads on my end.

Otherwise, loading the new core would just fail, and it would stick with the base core it has already loaded. If it hasn't loaded a base ocgcore yet, then it will continue with no core loaded. This is the current behaviour on aarch64-linux, since the version on master didn't yet have aarch64-linux builds in its update downloads.

  • What happens if theres an incorrect fallback?

If the base ocgcore is wrong, it should just fail to load. But the core is built from the ocgcore commit that the corresponding edopro tag points to in its submodule - if that's completely invalid for the built edopro version, to the point where it refuses to be loaded (excluding linking errors, which are prolly to be fixed on our end first), then that's prolly worth reporting upstream.


I haven't been able to actually test if the core actually works yet, I've only checked via strace that it's getting loaded & an updated core is getting looked up. Maybe you can give this a go?

I'm currently recovering from a surgery, so expect further work from me on this to take abit.

@Redhawk18
Copy link
Member

I will look into this tonight, before when I was testing I was only deleting the repo directory, the the config file you are mentioning.

@Redhawk18
Copy link
Member

Okay I did some testing, this works. I'm not the biggest fan of the updating process tbh. Because I tried to delete just the config.json and it didn't download the new repo. So I had to delete the whole folder, which isn't really a good idea because we want to cache those images assets as long as possible so we don't get opened issues about ip bans. We're in a bad place tbh because we are stretching our limits since nixbld runs as root with what we can do in the user's home folder. We might just need to reach out to edo9000 again and ask what we need to delete to force a new repo download.

@OPNA2608
Copy link
Contributor Author

OPNA2608 commented Apr 27, 2025

Here's an idea for solving the update "which files to sync" issue: Just don't bother.

Let's put the assets into versioned sub-directories, check if there are >1 directories in ~/.local/share/edopro, and issue a pop-up informing the user of the need to migrate their files - the same way they would if they were manually updating from one version to another and keeping them in separate directories. They'll know best which files they care about (though we could also suggest some commonly-changing things to keep):

20250427_23h48m59s_grim

This way, every version will have its correct base assets, and there shouldn't be any conflicts between them. The pop-up is also just informational, and will not block the user from just ignoring the situation if they wish/need to keep stuff unmigrated and just want to continue to the game.

I don't think this is optimal, but it should be easier than keeping track of which files need to match the currently running version for everything to work, and dealing with cross-version breakages.

If you like the idea, I can submit what I have and we can start bikeshedding about any of the phrasing etc. 🙂


DeltaBagooska has cores now, and it loads the aarch64 one from it fine... But I noticed that it can't find the fallback one on aarch64.

openat(AT_FDCWD, "/nix/store/vi72hibim6v9lsxjrrqasqr8jw2nmcpx-ocgcore-edopro-41.0.1/lib/libocgcore.aarch64.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "//home/puna/.local/share/edopro/41.0.1//expansions/libocgcore.aarch64.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "//home/puna/.local/share/edopro/41.0.1/./repositories/delta-bagooska/bin/libocgcore.aarch64.so", O_RDONLY|O_CLOEXEC) = 40

I'll adjust some stuff to fix this when I have time.

@Redhawk18
Copy link
Member

HUH, we can do this??? I didn't think we had the ability to do this type of stuff.

… subdirs

- Use WriteShellApplication for the launcher script, since that provides some good default shell options
  and runs shellcheck on the code
  - Fix any issues reported by shellcheck
- Keep assets in subdirs with corresponding edopro version
  Since some of the assets tell the game which game scripts to download, where to look for them, and which servers to
  look at for online play, and managing this across versions could be messy
- Check for multiple subdirs and issue warning about migrating data
  Let's not try to solve this ourselves, the user will know best if, and what, they care about when switching between versions
@OPNA2608
Copy link
Contributor Author

"Versioned" was prolly the wrong word for describing this previously, since that implies smth like a git-managed repo to me... "fresh asset copy for every launched version" fits better 🙃

Submitted the change, please have a look. I suppose the message could be abit better, since the initial migration would be from a version-less ~/.local/share/edopro/ to ~/.local/share/edopro/41.0.1/. Do you think that's worth addressing in the message?


Core loading is happy on aarch64 now, I hope I didn't miss anything necessary on basic x86_64-linux.

openat(AT_FDCWD, "/nix/store/kymsd7f8p92rygn186fxbn3fmm1xlbra-ocgcore-edopro-41.0.1/lib/libocgcore.aarch64.so", O_RDONLY|O_CLOEXEC) = 40
openat(AT_FDCWD, "//home/puna/.local/share/edopro/41.0.1/./repositories/delta-bagooska/bin/libocgcore.aarch64.so", O_RDONLY|O_CLOEXEC) = 40

Since upstream has defines for platforms we technically know as targets in Nixpkgs, I've added optimistic handling for those. Obviously untested though.

- Rename ocgcore library to match expected platform-specific name
@OPNA2608 OPNA2608 changed the title edopro: 40.1.4 -> 41.0.1 edopro: 40.1.4 -> 41.0.2 Apr 28, 2025
# where to get incremental updates from, online servers, card scripting, certificates for communication etc),
# and some are optional nice-haves (example decks). It's also possible to override assets with custom skins.
#
# Don't try to manage all of this across versions, just inform the user that they may need to migrate their
Copy link
Member

Choose a reason for hiding this comment

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

Why don't we handle it, why did we give up so soon?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Simplicity, being able to eventually get a version of these bumps in, lack of spoons to fully figure this out any time soon.

If you want to figure out which files we need to keep synced, and the best way of syncing these without overwriting user-touched files, feel free to send a patch for me to apply.

@r-burns
Copy link
Contributor

r-burns commented May 1, 2025

I've been monitoring this PR and the update is working well for me too. Nice work on the versioned subfolders and the ocgcore fix. I see this is still drafted but feel free to undraft and/or ping me if you need a merge.

@OPNA2608 OPNA2608 marked this pull request as ready for review May 1, 2025 07:44
@OPNA2608
Copy link
Contributor Author

OPNA2608 commented May 1, 2025

@r-burns Undrafted now. Have the honour of pressing the merge button 😄.

@r-burns
Copy link
Contributor

r-burns commented May 1, 2025

Oh lol, didn't realize you were a committer yourself, I'll go ahead and merge anyway

@r-burns r-burns merged commit 2de9e3c into NixOS:master May 1, 2025
45 of 47 checks passed
@nixpkgs-ci
Copy link
Contributor

nixpkgs-ci bot commented May 1, 2025

Successfully created backport PR for release-24.11:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants