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

use a temporary workdir during bundle creation #1425

Merged
merged 2 commits into from
May 23, 2024
Merged

Conversation

jluebbe
Copy link
Member

@jluebbe jluebbe commented May 15, 2024

Currently, we modify and add files in the input directory. While this
isn't much of a problem now, we will need to delete converted files when
converting tar archives to file trees in the context of artifacts. That
would require the user to always re-create the bundle input directory
after running 'rauc bundle', which would be annoying.

It seems the simplest way is to hard-link all files from the input dir
to a .rauc-workdir subdirectory. This way, we don't need actually copy
any data and keep the rest of the bundle creation code unaffected.

For simplicity, we abort on anything in the input dir which is not a
regular file. If someone relies on the old (undocumented) behaviour of
including directories and symlinks in the bundle, please contact us.

@jluebbe jluebbe added the enhancement Adds new functionality or enhanced handling to RAUC label May 15, 2024
@jluebbe jluebbe added this to the Release v1.12 milestone May 15, 2024
@jluebbe jluebbe requested a review from ejoerns May 15, 2024 16:54
Copy link
Member

@ejoerns ejoerns left a comment

Choose a reason for hiding this comment

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

I really like the idea in general, since it also solves current confusion we have by modifying the manifest in-place.

My biggest concern is to break a number of use-cases we don't know about, yet.

Would it be an option to loudly warn and fall back to the 'contentdir' for a transition phase?

We should maybe also instruct users via error messages to contact us, since probably not all users of bundle creation will be familiar with looking into the code/commit message..

src/bundle.c Show resolved Hide resolved
src/bundle.c Outdated Show resolved Hide resolved
src/bundle.c Show resolved Hide resolved
@jluebbe jluebbe force-pushed the workdir branch 2 times, most recently from 646dcd5 to 57fb8aa Compare May 23, 2024 14:01
@jluebbe jluebbe marked this pull request as ready for review May 23, 2024 14:01
@jluebbe
Copy link
Member Author

jluebbe commented May 23, 2024

I've added a FAQ entry as discussed internally.

Copy link
Member

@ejoerns ejoerns left a comment

Choose a reason for hiding this comment

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

Some minor things left, looks fine otherwise.

docs/faq.rst Outdated Show resolved Hide resolved
docs/faq.rst Outdated Show resolved Hide resolved
src/bundle.c Show resolved Hide resolved
Currently, we modify and add files in the input directory. While this
isn't much of a problem now, we will need to delete converted files when
converting tar archives to file trees in the context of artifacts. That
would require the user to always re-create the bundle input directory
after running 'rauc bundle', which would be annoying.

It seems the simplest way is to hard-link all files from the input dir
to a .rauc-workdir subdirectory. This way, we don't need actually copy
any data and keep the rest of the bundle creation code unaffected.

For simplicity, we abort on anything in the input dir which is not a
regular file. If someone relies on the old (undocumented) behavior of
including directories and symlinks in the bundle, please contact us.

Signed-off-by: Jan Luebbe <[email protected]>
As we no longer modify the manifest in place, we can drop the generated
information, which would otherwise cause git to report modifications
after running the tests.

Signed-off-by: Jan Luebbe <[email protected]>
@jluebbe jluebbe merged commit 934f1bf into rauc:master May 23, 2024
16 checks passed
@jluebbe jluebbe deleted the workdir branch May 23, 2024 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adds new functionality or enhanced handling to RAUC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants