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

snap: Add rust to build-packages #682

Merged
merged 3 commits into from
Nov 13, 2024
Merged

snap: Add rust to build-packages #682

merged 3 commits into from
Nov 13, 2024

Conversation

freyes
Copy link
Contributor

@freyes freyes commented Nov 13, 2024

When building the snap on s390x some Python modules need to compile their extensions (rust based), this is not needed on amd64 since pypi has compiled packages available.

This change add rustc, cargo and pkg-config to the list of build-packages in the snapcraft.yaml definition.

Description of change

Checklist

  • Are all your commits [logically] grouped and squashed appropriately?

When building the snap on s390x some Python modules need to compile
their extensions (rust based), this is not needed on amd64 since pypi
has compiled packages available.

This change add rustc, cargo and pkg-config to the list of
build-packages in the snapcraft.yaml definition.
@freyes
Copy link
Contributor Author

freyes commented Nov 13, 2024

build log on s390x - https://launchpadlibrarian.net/758496706/buildlog_snap_ubuntu_bionic_s390x_charm-tools.2x_BUILDING.txt.gz

...
  copying src/cryptography/hazmat/bindings/_rust/openssl/__init__.pyi -> build/lib.linux-s390x-3.6/cryptography/hazmat/bindings/_rust/openssl
  copying src/cryptography/hazmat/bindings/_rust/openssl/x25519.pyi -> build/lib.linux-s390x-3.6/cryptography/hazmat/bindings/_rust/openssl
  running build_ext
  running build_rust
  
      =============================DEBUG ASSISTANCE=============================
      If you are seeing a compilation error please try the following steps to
      successfully install cryptography:
      1) Upgrade to the latest pip and try again. This will fix errors for most
         users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
      2) Read https://cryptography.io/en/latest/installation/ for specific
         instructions for your platform.
      3) Check our frequently asked questions for more information:
         https://cryptography.io/en/latest/faq/
      4) Ensure you have a recent Rust toolchain installed:
         https://cryptography.io/en/latest/installation/#rust
  
      Python: 3.6.9
      platform: Linux-5.4.0-200-generic-s390x-with-Ubuntu-18.04-bionic
      pip: n/a
      setuptools: 59.6.0
      setuptools_rust: 1.1.2
      rustc: n/a
      =============================DEBUG ASSISTANCE=============================
  
  error: can't find Rust compiler
  
  If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.
  
  To update pip, run:
  
      pip install --upgrade pip
  
  and then retry package installation.
  
  If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
  
  This package requires Rust >=1.48.0.
  ----------------------------------------
  ERROR: Failed building wheel for cryptography

@javacruft javacruft merged commit b8747e0 into juju:master Nov 13, 2024
6 checks passed
freyes added a commit to freyes/charm-tools that referenced this pull request Nov 13, 2024
* snap: Add rust to build-packages

When building the snap on s390x some Python modules need to compile
their extensions (rust based), this is not needed on amd64 since pypi
has compiled packages available.

This change add rustc, cargo and pkg-config to the list of
build-packages in the snapcraft.yaml definition.

* Migrate gh action actions/upload-artifact@v4

* Migration gh action actions/download-artifact@v4

The backport was adjusted to use build-snap.yml workflow instead of
test.yml

(cherry picked from commit b8747e0)
freyes added a commit to freyes/charm-tools that referenced this pull request Nov 13, 2024
* snap: Add rust to build-packages

When building the snap on s390x some Python modules need to compile
their extensions (rust based), this is not needed on amd64 since pypi
has compiled packages available.

This change add rustc, cargo and pkg-config to the list of
build-packages in the snapcraft.yaml definition.

* Migrate gh action actions/upload-artifact@v4

* Migration gh action actions/download-artifact@v4

The backport was adjusted to use build-snap.yml workflow instead of
test.yml

(cherry picked from commit b8747e0)
javacruft pushed a commit that referenced this pull request Nov 13, 2024
* snap: Add rust to build-packages (#682)

* snap: Add rust to build-packages

When building the snap on s390x some Python modules need to compile
their extensions (rust based), this is not needed on amd64 since pypi
has compiled packages available.

This change add rustc, cargo and pkg-config to the list of
build-packages in the snapcraft.yaml definition.

* Migrate gh action actions/upload-artifact@v4

* Migration gh action actions/download-artifact@v4

The backport was adjusted to use build-snap.yml workflow instead of
test.yml

(cherry picked from commit b8747e0)

* Use libpython3.6-dev

The 2.8 branch uses core18 to build the snap on, python 3.10 is not
available, python 3.6 is the version available in Ubuntu 18.04 (Xenial)

* Use '7.x' snapcraft channel

snapcraft-7.x is the last release with core18 support
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