|
5 | 5 | //! In this folder, you can find the following folders: |
6 | 6 | //! - `bin/`: Where all Kani binaries will be located. |
7 | 7 | //! - `lib/`: Kani libraries as well as rust standard libraries. |
8 | | -//! - `legacy-lib/`: Kani libraries built based on the the toolchain standard libraries. |
9 | 8 | //! |
10 | 9 | //! Rustc expects the sysroot to have a specific folder layout: |
11 | 10 | //! `{SYSROOT}/rustlib/<target-triplet>/lib/<libraries>` |
@@ -50,15 +49,6 @@ pub fn kani_sysroot_lib() -> PathBuf { |
50 | 49 | path_buf!(kani_sysroot(), "lib") |
51 | 50 | } |
52 | 51 |
|
53 | | -/// Returns the path to where Kani pre-compiled library are stored. |
54 | | -/// |
55 | | -/// The legacy libraries are compiled on the top of rustup sysroot. Using it results in missing |
56 | | -/// symbols. This is still needed though because when we use the rust monomorphizer as our |
57 | | -/// reachability algorithm, the resulting boundaries are different than the new sysroot. |
58 | | -pub fn kani_sysroot_legacy_lib() -> PathBuf { |
59 | | - path_buf!(kani_sysroot(), "legacy-lib") |
60 | | -} |
61 | | - |
62 | 52 | /// Returns the path to where Kani's pre-compiled binaries are stored. |
63 | 53 | pub fn kani_sysroot_bin() -> PathBuf { |
64 | 54 | path_buf!(kani_sysroot(), "bin") |
@@ -197,44 +187,6 @@ fn build_artifacts(cargo_cmd: &mut Child) -> Vec<Artifact> { |
197 | 187 | .collect() |
198 | 188 | } |
199 | 189 |
|
200 | | -/// Build Kani libraries using the regular rust toolchain standard libraries. |
201 | | -/// We should be able to remove this once the MIR linker is stable. |
202 | | -pub fn build_lib_legacy() { |
203 | | - // Run cargo build with -Z build-std |
204 | | - let target_dir = env!("KANI_LEGACY_LIBS"); |
205 | | - let args = [ |
206 | | - "build", |
207 | | - "-p", |
208 | | - "std", |
209 | | - "-p", |
210 | | - "kani", |
211 | | - "-p", |
212 | | - "kani_macros", |
213 | | - "--target-dir", |
214 | | - target_dir, |
215 | | - "--message-format", |
216 | | - "json-diagnostic-rendered-ansi", |
217 | | - ]; |
218 | | - let mut child = Command::new("cargo") |
219 | | - .env("CARGO_ENCODED_RUSTFLAGS", ["--cfg=kani"].join("\x1f")) |
220 | | - .args(args) |
221 | | - .stdout(Stdio::piped()) |
222 | | - .spawn() |
223 | | - .expect("Failed to build Kani libraries."); |
224 | | - |
225 | | - // Collect the build artifacts. |
226 | | - let artifacts = build_artifacts(&mut child); |
227 | | - let _ = child.wait().expect("Couldn't get cargo's exit status"); |
228 | | - |
229 | | - // Create sysroot folder. |
230 | | - let legacy_lib = kani_sysroot_legacy_lib(); |
231 | | - legacy_lib.exists().then(|| fs::remove_dir_all(&legacy_lib)); |
232 | | - fs::create_dir_all(&legacy_lib).expect(&format!("Failed to create {legacy_lib:?}")); |
233 | | - |
234 | | - // Copy Kani libraries to inside the legacy-lib folder. |
235 | | - copy_libs(&artifacts, &legacy_lib, &is_kani_lib); |
236 | | -} |
237 | | - |
238 | 190 | /// Extra arguments to be given to `cargo build` while building Kani's binaries. |
239 | 191 | /// Note that the following arguments are always provided: |
240 | 192 | /// ```bash |
|
0 commit comments