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

python and poetry plugins include lib64 symlink as a second copy of the venv #1966

Open
lengau opened this issue Oct 17, 2024 · 1 comment · May be fixed by #1968
Open

python and poetry plugins include lib64 symlink as a second copy of the venv #1966

lengau opened this issue Oct 17, 2024 · 1 comment · May be fixed by #1968
Assignees
Labels
Bug Something isn't working triaged

Comments

@lengau
Copy link
Collaborator

lengau commented Oct 17, 2024

Bug Description

When using the python or poetry plugin, a second copy of the lib directory is created in lib64 because it's a symlink. The charm works fine without that symlink, so we should just remove lib64 if it's a symlink. (If it's a directory, leave it.)

To Reproduce

Pack the charm below and view it in a zip file viewer

Environment

irrelevant

charmcraft.yaml

# This file configures Charmcraft.
# See https://juju.is/docs/sdk/charmcraft-config for guidance.

# (Required)
# The charm package name, no spaces
# See https://juju.is/docs/sdk/naming#heading--naming-charms for guidance.
name: basic-charm


# (Required)
# The charm type, either 'charm' or 'bundle'.
type: charm


# (Recommended)
title: Charm Template


# (Required)
summary: A very short one-line summary of the charm.


# (Required)
description: |
A single sentence that says what the charm is, concisely and memorably.

A paragraph of one to three short sentences, that describe what the charm does.

A third paragraph that explains what need the charm meets.

Finally, a paragraph that describes whom the charm is useful for.


# (Required for 'charm' type)
# A list of environments (OS version and architecture) where charms must be
# built on and run on.
bases:
- build-on:
- name: ubuntu
channel: "22.04"
run-on:
- name: ubuntu
channel: "22.04"


# (Optional) Configuration options for the charm
# This config section defines charm config options, and populates the Configure
# tab on Charmhub.
# More information on this section at https://juju.is/docs/sdk/charmcraft-yaml#heading--config
# General configuration documentation: https://juju.is/docs/sdk/config
config:
options:
# An example config option to customise the log level of the workload
log-level:
description: |
Configures the log level of gunicorn.

Acceptable values are: "info", "debug", "warning", "error" and "critical"
default: "info"
type: string


# The containers and resources metadata apply to Kubernetes charms only.
# See https://juju.is/docs/sdk/metadata-reference for a checklist and guidance.
# Remove them if not required.


# Your workload’s containers.
containers:
httpbin:
resource: httpbin-image


# This field populates the Resources tab on Charmhub.
resources:
# An OCI image resource for each container listed above.
# You may remove this if your charm will run without a workload sidecar container.
httpbin-image:
type: oci-image
description: OCI image for httpbin
# The upstream-source field is ignored by Juju. It is included here as a
# reference so the integration testing suite knows which image to deploy
# during testing. This field is also used by the 'canonical/charming-actions'
# Github action for automated releasing.
upstream-source: kennethreitz/httpbin


parts:
my-charm:
plugin: python
source: .
python-requirements: [requirements.txt]
override-build: |
/usr/bin/python3 -m pip install -U pip@https://files.pythonhosted.org/packages/d4/55/90db48d85f7689ec6f81c0db0622d704306c5284850383c090e6c7195a5c/pip-24.2-py3-none-any.whl
craftctl default

Relevant log output

n/a
@lengau lengau added Bug Something isn't working triaged labels Oct 17, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-3587.

This message was autogenerated

lengau added a commit that referenced this issue Oct 17, 2024
Fixes #1966

The lib64 directory exists as a symbolic link in virtual environments
for historic reasons, but is not necessary.

This prevents the charm from packing it twice (due to Python's inability
to put symlinks into zip files).
lengau added a commit that referenced this issue Oct 17, 2024
Fixes #1966

The lib64 directory exists as a symbolic link in virtual environments
for historic reasons, but is not necessary.

This prevents the charm from packing it twice (due to Python's inability
to put symlinks into zip files).
@lengau lengau self-assigned this Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant