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

Have builderv2 fetch itself #150

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

Conversation

DemiMarie
Copy link

@DemiMarie DemiMarie commented Sep 4, 2024

This is accomplished by symlinking artifacts/sources/builderv2 to the toplevel directory.

THIS MIGHT WIPE DATA. DO NOT USE UNTIL REVIEWED.

This is accomplished by symlinking artifacts/sources/builderv2 to the
toplevel directory.
Copy link

codecov bot commented Sep 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.69%. Comparing base (e1bdbcd) to head (37dcf72).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #150      +/-   ##
==========================================
+ Coverage   74.13%   78.69%   +4.56%     
==========================================
  Files          47       47              
  Lines        5370     5370              
==========================================
+ Hits         3981     4226     +245     
+ Misses       1389     1144     -245     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@marmarek marmarek left a comment

Choose a reason for hiding this comment

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

This is interesting idea, but it won't work reliably. I see at least two issues:

  • the artifacts dir is configurable, so the symlink won't work if non-default artifacts dir is used.
  • in default configuration (git-run-inplace: false) the symlink probably will get removed

But even without those issues, self-updating is more problematic. You can't just update itself in the middle of some operation. Imagine for example fetching all components - as soon as builderv2 component is fetched, all builder's files will get updated (including for example scripts in qubesbuilder/plugins/fetch/scripts/). The new version may be not compatible with already running python code. The update needs to be performed separately (either as the only operation, or at least the last one).

@DemiMarie
Copy link
Author

This is interesting idea, but it won't work reliably.

Extremely unsurprising. I added that comment for a reason 😆.

I see at least two issues:

  • the artifacts dir is configurable, so the symlink won't work if non-default artifacts dir is used.
  • in default configuration (git-run-inplace: false) the symlink probably will get removed

But even without those issues, self-updating is more problematic. You can't just update itself in the middle of some operation. Imagine for example fetching all components - as soon as builderv2 component is fetched, all builder's files will get updated (including for example scripts in qubesbuilder/plugins/fetch/scripts/). The new version may be not compatible with already running python code. The update needs to be performed separately (either as the only operation, or at least the last one).

Could the update be done by replacing a symlink followed by sys.exit(0)? That’s atomic.

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