-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Enable building rust dependencies (#631)
- Loading branch information
Showing
7 changed files
with
161 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" == [email protected]:* || "$CRAFT_PLATFORM" == [email protected]:* ]] | ||
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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" == [email protected]:* || "$CRAFT_PLATFORM" == [email protected]:* ]] | ||
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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" == [email protected]:* || "$CRAFT_PLATFORM" == [email protected]:* ]] | ||
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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" == [email protected]:* || "$CRAFT_PLATFORM" == [email protected]:* ]] | ||
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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" == [email protected]:* || "$CRAFT_PLATFORM" == [email protected]:* ]] | ||
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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" == [email protected]:* || "$CRAFT_PLATFORM" == [email protected]:* ]] | ||
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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" == [email protected]:* || "$CRAFT_PLATFORM" == [email protected]:* ]] | ||
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" | ||
|