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

feat(24.04): add xz-utils slice #322

Open
wants to merge 5 commits into
base: ubuntu-24.04
Choose a base branch
from

Conversation

endersonmaia
Copy link

Proposed changes

Add xz-utils slice.

Checklist

Copy link

github-actions bot commented Aug 23, 2024

Diff of dependencies:

slices/xz-utils.yaml
@@ -1,2 +1,5 @@
+dash
+diffutils
+grep
 libc6
 liblzma5

@@ -0,0 +1,26 @@
package: xz-utils

Choose a reason for hiding this comment

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

Thanks for the contribution! The slice itself looks good to me. However could you add some spread tests to help us verify everything works as expected? https://github.com/canonical/chisel-releases/blob/main/CONTRIBUTING.md#7-test-your-slices-before-opening-a-pr

Here is an example PR with tests:
https://github.com/canonical/chisel-releases/pull/320/files#diff-40e68e9abb4e657ef292dcfd6fa750ddffea20daec62f7ceb9acc7605beb17e3

Copy link
Author

Choose a reason for hiding this comment

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

I suppose I don't need to add a test for every binary provided.

But when testing xz I thought I could test with xz --version, xz -z (compress) and a little xzgrep just for "completeness" of the test. But this failed and I can't understand why.

I'll send a fixup without the xzgrep that may pass, but I am not satisfied.

essential:
- xz-utils_copyright

slices:
Copy link

@clay-lake clay-lake Aug 27, 2024

Choose a reason for hiding this comment

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

It looks like xzgrep and a few of the other utils in /usr/bin/ maybe shell scripts. Could we move the scripts to a util folder slice and add the dependencies there?

slices:
  bins:
    essential:
      - libc6_libs
      - liblzma5_libs
    contents:
      /usr/bin/lzmainfo:
      /usr/bin/unxz:
      /usr/bin/xz:
slices:
  utils:
    essential:
      - xz-utils_bins
      - dash_bins
      - grep_bins
      ... possibly more dependencies
    contents:
      /usr/bin/xzcat:
      /usr/bin/xzcmp:
      /usr/bin/xzdiff:
      /usr/bin/xzegrep:
      /usr/bin/xzfgrep:
      /usr/bin/xzgrep:
      /usr/bin/xzless:
      /usr/bin/xzmore:

Copy link
Author

Choose a reason for hiding this comment

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

You mean create a new slice called utils?

slices:
...
  utils:
    essential:
      - xz-utils_bins
      - dash_bins
      - grep_bins

I just think it's gonna be ugly to call xz-utils_utils.

Copy link
Author

Choose a reason for hiding this comment

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

I couldn't make it pass the test I've made, but sent the commit anyway so you can help me track what's missing.

I still get this error:

chroot: failed to run command ‘xzgrep’: No such file or directory

Choose a reason for hiding this comment

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

I made a rootfs with your slices and busybox so I can take a closer look at the environment, and was able to recreate your error. It looks like xzgrep is expecting /bin/sh to exist. I symlinked /bin to /usr/bin and /usr/bin/sh to /usr/bin/busybox and xzgrep seems to execute now.

I think I saw another slice with a similar hurdle, let me see what the convention is for fixing this.

Choose a reason for hiding this comment

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

Sorry for the delay. The team mentioned we need to add base-files_bin (or base-files_base) to link /bin to /usr/bin. I gave it a shot and there were still a few broken lines in the test task. I think some of the process substitution might be breaking under chroot. Tomorrow I'll see if I can come up with an alternate test.

Choose a reason for hiding this comment

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

Here is a draft PR with some changes I made to get it to run locally. Lets see if it passes spread tests. Feel free to cherry-pick the changes if you like them.

#338

@clay-lake
Copy link

Hi @endersonmaia, I added some final changes with the team in #338. Feel free to add some comments there, otherwise I will merge it soon, and close this PR.

Thanks again for the contribution!

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