Skip to content

Integrate Rust into the build process properly #5410

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

Merged
merged 1 commit into from
Dec 22, 2020

Conversation

alex
Copy link
Member

@alex alex commented Aug 16, 2020

@alex
Copy link
Member Author

alex commented Aug 16, 2020

@ianw Do you have an idea for what the best way to install Rust in the builders is? I can rustup.sh easily enough, but I'm not sure what I need to change to add things to the PATH.

@opendev-zuul

This comment has been minimized.

@opendev-zuul

This comment has been minimized.

@opendev-zuul

This comment has been minimized.

@opendev-zuul

This comment has been minimized.

@opendev-zuul

This comment has been minimized.

@ianw
Copy link
Contributor

ianw commented Aug 17, 2020

@ianw Do you have an idea for what the best way to install Rust in the builders is? I can rustup.sh easily enough, but I'm not sure what I need to change to add things to the PATH.

Seems like we should add a role to zuul-jobs to install rust so that everyone can benefit :)

I've started with that @ https://review.opendev.org/#/c/746423/ which should be sufficient for this case.

To use that we can just add to .zuul.playbooks/playbooks/tox/main.yaml

- name: Install rust
  include_role:
    name: ensure-rust

anywhere before the tox run.

This has to pass review. However, until it is committed you should be able to speculatively test a change like above by adding to your change description

Depends-On: https://review.opendev.org/746423

This will instruct Zuul to apply this change before running (Zuul would not allow the change to merge with a Depends-On that isn't committed, but in this case you should be careful not to push it without us either merging the change or taking some other approach).

@opendev-zuul

This comment has been minimized.

@ianw
Copy link
Contributor

ianw commented Aug 17, 2020

This has to pass review. However, until it is committed you should be able to speculatively test a change like above by adding to your change description

Depends-On: https://review.opendev.org/746423

It has been pointed out to me that this needs to be in the PR description, not the change description (that's a bit different to Gerrit).

@alex alex force-pushed the rust-noop branch 2 times, most recently from 34a9a33 to ee7852e Compare August 17, 2020 13:49
@opendev-zuul

This comment has been minimized.

@opendev-zuul

This comment has been minimized.

@alex alex force-pushed the rust-noop branch 9 times, most recently from 16862f4 to 3107382 Compare August 27, 2020 05:55
@alex alex force-pushed the rust-noop branch 9 times, most recently from 1f23f0c to 0cdf36b Compare December 22, 2020 17:23
@StefanCristian
Copy link

Hello @alex, @reaperhulk , is this going to be optional? My containers (& implicitly also our whole work even on non-containers) depend exclusively on Python in production, and unfortunately I add cannot additional languages since it would break the development, build & release cycles a bit too much.

Our end goal is to deliver as less as possible, strictly python. There are some horrible and stressful security guidelines that would be required to add a additional language & compilers to work with and it would take some years, possibly, judging by the companies necessities.

@alex
Copy link
Member Author

alex commented Feb 12, 2021

You already posted this, and received an answer, on c84d6ee

@StefanCristian
Copy link

This is optional for the 3.4.x release, but required afterwards. Rust is only required at build time, so you should be able to install rust in a build container, but not include in a release container.

@alex thank you for replying. When speaking about very-high secured medium, we cannot have additional compiled binaries with other programming languages, especially not optimized ones and not ones under our control, shipped into the release medium. I gave the container as a example, as I'm not speaking only of containers.
It's going to be a security issue that we will have no possibility of handling.

Is there any other solution? Will you include a option to remove in case things go wrong?

@alex
Copy link
Member Author

alex commented Feb 13, 2021 via email

@reaperhulk
Copy link
Member

There will not be any option to use cryptography without rust being part of the compilation process starting with our next release, no.

@StefanCristian
Copy link

@alex I have shared with you all I could. Please find that the reasons behind are holistic and not resume to only security.

@reaperhulk what would it take to have on/off switch for rust compilation? Do you plan on replacing the C code completely?

@reaperhulk
Copy link
Member

You can see more information about what our plans for rust are in #5810 (comment). There will not be an on/off switch, no. The core cryptographic primitives will remain OpenSSL and there are no plans to change that.

@StefanCristian
Copy link

@reaperhulk Thank you kindly. I will not be participating in the discussion since your plans are already decided.

Even though a decision on our side is not yet here, we might be forced to abandon the library entirely, in time.

@luke-jr
Copy link

luke-jr commented Jun 20, 2022

Rust isn't bootstrappable on non-x86, so not available for security-minded folks on other platforms.

Guess I'm going to have to figure out a way to avoid pyca :/

@alex
Copy link
Member Author

alex commented Jun 20, 2022

Debian/RHEL/Alpine manage to bootstrap Rust on a variety of other architectures, I suspect if you look into what they're doing you'll find a solution to your problem.

@luke-jr
Copy link

luke-jr commented Jun 20, 2022

Likely they bootstrapped an ancient version and just continued to use newer versions to build each subsequent. Not practical to do from scratch today.

@reaperhulk
Copy link
Member

Ignoring the existence proof isn’t a productive path. If there exists an issue with bootstrapping enumerating the challenges and then working towards their elimination with the rust and llvm community sounds like a worthy project though. Rust’s prominence continues to increase so just asking people not to use it isn’t a long term viable path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants