| author | |
| committer | |
| log | 3d393dba6fc06cea3508aaa3db9d49042663367e |
| tree | d377f0aa22b7ed353a44e61a9fe7554ffa6c7707 |
| parent | debba652a3f5af76840517321d389a2ec98a88f4 |
| signature |
These APIs were all deprecated prior to the release of 0.13.0, so can be
safety removed in the current release cycle.
`std.Build`:
* `host` -> `graph.host`
`std.Build.Step.Compile`:
* `setLinkerScriptPath` -> `setLinkerScript`
* `defineCMacro` -> `root_module.addCMacro`
* `linkFrameworkNeeded`-> `root_module.linkFramework`
* `linkFrameworkWeak`-> `root_module.linkFramework`
`std.Build.Step.ObjCopy`:
* `getOutputSource` -> `getOutput`
`std.Build.Step.Options`:
* `addOptionArtifact` -> `addOptionPath`
* `getSource` -> `getOutput`
`std.Build.Step.Run`:
* `extra_file_dependencies` -> `addFileInput`
* `addDirectorySourceArg` -> `addDirectoryArg`
* `addPrefixedDirectorySourceArg` -> `addPrefixedDirectoryArg`9 files changed, 9 insertions(+), 56 deletions(-)
lib/std/Build.zig-5| ... | @@ -81,9 +81,6 @@ enable_wine: bool = false, | ... | @@ -81,9 +81,6 @@ enable_wine: bool = false, |
| 81 | /// that contains the path `aarch64-linux-gnu/lib/ld-linux-aarch64.so.1`. | 81 | /// that contains the path `aarch64-linux-gnu/lib/ld-linux-aarch64.so.1`. |
| 82 | glibc_runtimes_dir: ?[]const u8 = null, | 82 | glibc_runtimes_dir: ?[]const u8 = null, |
| 83 | 83 | ||
| 84 | /// Deprecated. Use `b.graph.host`. | ||
| 85 | host: ResolvedTarget, | ||
| 86 | |||
| 87 | dep_prefix: []const u8 = "", | 84 | dep_prefix: []const u8 = "", |
| 88 | 85 | ||
| 89 | modules: std.StringArrayHashMap(*Module), | 86 | modules: std.StringArrayHashMap(*Module), |
| ... | @@ -301,7 +298,6 @@ pub fn create( | ... | @@ -301,7 +298,6 @@ pub fn create( |
| 301 | }, | 298 | }, |
| 302 | .install_path = undefined, | 299 | .install_path = undefined, |
| 303 | .args = null, | 300 | .args = null, |
| 304 | .host = graph.host, | ||
| 305 | .modules = .init(arena), | 301 | .modules = .init(arena), |
| 306 | .named_writefiles = .init(arena), | 302 | .named_writefiles = .init(arena), |
| 307 | .named_lazy_paths = .init(arena), | 303 | .named_lazy_paths = .init(arena), |
| ... | @@ -393,7 +389,6 @@ fn createChildOnly( | ... | @@ -393,7 +389,6 @@ fn createChildOnly( |
| 393 | .enable_wasmtime = parent.enable_wasmtime, | 389 | .enable_wasmtime = parent.enable_wasmtime, |
| 394 | .enable_wine = parent.enable_wine, | 390 | .enable_wine = parent.enable_wine, |
| 395 | .glibc_runtimes_dir = parent.glibc_runtimes_dir, | 391 | .glibc_runtimes_dir = parent.glibc_runtimes_dir, |
| 396 | .host = parent.host, | ||
| 397 | .dep_prefix = parent.fmt("{s}{s}.", .{ parent.dep_prefix, dep_name }), | 392 | .dep_prefix = parent.fmt("{s}{s}.", .{ parent.dep_prefix, dep_name }), |
| 398 | .modules = .init(allocator), | 393 | .modules = .init(allocator), |
| 399 | .named_writefiles = .init(allocator), | 394 | .named_writefiles = .init(allocator), |
lib/std/Build/Step/Compile.zig-18| ... | @@ -583,9 +583,6 @@ pub fn checkObject(compile: *Compile) *Step.CheckObject { | ... | @@ -583,9 +583,6 @@ pub fn checkObject(compile: *Compile) *Step.CheckObject { |
| 583 | return Step.CheckObject.create(compile.step.owner, compile.getEmittedBin(), compile.rootModuleTarget().ofmt); | 583 | return Step.CheckObject.create(compile.step.owner, compile.getEmittedBin(), compile.rootModuleTarget().ofmt); |
| 584 | } | 584 | } |
| 585 | 585 | ||
| 586 | /// deprecated: use `setLinkerScript` | ||
| 587 | pub const setLinkerScriptPath = setLinkerScript; | ||
| 588 | |||
| 589 | pub fn setLinkerScript(compile: *Compile, source: LazyPath) void { | 586 | pub fn setLinkerScript(compile: *Compile, source: LazyPath) void { |
| 590 | const b = compile.step.owner; | 587 | const b = compile.step.owner; |
| 591 | compile.linker_script = source.dupe(b); | 588 | compile.linker_script = source.dupe(b); |
| ... | @@ -675,11 +672,6 @@ pub fn linkLibCpp(compile: *Compile) void { | ... | @@ -675,11 +672,6 @@ pub fn linkLibCpp(compile: *Compile) void { |
| 675 | compile.root_module.link_libcpp = true; | 672 | compile.root_module.link_libcpp = true; |
| 676 | } | 673 | } |
| 677 | 674 | ||
| 678 | /// Deprecated. Use `c.root_module.addCMacro`. | ||
| 679 | pub fn defineCMacro(c: *Compile, name: []const u8, value: ?[]const u8) void { | ||
| 680 | c.root_module.addCMacro(name, value orelse "1"); | ||
| 681 | } | ||
| 682 | |||
| 683 | const PkgConfigResult = struct { | 675 | const PkgConfigResult = struct { |
| 684 | cflags: []const []const u8, | 676 | cflags: []const []const u8, |
| 685 | libs: []const []const u8, | 677 | libs: []const []const u8, |
| ... | @@ -805,16 +797,6 @@ pub fn linkFramework(c: *Compile, name: []const u8) void { | ... | @@ -805,16 +797,6 @@ pub fn linkFramework(c: *Compile, name: []const u8) void { |
| 805 | c.root_module.linkFramework(name, .{}); | 797 | c.root_module.linkFramework(name, .{}); |
| 806 | } | 798 | } |
| 807 | 799 | ||
| 808 | /// Deprecated. Use `c.root_module.linkFramework`. | ||
| 809 | pub fn linkFrameworkNeeded(c: *Compile, name: []const u8) void { | ||
| 810 | c.root_module.linkFramework(name, .{ .needed = true }); | ||
| 811 | } | ||
| 812 | |||
| 813 | /// Deprecated. Use `c.root_module.linkFramework`. | ||
| 814 | pub fn linkFrameworkWeak(c: *Compile, name: []const u8) void { | ||
| 815 | c.root_module.linkFramework(name, .{ .weak = true }); | ||
| 816 | } | ||
| 817 | |||
| 818 | /// Handy when you have many C/C++ source files and want them all to have the same flags. | 800 | /// Handy when you have many C/C++ source files and want them all to have the same flags. |
| 819 | pub fn addCSourceFiles(compile: *Compile, options: Module.AddCSourceFilesOptions) void { | 801 | pub fn addCSourceFiles(compile: *Compile, options: Module.AddCSourceFilesOptions) void { |
| 820 | compile.root_module.addCSourceFiles(options); | 802 | compile.root_module.addCSourceFiles(options); |
lib/std/Build/Step/ObjCopy.zig-3| ... | @@ -135,9 +135,6 @@ pub fn create( | ... | @@ -135,9 +135,6 @@ pub fn create( |
| 135 | return objcopy; | 135 | return objcopy; |
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | /// deprecated: use getOutput | ||
| 139 | pub const getOutputSource = getOutput; | ||
| 140 | |||
| 141 | pub fn getOutput(objcopy: *const ObjCopy) std.Build.LazyPath { | 138 | pub fn getOutput(objcopy: *const ObjCopy) std.Build.LazyPath { |
| 142 | return .{ .generated = .{ .file = &objcopy.output_file } }; | 139 | return .{ .generated = .{ .file = &objcopy.output_file } }; |
| 143 | } | 140 | } |
lib/std/Build/Step/Options.zig-8| ... | @@ -390,20 +390,12 @@ pub fn addOptionPath( | ... | @@ -390,20 +390,12 @@ pub fn addOptionPath( |
| 390 | path.addStepDependencies(&options.step); | 390 | path.addStepDependencies(&options.step); |
| 391 | } | 391 | } |
| 392 | 392 | ||
| 393 | /// Deprecated: use `addOptionPath(options, name, artifact.getEmittedBin())` instead. | ||
| 394 | pub fn addOptionArtifact(options: *Options, name: []const u8, artifact: *Step.Compile) void { | ||
| 395 | return addOptionPath(options, name, artifact.getEmittedBin()); | ||
| 396 | } | ||
| 397 | |||
| 398 | pub fn createModule(options: *Options) *std.Build.Module { | 393 | pub fn createModule(options: *Options) *std.Build.Module { |
| 399 | return options.step.owner.createModule(.{ | 394 | return options.step.owner.createModule(.{ |
| 400 | .root_source_file = options.getOutput(), | 395 | .root_source_file = options.getOutput(), |
| 401 | }); | 396 | }); |
| 402 | } | 397 | } |
| 403 | 398 | ||
| 404 | /// deprecated: use `getOutput` | ||
| 405 | pub const getSource = getOutput; | ||
| 406 | |||
| 407 | /// Returns the main artifact of this Build Step which is a Zig source file | 399 | /// Returns the main artifact of this Build Step which is a Zig source file |
| 408 | /// generated from the key-value pairs of the Options. | 400 | /// generated from the key-value pairs of the Options. |
| 409 | pub fn getOutput(options: *Options) LazyPath { | 401 | pub fn getOutput(options: *Options) LazyPath { |
lib/std/Build/Step/Run.zig-13| ... | @@ -43,9 +43,6 @@ stdio: StdIo, | ... | @@ -43,9 +43,6 @@ stdio: StdIo, |
| 43 | /// It should be only set using `setStdIn`. | 43 | /// It should be only set using `setStdIn`. |
| 44 | stdin: StdIn, | 44 | stdin: StdIn, |
| 45 | 45 | ||
| 46 | /// Deprecated: use `addFileInput` | ||
| 47 | extra_file_dependencies: []const []const u8, | ||
| 48 | |||
| 49 | /// Additional input files that, when modified, indicate that the Run step | 46 | /// Additional input files that, when modified, indicate that the Run step |
| 50 | /// should be re-executed. | 47 | /// should be re-executed. |
| 51 | /// If the Run step is determined to have side-effects, the Run step is always | 48 | /// If the Run step is determined to have side-effects, the Run step is always |
| ... | @@ -178,7 +175,6 @@ pub fn create(owner: *std.Build, name: []const u8) *Run { | ... | @@ -178,7 +175,6 @@ pub fn create(owner: *std.Build, name: []const u8) *Run { |
| 178 | .disable_zig_progress = false, | 175 | .disable_zig_progress = false, |
| 179 | .stdio = .infer_from_args, | 176 | .stdio = .infer_from_args, |
| 180 | .stdin = .none, | 177 | .stdin = .none, |
| 181 | .extra_file_dependencies = &.{}, | ||
| 182 | .file_inputs = .{}, | 178 | .file_inputs = .{}, |
| 183 | .rename_step_with_output_arg = true, | 179 | .rename_step_with_output_arg = true, |
| 184 | .skip_foreign_checks = false, | 180 | .skip_foreign_checks = false, |
| ... | @@ -364,16 +360,10 @@ pub fn addPrefixedOutputDirectoryArg( | ... | @@ -364,16 +360,10 @@ pub fn addPrefixedOutputDirectoryArg( |
| 364 | return .{ .generated = .{ .file = &output.generated_file } }; | 360 | return .{ .generated = .{ .file = &output.generated_file } }; |
| 365 | } | 361 | } |
| 366 | 362 | ||
| 367 | /// deprecated: use `addDirectoryArg` | ||
| 368 | pub const addDirectorySourceArg = addDirectoryArg; | ||
| 369 | |||
| 370 | pub fn addDirectoryArg(run: *Run, directory_source: std.Build.LazyPath) void { | 363 | pub fn addDirectoryArg(run: *Run, directory_source: std.Build.LazyPath) void { |
| 371 | run.addPrefixedDirectoryArg("", directory_source); | 364 | run.addPrefixedDirectoryArg("", directory_source); |
| 372 | } | 365 | } |
| 373 | 366 | ||
| 374 | // deprecated: use `addPrefixedDirectoryArg` | ||
| 375 | pub const addPrefixedDirectorySourceArg = addPrefixedDirectoryArg; | ||
| 376 | |||
| 377 | pub fn addPrefixedDirectoryArg(run: *Run, prefix: []const u8, directory_source: std.Build.LazyPath) void { | 367 | pub fn addPrefixedDirectoryArg(run: *Run, prefix: []const u8, directory_source: std.Build.LazyPath) void { |
| 378 | const b = run.step.owner; | 368 | const b = run.step.owner; |
| 379 | 369 | ||
| ... | @@ -698,9 +688,6 @@ fn make(step: *Step, options: Step.MakeOptions) !void { | ... | @@ -698,9 +688,6 @@ fn make(step: *Step, options: Step.MakeOptions) !void { |
| 698 | 688 | ||
| 699 | hashStdIo(&man.hash, run.stdio); | 689 | hashStdIo(&man.hash, run.stdio); |
| 700 | 690 | ||
| 701 | for (run.extra_file_dependencies) |file_path| { | ||
| 702 | _ = try man.addFile(b.pathFromRoot(file_path), null); | ||
| 703 | } | ||
| 704 | for (run.file_inputs.items) |lazy_path| { | 691 | for (run.file_inputs.items) |lazy_path| { |
| 705 | _ = try man.addFile(lazy_path.getPath2(b, step), null); | 692 | _ = try man.addFile(lazy_path.getPath2(b, step), null); |
| 706 | } | 693 | } |
test/standalone/extern/build.zig+1-1| ... | @@ -18,7 +18,7 @@ pub fn build(b: *std.Build) void { | ... | @@ -18,7 +18,7 @@ pub fn build(b: *std.Build) void { |
| 18 | .optimize = optimize, | 18 | .optimize = optimize, |
| 19 | .link_libc = true, | 19 | .link_libc = true, |
| 20 | }); | 20 | }); |
| 21 | if (b.graph.host.result.abi == .msvc) shared.defineCMacro("API", "__declspec(dllexport)"); | 21 | if (b.graph.host.result.abi == .msvc) shared.root_module.addCMacro("API", "__declspec(dllexport)"); |
| 22 | shared.addCSourceFile(.{ .file = b.path("shared.c"), .flags = &.{} }); | 22 | shared.addCSourceFile(.{ .file = b.path("shared.c"), .flags = &.{} }); |
| 23 | const test_exe = b.addTest(.{ | 23 | const test_exe = b.addTest(.{ |
| 24 | .root_source_file = b.path("main.zig"), | 24 | .root_source_file = b.path("main.zig"), |
test/standalone/issue_11595/build.zig+6-6| ... | @@ -30,16 +30,16 @@ pub fn build(b: *std.Build) void { | ... | @@ -30,16 +30,16 @@ pub fn build(b: *std.Build) void { |
| 30 | 30 | ||
| 31 | var i: i32 = 0; | 31 | var i: i32 = 0; |
| 32 | while (i < 1000) : (i += 1) { | 32 | while (i < 1000) : (i += 1) { |
| 33 | exe.defineCMacro("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"); | 33 | exe.root_module.addCMacro("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"); |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | exe.defineCMacro("FOO", "42"); | 36 | exe.root_module.addCMacro("FOO", "42"); |
| 37 | exe.defineCMacro("BAR", "\"BAR\""); | 37 | exe.root_module.addCMacro("BAR", "\"BAR\""); |
| 38 | exe.defineCMacro("BAZ", | 38 | exe.root_module.addCMacro("BAZ", |
| 39 | \\"\"BAZ\"" | 39 | \\"\"BAZ\"" |
| 40 | ); | 40 | ); |
| 41 | exe.defineCMacro("QUX", "\"Q\" \"UX\""); | 41 | exe.root_module.addCMacro("QUX", "\"Q\" \"UX\""); |
| 42 | exe.defineCMacro("QUUX", "\"QU\\\"UX\""); | 42 | exe.root_module.addCMacro("QUUX", "\"QU\\\"UX\""); |
| 43 | 43 | ||
| 44 | b.default_step.dependOn(&exe.step); | 44 | b.default_step.dependOn(&exe.step); |
| 45 | 45 |
test/standalone/stack_iterator/build.zig+1-1| ... | @@ -72,7 +72,7 @@ pub fn build(b: *std.Build) void { | ... | @@ -72,7 +72,7 @@ pub fn build(b: *std.Build) void { |
| 72 | }); | 72 | }); |
| 73 | 73 | ||
| 74 | if (target.result.os.tag == .windows) | 74 | if (target.result.os.tag == .windows) |
| 75 | c_shared_lib.defineCMacro("LIB_API", "__declspec(dllexport)"); | 75 | c_shared_lib.root_module.addCMacro("LIB_API", "__declspec(dllexport)"); |
| 76 | 76 | ||
| 77 | c_shared_lib.addCSourceFile(.{ | 77 | c_shared_lib.addCSourceFile(.{ |
| 78 | .file = b.path("shared_lib.c"), | 78 | .file = b.path("shared_lib.c"), |
test/tests.zig+1-1| ... | @@ -1704,7 +1704,7 @@ pub fn addCAbiTests(b: *std.Build, options: CAbiTestOptions) *Step { | ... | @@ -1704,7 +1704,7 @@ pub fn addCAbiTests(b: *std.Build, options: CAbiTestOptions) *Step { |
| 1704 | .file = b.path("test/c_abi/cfuncs.c"), | 1704 | .file = b.path("test/c_abi/cfuncs.c"), |
| 1705 | .flags = &.{"-std=c99"}, | 1705 | .flags = &.{"-std=c99"}, |
| 1706 | }); | 1706 | }); |
| 1707 | for (c_abi_target.c_defines) |define| test_step.defineCMacro(define, null); | 1707 | for (c_abi_target.c_defines) |define| test_step.root_module.addCMacro(define, "1"); |
| 1708 | 1708 | ||
| 1709 | // This test is intentionally trying to check if the external ABI is | 1709 | // This test is intentionally trying to check if the external ABI is |
| 1710 | // done properly. LTO would be a hindrance to this. | 1710 | // done properly. LTO would be a hindrance to this. |