| author | |
| committer | |
| log | 5a4b5b549b606bdad026b977fd3fa669b6f7070d |
| tree | ed1246d12e51c178e57163b882dce9069479546f |
| parent | d707e37ec2e095114a14ce3e4cfc6a04bd0dfd53 |
When an artifact arg is added to a Run step, if the artifact is
installed, then the installation path is added rather than the cache
artifact path. This is probably something that should change in the
future, but the goal of this branch is to generally avoid breakage other
than that caused by phase separation.3 files changed, 11 insertions(+), 7 deletions(-)
lib/compiler/Maker/Step/Compile.zig+2| ... | ... | @@ -20,6 +20,8 @@ const Maker = @import("../../Maker.zig"); |
| 20 | 20 | zig_process: ?*Step.ZigProcess = null, |
| 21 | 21 | /// Persisted to reuse memory on subsequent calls to `make`. |
| 22 | 22 | zig_args: std.ArrayList([]const u8) = .empty, |
| 23 | /// Populated by InstallArtifact. | |
| 24 | installed_path: ?Path = null, | |
| 23 | 25 | |
| 24 | 26 | pub fn make( |
| 25 | 27 | compile: *Compile, |
lib/compiler/Maker/Step/InstallArtifact.zig+4| ... | ... | @@ -55,6 +55,10 @@ pub fn make( |
| 55 | 55 | |
| 56 | 56 | if (conf_ia.flags.dylib_symlinks) |
| 57 | 57 | try maker.installSymLinks(arena, dest_path, compile_step_index, step_index); |
| 58 | ||
| 59 | const make_comp_step = maker.stepByIndex(compile_step_index); | |
| 60 | const make_comp = &make_comp_step.extended.compile; | |
| 61 | make_comp.installed_path = dest_path; | |
| 58 | 62 | } |
| 59 | 63 | } |
| 60 | 64 |
lib/compiler/Maker/Step/Run.zig+5-7| ... | ... | @@ -132,22 +132,20 @@ pub fn make( |
| 132 | 132 | const root_module = producer.root_module.get(conf); |
| 133 | 133 | const root_module_target = root_module.resolved_target.get(conf).?.result.get(conf); |
| 134 | 134 | const os_tag = root_module_target.flags.os_tag.unwrap().?; |
| 135 | ||
| 136 | if (true) @panic("TODO"); | |
| 135 | const producer_make_comp_step = maker.stepByIndex(producer_index); | |
| 136 | const producer_make_comp = &producer_make_comp_step.extended.compile; | |
| 137 | 137 | |
| 138 | 138 | if (os_tag == .windows) { |
| 139 | 139 | // On Windows we don't have rpaths so we have to add .dll search paths to PATH |
| 140 | 140 | addPathForDynLibs(producer_index); |
| 141 | 141 | } |
| 142 | const file_path = producer_index.installed_path orelse producer_index.generated_bin.?.path.?; | |
| 142 | const file_path = producer_make_comp.installed_path orelse maker.generatedPath(producer.generated_bin.value.?).*; | |
| 143 | 143 | |
| 144 | 144 | argv_list.appendAssumeCapacity(try mem.concat(arena, u8, &.{ |
| 145 | prefix, | |
| 146 | try convertPathArg(run_index, maker, .{ .root_dir = .cwd(), .sub_path = file_path }), | |
| 147 | suffix, | |
| 145 | prefix, try convertPathArg(run_index, maker, file_path), suffix, | |
| 148 | 146 | })); |
| 149 | 147 | |
| 150 | _ = try man.addFile(file_path, null); | |
| 148 | _ = try man.addFilePath(file_path, null); | |
| 151 | 149 | }, |
| 152 | 150 | .output_file, .output_directory => { |
| 153 | 151 | const prefix = if (arg.prefix.value) |p| p.slice(conf) else ""; |