Skip to content

Fix dependency build issues#70

Merged
crypticC0der merged 2 commits intocanonical:mainfrom
gboutry:chore/build-backend
Mar 30, 2026
Merged

Fix dependency build issues#70
crypticC0der merged 2 commits intocanonical:mainfrom
gboutry:chore/build-backend

Conversation

@gboutry
Copy link
Copy Markdown
Contributor

@gboutry gboutry commented Mar 25, 2026

fix: ensure cargo is available for maturin source builds

This prevents maturin from trying to download cargo (which fails in the charmcraft build container on building puccinialin) and instead uses a well defined rust toolchain version.

Follows examples from the data platform team[0].

0: https://github.com/canonical/opensearch-operator/blob/2ce3ea4186d193b7bef0ba5baa06d900168b8d67/charmcraft.yaml#L77

chore: exclude bugged setuptools-scm versions

Ensure setuptools-scm cyclic dependencies affected versions are excluded from the build dependencies.

Related-Bug: pypa/setuptools-scm#1302

@gboutry gboutry requested a review from a team as a code owner March 25, 2026 23:34
@gboutry gboutry force-pushed the chore/build-backend branch from c52a1b4 to ee807d9 Compare March 25, 2026 23:43
@gboutry
Copy link
Copy Markdown
Contributor Author

gboutry commented Mar 25, 2026

Force push is changing the way to override cargo. I felt the first instance of using update-alternatives was a bit too dirty, and using Maturin documented environment variables felt better.

gboutry added 2 commits March 27, 2026 00:44
This prevents maturin from trying to download cargo (which fails in
the charmcraft build container on building puccinialin) and instead uses
a well defined rust toolchain version.

Follows examples from the data platform team[0].

0: https://github.com/canonical/opensearch-operator/blob/2ce3ea4186d193b7bef0ba5baa06d900168b8d67/charmcraft.yaml#L77

Signed-off-by: Guillaume Boutry <guillaume.boutry@canonical.com>
Ensure setuptools-scm cyclic dependencies affected versions are excluded
from the build dependencies.

Related-Bug: pypa/setuptools-scm#1302
Signed-off-by: Guillaume Boutry <guillaume.boutry@canonical.com>
@gboutry gboutry force-pushed the chore/build-backend branch from ee807d9 to 3ea2ad9 Compare March 26, 2026 23:56
@gboutry gboutry changed the title fix: ensure cargo is available for maturin source builds Fix dependency build issues Mar 26, 2026
@gboutry
Copy link
Copy Markdown
Contributor Author

gboutry commented Mar 26, 2026

Ok, back on a new method. After multiple failed attempt. This looks like the most promising way.

- rustc-1.85
build-environment:
- PIP_CONSTRAINT: constraints.txt
- MATURIN_NO_INSTALL_RUST: "1"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I was unaware that maturin would go ahead and download a compiler from the internet.

plugin: poetry
after: [poetry-deps]
override-build: |
echo "setuptools-scm<10.0.0" > constraints.txt
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we could also just have a constraints file somewhere in the repository, but I'll defer to @crypticC0der for their opinion

override-build: |
craftctl default
rustup set profile minimal
rustup default 1.92.0
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have previously blocked @crypticC0der's attempt at using rustup due to risk of change of compiler version preventing reproducibility, and I guess specifying an exact version makes it more palatable.

Would still prefer if we could use a vendored binary from something Ubuntu, but as you discovered maturin has been downloading rust compilers from the internet behind our backs already.

So would be happy to do this until we find a better solution so that we can unblock CI and LP builds.

@gboutry
Copy link
Copy Markdown
Contributor Author

gboutry commented Mar 27, 2026

@crypticC0der
Copy link
Copy Markdown
Collaborator

the failing test was the failing k8s test, which has been fixed
merging

@crypticC0der crypticC0der merged commit dde0c11 into canonical:main Mar 30, 2026
74 of 80 checks passed
@gboutry gboutry deleted the chore/build-backend branch March 30, 2026 17:49
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.

3 participants