Skip to content

Conversation

nezia1
Copy link
Contributor

@nezia1 nezia1 commented Jun 5, 2025

closes #10

This adds to previous work that has been done into the manifest branch. This implements:

  1. Adding a service that runs after a rebuild / boot
  2. Validate the manifests using cue (will fail the rebuild if even one of them is invalid)
  3. Creating per-user manifests and storing them under /var/lib/hjem, where they can be accessed between generations (this causes Hjem to have to manage its own state)
  4. Use the linker's diff command in order to compare files and re-link if needed
  5. Adds sanity checks to test the linker's capabilities

Let me know your thoughts, as I am unsure if I have successfully implemented everything that's needed (very likely not).

Copy link
Contributor

@NotAShelf NotAShelf left a comment

Choose a reason for hiding this comment

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

I like this overall, excellent work. While not urgent, I'd like to update the README to reflect the new linker usage, but this is for another PR.

@NotAShelf NotAShelf requested a review from eclairevoyant June 5, 2025 09:30
@nezia1 nezia1 force-pushed the manifest-switching branch from a1fba59 to ec44dd9 Compare June 5, 2025 09:32
@nezia1
Copy link
Contributor Author

nezia1 commented Jun 5, 2025

I have also updated the cue file. Please let me know if the spec is wrong @Gerg-L @eclairevoyant (I used the test manifest.json on smfh as the specification).

@nezia1
Copy link
Contributor Author

nezia1 commented Jun 5, 2025

Side-thought, we should have a specification for linkers, as we'd want every linker that works with hjem to implement the same API (e.g. so we can just assume in the service that the linker will have a diff command). This is orthogonal to this PR however

@NotAShelf
Copy link
Contributor

Side-thought, we should have a specification for linkers, as we'd want every linker that works with hjem to implement the same API (e.g. so we can just assume in the service that the linker will have a diff command)

I think the least alternative linkers could do is to understand what the current spec is, but it might be a good idea to document and version the linker spec somewhere. I'll try to catch this in my upcoming documentation PR. Currently preparing a NDG stylesheet for Hjem, we can probably prepare a markdown document alongside the new README.

@nezia1 nezia1 force-pushed the manifest-switching branch 2 times, most recently from 8005b2e to 0ae775a Compare June 5, 2025 21:39
@nezia1
Copy link
Contributor Author

nezia1 commented Jun 5, 2025

I restored the old manifest, so we might take a look at it later to ensure that we implement the full specification correctly.

Additionally, I came up with way better manifest validation: instead of checking inside of the service, we now check for it during the checkPhase or our manifest. This allows for validation at build-time, and is infinitely more solid than what I used to do before (i.e. check it during the activation service, which is inherently brittle). We migh still want service validation though, to ensure that the OLD manifests are not corrupted in any way. If this happens, we can error out and prompt the user to:

  1. Run a rebuild
  2. Re-run the service

So that they may re-link their files.

@nezia1 nezia1 force-pushed the manifest-switching branch 15 times, most recently from f4018e0 to 4ad7e62 Compare June 11, 2025 13:23
@nezia1
Copy link
Contributor Author

nezia1 commented Jun 11, 2025

Made a few readability changes (inverted the condition in mapFiles, added a comment for it, renamed linker to linkerExe and declared it in the script let..in binding)

@nezia1 nezia1 marked this pull request as ready for review June 11, 2025 19:53
@fxzzi
Copy link

fxzzi commented Jun 11, 2025

ty nezia, seems to work great with my minimal testing

@eclairevoyant eclairevoyant changed the base branch from manifest to main June 14, 2025 02:18
@eclairevoyant eclairevoyant merged commit d5bf1fd into feel-co:main Jun 14, 2025
4 checks passed
@nezia1 nezia1 deleted the manifest-switching branch June 30, 2025 15:26
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.

Migrate to linker
5 participants