Fix dependency build issues#70
Conversation
c52a1b4 to
ee807d9
Compare
|
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. |
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>
ee807d9 to
3ea2ad9
Compare
|
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" |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
|
the failing test was the failing k8s test, which has been fixed |
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