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

HACKING, packaging: update dependencies and information on installing development dependencies #13968

Merged
merged 3 commits into from
May 29, 2024

Conversation

bboozzoo
Copy link
Collaborator

Update instructions on installing development dependencies. Include an example for Fedora.

@bboozzoo bboozzoo added Simple 😃 A small PR which can be reviewed quickly Skip spread Indicate that spread job should not run labels May 15, 2024
Copy link
Member

@olivercalder olivercalder left a comment

Choose a reason for hiding this comment

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

With these instructions executed, go test ./... is able to run, but there are many test failures. I tried both without and with snapd installed on the system.

Without snapd: https://termbin.com/rw4l
With snapd: https://termbin.com/fhfb

Not sure if this means there are other dependencies required for tests to pass, or if this means tests make incorrect assumptions about the systems on which they run (and thus should be fixed). I'll investigate a bit more.

@olivercalder
Copy link
Member

Had a peek with Zygmunt... looks like mksquashfs is adding security xattrs which then denies permission to unsquashfs. I'll try to find where mksquashfs is used in tests and see if I can add --no-xattrs when using mksquashfs in tests.

Also, there are at least two other classes of problems I've spotted:

  • Mount count incorrect (probably related to failed unsquashfs?)
  • Something actually relevant:
In file included from /usr/include/features.h:527,
                 from /usr/include/errno.h:25,
                 from /tmp/check-1158390419/1/seccomp_syscall_runner.c:3:
/usr/include/gnu/stubs.h:7:11: fatal error: gnu/stubs-32.h: No such file or directory
    7 | # include <gnu/stubs-32.h>
      |           ^~~~~~~~~~~~~~~~
compilation terminated.
  • Another:
FAIL: main_test.go:876: snapSeccompSuite.TestCompatArchWorks

main_test.go:909:
    s.runBpf(c, t.seccompAllowlist, t.bpfInput, t.expected)
main_test.go:378:
    c.Assert(exitCode == 0 || exitCode == 10 || exitCode == 20, Equals, true, Commentf("unexpected exit code: %v for %v - test setup broken", exitCode, seccompAllowlist))
... obtained bool = false
... expected bool = true
... unexpected exit code: -1 for read - test setup broken
  • Another:
FAIL: image_test.go:3698: imageSuite.TestSetupSeedCore20DelegatedSnapAssertionMaxFormatsHappy

image_test.go:3735:
    c.Check(err, IsNil)
... value *errors.errorString = &errors.errorString{s:"cannot run unsquashfs: \n-----\nwrite_xattr: could not write xattr security.selinux for file /tmp/read-file2310665016/unpack/meta/snap.yaml because you're not superuser!\nwrite_xattr: to avoid this error message, either specify -xattrs-include '^user.', -no-xattrs, or run as superuser!\nFurther error messages of this type are suppressed!\nParallel unsquashfs: Using 20 processors\n1 inodes (1 blocks) to write\n\n/tmp/read-file2310665016/unpack\n/tmp/read-file2310665016/unpack/meta\n/tmp/read-file2310665016/unpack/meta/snap.yaml\n\ncreated 1 file\ncreated 2 directories\ncreated 0 symlinks\ncreated 0 devices\ncreated 0 fifos\ncreated 0 sockets\ncreated 0 hardlinks\n-----"} ("cannot run unsquashfs: \n-----\nwrite_xattr: could not write xattr security.selinux for file /tmp/read-file2310665016/unpack/meta/snap.yaml because you're not superuser!\nwrite_xattr: to avoid this error message, either specify -xattrs-include '^user.', -no-xattrs, or run as superuser!\nFurther error messages of this type are suppressed!\nParallel unsquashfs: Using 20 processors\n1 inodes (1 blocks) to write\n\n/tmp/read-file2310665016/unpack\n/tmp/read-file2310665016/unpack/meta\n/tmp/read-file2310665016/unpack/meta/snap.yaml\n\ncreated 1 file\ncreated 2 directories\ncreated 0 symlinks\ncreated 0 devices\ncreated 0 fifos\ncreated 0 sockets\ncreated 0 hardlinks\n-----")

image_test.go:3758:
    c.Check(later, DeepEquals, map[string]bool{
        s.AssertedSnapID("snapd"):      true,
        s.AssertedSnapID("core20"):     true,
        s.AssertedSnapID("pc-kernel"):  true,
        s.AssertedSnapID("pc"):         true,
        s.AssertedSnapID("required20"): true,
    })
... obtained map[string]bool = map[string]bool{"DLqre5XGLbDqg9jPtiAhRRjDuPVa5X1q":true, "PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4":true, "pckernelidididididididididididid":true}
... expected map[string]bool = map[string]bool{"DLqre5XGLbDqg9jPtiAhRRjDuPVa5X1q":true, "PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4":true, "pcididididididididididididididid":true, "pckernelidididididididididididid":true, "required20ididididididididididid":true}
... Difference:
...     ["pcididididididididididididididid"]: (missing) != %!q(bool=true)
...     ["required20ididididididididididid"]: (missing) != %!q(bool=true)

...etc.

@bboozzoo bboozzoo changed the title HACKING: update information on installing development dependencies HACKING, packaging: update dependencies and information on installing development dependencies May 17, 2024
Copy link
Member

@olivercalder olivercalder left a comment

Choose a reason for hiding this comment

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

Thanks!

@bboozzoo
Copy link
Collaborator Author

Added a blocked label, the multilib dependencies expressed in the RPM spec seem to make rpmbuild quite unhappy, so I need to figure out what's going on there.

Update instructions on installing development dependencies. Include an example
for Fedora.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
…ll them

Use rpmspec for fimding out the build dependencies and then proceed with
installing

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
@bboozzoo
Copy link
Collaborator Author

I have dropped the changes to snapd.spec as they were incorrect. So we're left with a note in HACKING.md and little tweak to the spread test prepare.

@bboozzoo bboozzoo removed the Skip spread Indicate that spread job should not run label May 22, 2024
@bboozzoo bboozzoo closed this May 22, 2024
@bboozzoo bboozzoo reopened this May 22, 2024
Copy link
Collaborator

@zyga zyga left a comment

Choose a reason for hiding this comment

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

Thanks

Copy link
Member

@olivercalder olivercalder left a comment

Choose a reason for hiding this comment

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

Thanks!

cd packaging/fedora
sudo dnf install -y rpmdevtools
sudo dnf install -y $(rpmspec -q --buildrequires snapd.spec)
sudo dnf install glibc-static.i686 glibc-devel.i686
Copy link
Member

Choose a reason for hiding this comment

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

Are these required for unit tests to pass but not for building the snapd rpm? Else why not include in snapd.spec?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's the problem, I can't properly include them in the spec without breaking something. I've actually had a patch adding then to BuildRequires for x86_64 arch, but rpmbuild got unhappy and complained, even though dependencies were satisfied according to dnf, so I dropped the patch. Those packages are already included in the build images we use here and in Fedora infra.

Old rpmspec did not support --with <arg>.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
@ernestl ernestl merged commit bff650d into snapcore:master May 29, 2024
38 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Simple 😃 A small PR which can be reviewed quickly
Projects
None yet
4 participants