Skip to content
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

Add support for Ubuntu 18.04 to installer #1231

Merged
merged 7 commits into from
May 31, 2022

Conversation

tedinski
Copy link
Contributor

@tedinski tedinski commented May 26, 2022

Description of changes:

  1. Lower version for "release bundle" tests to build on 18.04 just like normal releases (for glibc compatibility)
  2. Test install on both 18.04 and 20.04
  3. An unfortunately ugly fix for the bug on 18.04 with python pip

Resolved issues:

Resolves #1184

Call-outs:

  1. Introduced os_hacks to kani-verifier, as a place to hopefully confine os-specific logic without making it harder to see the general case. I'll be adding a nixos one next.
  2. The os_info crate was just the first one I found for this purpose basically...

Testing:

  • How is this change tested? docker test

  • Is this a refactor change? no

Checklist

  • Each commit message has a non-empty body, explaining why the change was made
  • Methods or procedures are documented
  • Regression or unit tests are included, or existing tests cover the modified code
  • My PR is restricted to a single feature or bugfix

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

@tedinski tedinski requested a review from a team as a code owner May 26, 2022 23:14
include:
- os: macos-10.15
artifact: kani-latest-x86_64-apple-darwin.tar.gz
- os: ubuntu-20.04
- os: ubuntu-18.04
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to get rid of ubuntu-20? Or should we have it as a third option

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"get rid of" in what sense? Are you saying not building the regressions (currently 18, 20, and mac) there anymore?

I would sort of endorse that, in that I think we don't need the regressions running on two linux platforms... but what we DO need is "install/smoke testing" running on multiple linux platforms... which is sort of what this is simulating, but it's not good enough yet.

I spent an hour with a whiteboard yesterday trying to sketch out what I thought we'd ideally want to work towards in terms of CI flow and found it a bit frustratingly complicated. I might write up a doc/proposal soon...

Copy link
Contributor

Choose a reason for hiding this comment

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

@danielsn Note that this is for building the release bundle, and we're building a single bundle for both Ubuntu 18.04 and Ubuntu 20.04.

@@ -19,6 +19,7 @@ include = ["/src", "/build.rs", "/rust-toolchain.toml", "/LICENSE-*", "/README.m
[dependencies]
anyhow = "1"
home = "0.5"
os_info = { version = "3", default-features = false }
Copy link
Contributor

Choose a reason for hiding this comment

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

cargo uses os_info so probably a good choice :) https://crates.io/crates/os_info/reverse_dependencies

let pkg_versions = &["cbmc-viewer==3.2", "colorama==0.4.3"];

if os.os_type() == os_info::Type::Ubuntu
&& *os.version() == os_info::Version::Semantic(18, 4, 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a risk there will be an 18.4.1?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think there is not a risk of that because I think it's already running on "18.4.4" and not picking that up. I believe what's happening is it's parsing "18.04" as if it were a version number.

I agree this is seems fragile but this unit test seems to confirm this is the expected behavior: https://github.com/stanislav-tkach/os_info/blob/master/os_info/src/linux/lsb_release.rs#L317-L318

include:
- os: macos-10.15
artifact: kani-latest-x86_64-apple-darwin.tar.gz
- os: ubuntu-20.04
- os: ubuntu-18.04
Copy link
Contributor

Choose a reason for hiding this comment

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

@danielsn Note that this is for building the release bundle, and we're building a single bundle for both Ubuntu 18.04 and Ubuntu 20.04.

src/os_hacks.rs Outdated
mv_cmd.push("cp -r ");
mv_cmd.push(pyroot.as_os_str());
mv_cmd.push("/lib/python*/site-packages/* ");
mv_cmd.push(pyroot.as_os_str());
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a risk that the target directory is not writeable (or requires sudo)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, pyroot here is ~/.kani/kani-VERSION/pyroot and we created it.

src/os_hacks.rs Outdated

// Step 2: move `pyroot/lib/python3.6/site-packages/*` up to `pyroot`
// This seems to successfully replicate the behavior of `--target`
// "mv" is not idempotent however so we need to do "cp -r"
Copy link
Contributor

Choose a reason for hiding this comment

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

If we're doing cp instead of mv, should we:

  1. Rename the variable
  2. Delete the source directory after copying it
    ?
    I'm a bit unclear on the issue with mv.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

mv makes the setup procedure non-idempotent because it fails if the directory already exists (from a previous install).

I can rename the variable and delete the extra directory, that seems reasonable.

@tedinski tedinski merged commit 45f45f4 into model-checking:main May 31, 2022
@tedinski tedinski deleted the ubuntu-1804 branch May 31, 2022 18:38
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.

cargo-kani setup fails due to python distutils error on Ubuntu 18.04.2
3 participants