diff --git a/charms/kfp-api/charmcraft.yaml b/charms/kfp-api/charmcraft.yaml index e7fad9d6..3444443c 100644 --- a/charms/kfp-api/charmcraft.yaml +++ b/charms/kfp-api/charmcraft.yaml @@ -36,7 +36,30 @@ parts: after: - python-deps python-requirements: [requirements.txt] + build-packages: + - libffi-dev # Needed to build Python dependencies with Rust from source + - libssl-dev # Needed to build Python dependencies with Rust from source + - pkg-config # Needed to build Python dependencies with Rust from source override-build: | + # Workaround for https://github.com/canonical/charmcraft/issues/2068 + # rustup used to install rustc and cargo, which are needed to build Python dependencies with Rust from source + if [[ "$CRAFT_PLATFORM" == ubuntu@20.04:* || "$CRAFT_PLATFORM" == ubuntu@22.04:* ]] + then + snap install rustup --classic + else + apt-get install rustup -y + fi + + # If Ubuntu version < 24.04, rustup was installed from snap instead of from the Ubuntu + # archive—which means the rustup version could be updated at any time. Print rustup version + # to build log to make changes to the snap's rustup version easier to track + rustup --version + + # rpds-py (Python package) >=0.19.0 requires rustc >=1.76, which is not available in the + # Ubuntu 22.04 archive. Install rustc and cargo using rustup instead of the Ubuntu archive + rustup set profile minimal + rustup default 1.83.0 # renovate: charmcraft-rust-latest + craftctl default # Include requirements.txt in *.charm artifact for easier debugging cp requirements.txt "$CRAFT_PART_INSTALL/requirements.txt" diff --git a/charms/kfp-persistence/charmcraft.yaml b/charms/kfp-persistence/charmcraft.yaml index e7fad9d6..3444443c 100644 --- a/charms/kfp-persistence/charmcraft.yaml +++ b/charms/kfp-persistence/charmcraft.yaml @@ -36,7 +36,30 @@ parts: after: - python-deps python-requirements: [requirements.txt] + build-packages: + - libffi-dev # Needed to build Python dependencies with Rust from source + - libssl-dev # Needed to build Python dependencies with Rust from source + - pkg-config # Needed to build Python dependencies with Rust from source override-build: | + # Workaround for https://github.com/canonical/charmcraft/issues/2068 + # rustup used to install rustc and cargo, which are needed to build Python dependencies with Rust from source + if [[ "$CRAFT_PLATFORM" == ubuntu@20.04:* || "$CRAFT_PLATFORM" == ubuntu@22.04:* ]] + then + snap install rustup --classic + else + apt-get install rustup -y + fi + + # If Ubuntu version < 24.04, rustup was installed from snap instead of from the Ubuntu + # archive—which means the rustup version could be updated at any time. Print rustup version + # to build log to make changes to the snap's rustup version easier to track + rustup --version + + # rpds-py (Python package) >=0.19.0 requires rustc >=1.76, which is not available in the + # Ubuntu 22.04 archive. Install rustc and cargo using rustup instead of the Ubuntu archive + rustup set profile minimal + rustup default 1.83.0 # renovate: charmcraft-rust-latest + craftctl default # Include requirements.txt in *.charm artifact for easier debugging cp requirements.txt "$CRAFT_PART_INSTALL/requirements.txt" diff --git a/charms/kfp-profile-controller/charmcraft.yaml b/charms/kfp-profile-controller/charmcraft.yaml index 5ac4e098..8f3fbd1f 100644 --- a/charms/kfp-profile-controller/charmcraft.yaml +++ b/charms/kfp-profile-controller/charmcraft.yaml @@ -36,7 +36,30 @@ parts: after: - python-deps python-requirements: [requirements.txt] + build-packages: + - libffi-dev # Needed to build Python dependencies with Rust from source + - libssl-dev # Needed to build Python dependencies with Rust from source + - pkg-config # Needed to build Python dependencies with Rust from source override-build: | + # Workaround for https://github.com/canonical/charmcraft/issues/2068 + # rustup used to install rustc and cargo, which are needed to build Python dependencies with Rust from source + if [[ "$CRAFT_PLATFORM" == ubuntu@20.04:* || "$CRAFT_PLATFORM" == ubuntu@22.04:* ]] + then + snap install rustup --classic + else + apt-get install rustup -y + fi + + # If Ubuntu version < 24.04, rustup was installed from snap instead of from the Ubuntu + # archive—which means the rustup version could be updated at any time. Print rustup version + # to build log to make changes to the snap's rustup version easier to track + rustup --version + + # rpds-py (Python package) >=0.19.0 requires rustc >=1.76, which is not available in the + # Ubuntu 22.04 archive. Install rustc and cargo using rustup instead of the Ubuntu archive + rustup set profile minimal + rustup default 1.83.0 # renovate: charmcraft-rust-latest + craftctl default # Include requirements.txt in *.charm artifact for easier debugging cp requirements.txt "$CRAFT_PART_INSTALL/requirements.txt" diff --git a/charms/kfp-schedwf/charmcraft.yaml b/charms/kfp-schedwf/charmcraft.yaml index e7fad9d6..3444443c 100644 --- a/charms/kfp-schedwf/charmcraft.yaml +++ b/charms/kfp-schedwf/charmcraft.yaml @@ -36,7 +36,30 @@ parts: after: - python-deps python-requirements: [requirements.txt] + build-packages: + - libffi-dev # Needed to build Python dependencies with Rust from source + - libssl-dev # Needed to build Python dependencies with Rust from source + - pkg-config # Needed to build Python dependencies with Rust from source override-build: | + # Workaround for https://github.com/canonical/charmcraft/issues/2068 + # rustup used to install rustc and cargo, which are needed to build Python dependencies with Rust from source + if [[ "$CRAFT_PLATFORM" == ubuntu@20.04:* || "$CRAFT_PLATFORM" == ubuntu@22.04:* ]] + then + snap install rustup --classic + else + apt-get install rustup -y + fi + + # If Ubuntu version < 24.04, rustup was installed from snap instead of from the Ubuntu + # archive—which means the rustup version could be updated at any time. Print rustup version + # to build log to make changes to the snap's rustup version easier to track + rustup --version + + # rpds-py (Python package) >=0.19.0 requires rustc >=1.76, which is not available in the + # Ubuntu 22.04 archive. Install rustc and cargo using rustup instead of the Ubuntu archive + rustup set profile minimal + rustup default 1.83.0 # renovate: charmcraft-rust-latest + craftctl default # Include requirements.txt in *.charm artifact for easier debugging cp requirements.txt "$CRAFT_PART_INSTALL/requirements.txt" diff --git a/charms/kfp-ui/charmcraft.yaml b/charms/kfp-ui/charmcraft.yaml index e7fad9d6..3444443c 100644 --- a/charms/kfp-ui/charmcraft.yaml +++ b/charms/kfp-ui/charmcraft.yaml @@ -36,7 +36,30 @@ parts: after: - python-deps python-requirements: [requirements.txt] + build-packages: + - libffi-dev # Needed to build Python dependencies with Rust from source + - libssl-dev # Needed to build Python dependencies with Rust from source + - pkg-config # Needed to build Python dependencies with Rust from source override-build: | + # Workaround for https://github.com/canonical/charmcraft/issues/2068 + # rustup used to install rustc and cargo, which are needed to build Python dependencies with Rust from source + if [[ "$CRAFT_PLATFORM" == ubuntu@20.04:* || "$CRAFT_PLATFORM" == ubuntu@22.04:* ]] + then + snap install rustup --classic + else + apt-get install rustup -y + fi + + # If Ubuntu version < 24.04, rustup was installed from snap instead of from the Ubuntu + # archive—which means the rustup version could be updated at any time. Print rustup version + # to build log to make changes to the snap's rustup version easier to track + rustup --version + + # rpds-py (Python package) >=0.19.0 requires rustc >=1.76, which is not available in the + # Ubuntu 22.04 archive. Install rustc and cargo using rustup instead of the Ubuntu archive + rustup set profile minimal + rustup default 1.83.0 # renovate: charmcraft-rust-latest + craftctl default # Include requirements.txt in *.charm artifact for easier debugging cp requirements.txt "$CRAFT_PART_INSTALL/requirements.txt" diff --git a/charms/kfp-viewer/charmcraft.yaml b/charms/kfp-viewer/charmcraft.yaml index e7fad9d6..3444443c 100644 --- a/charms/kfp-viewer/charmcraft.yaml +++ b/charms/kfp-viewer/charmcraft.yaml @@ -36,7 +36,30 @@ parts: after: - python-deps python-requirements: [requirements.txt] + build-packages: + - libffi-dev # Needed to build Python dependencies with Rust from source + - libssl-dev # Needed to build Python dependencies with Rust from source + - pkg-config # Needed to build Python dependencies with Rust from source override-build: | + # Workaround for https://github.com/canonical/charmcraft/issues/2068 + # rustup used to install rustc and cargo, which are needed to build Python dependencies with Rust from source + if [[ "$CRAFT_PLATFORM" == ubuntu@20.04:* || "$CRAFT_PLATFORM" == ubuntu@22.04:* ]] + then + snap install rustup --classic + else + apt-get install rustup -y + fi + + # If Ubuntu version < 24.04, rustup was installed from snap instead of from the Ubuntu + # archive—which means the rustup version could be updated at any time. Print rustup version + # to build log to make changes to the snap's rustup version easier to track + rustup --version + + # rpds-py (Python package) >=0.19.0 requires rustc >=1.76, which is not available in the + # Ubuntu 22.04 archive. Install rustc and cargo using rustup instead of the Ubuntu archive + rustup set profile minimal + rustup default 1.83.0 # renovate: charmcraft-rust-latest + craftctl default # Include requirements.txt in *.charm artifact for easier debugging cp requirements.txt "$CRAFT_PART_INSTALL/requirements.txt" diff --git a/charms/kfp-viz/charmcraft.yaml b/charms/kfp-viz/charmcraft.yaml index e7fad9d6..3444443c 100644 --- a/charms/kfp-viz/charmcraft.yaml +++ b/charms/kfp-viz/charmcraft.yaml @@ -36,7 +36,30 @@ parts: after: - python-deps python-requirements: [requirements.txt] + build-packages: + - libffi-dev # Needed to build Python dependencies with Rust from source + - libssl-dev # Needed to build Python dependencies with Rust from source + - pkg-config # Needed to build Python dependencies with Rust from source override-build: | + # Workaround for https://github.com/canonical/charmcraft/issues/2068 + # rustup used to install rustc and cargo, which are needed to build Python dependencies with Rust from source + if [[ "$CRAFT_PLATFORM" == ubuntu@20.04:* || "$CRAFT_PLATFORM" == ubuntu@22.04:* ]] + then + snap install rustup --classic + else + apt-get install rustup -y + fi + + # If Ubuntu version < 24.04, rustup was installed from snap instead of from the Ubuntu + # archive—which means the rustup version could be updated at any time. Print rustup version + # to build log to make changes to the snap's rustup version easier to track + rustup --version + + # rpds-py (Python package) >=0.19.0 requires rustc >=1.76, which is not available in the + # Ubuntu 22.04 archive. Install rustc and cargo using rustup instead of the Ubuntu archive + rustup set profile minimal + rustup default 1.83.0 # renovate: charmcraft-rust-latest + craftctl default # Include requirements.txt in *.charm artifact for easier debugging cp requirements.txt "$CRAFT_PART_INSTALL/requirements.txt"