-
Notifications
You must be signed in to change notification settings - Fork 13
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
refactor: Support the move to having build files located in ./files/
in all modules
#202
Comments
./files/
./files/
in all modules
Modules requiring refactor
General refactor planWith the setup in (Note: examples below use un-implemented files module syntax from #203) Without such a refactor, a repo might look like this:
With the following recipe: # recipe.yml
...
modules:
- type: files
files:
- source: usr/
destination: /usr
- type: gschema-overrides
include:
- zz1-myoverride.gschema.override With such a refactor, a repo might look like this:
With the following recipe: # recipe.yml
...
modules:
- type: files
files:
- source: system/
destination: /
- type: gschema-overrides
include:
- gschema/zz1-myoverride.gschema.override Specific refactor details
|
@xynydev I think that we should keep
Everything else looks good.
Well we can copy systemd units from |
My point was that those folder names shouldn't be hardcoded IMO. So it could be |
In that case, I agree. |
So this idea I had might be too much to implement in the scope of this issue. However, I'm working on the Stages feature (blue-build/cli#173) at the moment and ran into a particular issue of needing to copy between stages. I created the type: copy
from: ghcr.io/blue-build/cli:latest-installer
src: /out/bluebuild
dest: /usr/bin/ It would end up creating the instruction: COPY --from=ghcr.io/blue-build/cli:latest-installer /out/bluebuild /usr/bin/ So I essentially re-implemented the "built-in" files module. However, I chose to make a new module cause I though of a potential extension of the |
IMV some of those file operations might be possible to commit into git, while most would be more straightforward to do with shell snippets. I wouldn't complicate the Your |
That's a good distinction. Alright fair enough |
Being able to use a container image as a file source is something I had to resort to using the I have a Github action which builds Thanks @gmpinder for mentioning that stage feature because it could potentially simplify things as long as caching works out. One of the spec files is Mesa and I don't want to be rebuilding that if I don't have to. |
Upon further reflection, this might actually be the way. Many modules currently hardcode a folder name in their code to be copied in to the build, like If someone wants a system of 1-1 mapping with a folder in their repo corresponding exactly to the layout in their image, that will be possible with the I believe modules that process files in some way before copying them over from their corresponding directory might also be able to support such a structure, by processing the files in the destination folder. It might be a good thing that I didn't rush to implementing the initial refactor, eventhough it didn't receive much of any pushback from y'all. Maybe some would have been warranted, too. With that, here's my example from above updated to match my current thoughts.Filesystem structure:
Recipe: # recipe.yml
...
modules:
- type: files # source path is relative to files/
files:
- source: system # this feels like it makes sense, and is very similar to the system_files structure used by ublue
destination: /
- type: gschema-overrides # copies from files/gschema-overrides/
include:
- zz1-myoverride.gschema.override |
@xynydev This looks great to me, I find no issues with it. I am ready to start work on this. |
Great! The only changes needed are is the I can handle the announcements and stuff, code-wise this should be a small change. |
@xynydev I think that we should strictly switch all modules to use Is it better to handle the logic of like, I'm not sure if this is enough: if [[ -d "/tmp/config/" ]]; then
CONFIG_DIRECTORY="${CONFIG_DIRECTORY:-/tmp/config}"
elif [[ -d "/tmp/files/" ]]; then
CONFIG_DIRECTORY="${CONFIG_DIRECTORY:-/tmp/files}"
fi |
Oh right, this logic is already handled in CLI. |
This would be the changes required for supporting blue-build/cli#138.
The text was updated successfully, but these errors were encountered: