Build the filesystem image the shell boots with: a `/home` directory and, if a program is selected for injection, that program stored there as a runnable executable file. A short readme is always present so `ls` has something to show.
(&self)
| 929 | |
| 930 | // HLL roots show display stages from run_full; raw asm roots skip the |
| 931 | // HLL front end and let the preview build below report their errors. |
| 932 | let mut result = if is_asm_path(&path) { |
| 933 | PipelineResult { |
| 934 | diagnostics: Vec::new(), |
| 935 | lex: None, |
| 936 | parse: None, |
| 937 | ir: None, |
| 938 | asm: None, |
| 939 | binary: None, |
| 940 | assembler_error: None, |
| 941 | exec: None, |
| 942 | } |
| 943 | } else { |
| 944 | let mut pipeline = BuildExecutor::pipeline_for(&manifest); |
| 945 | pipeline.set_write_artifacts(false); |
| 946 | pipeline.set_current_source_path(Some(path.clone())); |
| 947 | let mut result = pipeline.run_full(&source, &[]); |
| 948 | result.binary = None; |
| 949 | result.assembler_error = None; |
| 950 | result |
| 951 | }; |
| 952 | |
| 953 | if !result.has_errors() { |
| 954 | match self.build_preview_binary(&manifest, &path, &source) { |
| 955 | Ok(binary) => result.binary = Some(binary), |
| 956 | Err(err) => result.assembler_error = Some(err), |
| 957 | } |
| 958 | } |
| 959 | self.stage_cache = Some(StageCache { |
| 960 | path, |
| 961 | source, |
| 962 | result, |
| 963 | }); |
| 964 | } |
| 965 | |
| 966 | // Reuses the cached per-mode stdlib and the live root buffer so the preview |
| 967 | // link matches reality. |
| 968 | fn build_preview_binary( |
| 969 | &mut self, |
| 970 | manifest: &BuildManifest, |
| 971 | path: &str, |
| 972 | source: &str, |
no test coverage detected