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

Add core20 to various /Dockerfile/s #3384

Closed

Conversation

martijnbastiaan
Copy link

With the docker additions, snapcraft can be used with base: core20. For googlability, this PR prevents errors such as:

Cannot find the linker to use for the target base 'core20'.
Please verify that the linker exists at the expected path '/snap/core20/current/lib64/ld-linux-x86-64.so.2' and try again. If the linker does not exist contact the author of the base (run `snap info core20` to get information for this base).

I don't know what to fill in at "Please add the Canonical Project Manager or contact"

  • Have you successfully run ./runtests.sh static?
15 files would be reformatted, 655 files would be left unchanged.

but I didn't touch those files

  • Have you successfully run ./runtests.sh tests/unit?

Tried to make a Python env, but pip install -r requirements.txt failed with:

    ERROR: Command errored out with exit status 1:
     command: /home/martijn/code/snapcraft/env/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-uweji1s9/libnacl/setup.py'"'"'; __file__='"'"'/tmp/pip-install-uweji1s9/libnacl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-uweji1s9/libnacl/pip-egg-info
         cwd: /tmp/pip-install-uweji1s9/libnacl/
    Complete output (20 lines):
    Traceback (most recent call last):
      File "/tmp/pip-install-uweji1s9/libnacl/libnacl/__init__.py", line 62, in _get_nacl
        return ctypes.cdll.LoadLibrary('tweetnacl.so')
      File "/usr/lib/python3.8/ctypes/__init__.py", line 451, in LoadLibrary
        return self._dlltype(name)
      File "/usr/lib/python3.8/ctypes/__init__.py", line 373, in __init__
        self._handle = _dlopen(self._name, mode)
    OSError: tweetnacl.so: cannot open shared object file: No such file or directory

I believe the tests aren't really relevant to this change though.

@jhenstridge
Copy link
Contributor

IIRC, these docker images are only suitable for building snaps that use the core base snap, as they are built using Ubuntu 16.04.

They include the core18 snap because Snapcraft itself is built against that base. If you tried to build a core18 based snap using these images, you'd likely end up building against and including libraries from 16.04 rather than 18.04. You'd do no better for core20 based snaps.

@martijnbastiaan
Copy link
Author

Thanks @jhenstridge, that explains some things :).

I'm interested in these images because I want to build core20 snaps on (GitLab) CI, while running in a docker container. What seems to work is changing xenial to focal and adding the core20 images. Is this the right way? If so, it'd be great if these could be published on hub.docker.com/r/snapcore/snapcraft/ as I'm sure more people are looking for a way to do this :). I'll happily make the Dockerfiles and amend this PR.

@jhenstridge
Copy link
Contributor

Yes, creating a new image based on ubuntu:focal and including core20 should work. You could probably also drop the core snap from such an image (but keep core18, as Snapcraft itself depends on it).

@sergiusens
Copy link
Collaborator

you might be interested in taking a look at #2673
I will be closing this PR as we cannot bump this without making ci changes and publishing to a different tag while at it.

@sergiusens sergiusens closed this Dec 15, 2020
@martijnbastiaan martijnbastiaan deleted the Dockerfile-core20 branch December 16, 2020 09:06
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.

None yet

3 participants