diff --git a/lib/std/Build.zig b/lib/std/Build.zig index 34806adf488f..f332567b3cf1 100644 --- a/lib/std/Build.zig +++ b/lib/std/Build.zig @@ -29,20 +29,20 @@ pub const Builder = Build; pub const InstallDirectoryOptions = InstallDirStep.Options; pub const Step = @import("Build/Step.zig"); -pub const CheckFileStep = @import("Build/CheckFileStep.zig"); -pub const CheckObjectStep = @import("Build/CheckObjectStep.zig"); -pub const ConfigHeaderStep = @import("Build/ConfigHeaderStep.zig"); -pub const FmtStep = @import("Build/FmtStep.zig"); -pub const InstallArtifactStep = @import("Build/InstallArtifactStep.zig"); -pub const InstallDirStep = @import("Build/InstallDirStep.zig"); -pub const InstallFileStep = @import("Build/InstallFileStep.zig"); -pub const ObjCopyStep = @import("Build/ObjCopyStep.zig"); -pub const CompileStep = @import("Build/CompileStep.zig"); -pub const OptionsStep = @import("Build/OptionsStep.zig"); -pub const RemoveDirStep = @import("Build/RemoveDirStep.zig"); -pub const RunStep = @import("Build/RunStep.zig"); -pub const TranslateCStep = @import("Build/TranslateCStep.zig"); -pub const WriteFileStep = @import("Build/WriteFileStep.zig"); +pub const CheckFileStep = @import("Build/Step/CheckFile.zig"); +pub const CheckObjectStep = @import("Build/Step/CheckObject.zig"); +pub const ConfigHeaderStep = @import("Build/Step/ConfigHeader.zig"); +pub const FmtStep = @import("Build/Step/Fmt.zig"); +pub const InstallArtifactStep = @import("Build/Step/InstallArtifact.zig"); +pub const InstallDirStep = @import("Build/Step/InstallDir.zig"); +pub const InstallFileStep = @import("Build/Step/InstallFile.zig"); +pub const ObjCopyStep = @import("Build/Step/ObjCopy.zig"); +pub const CompileStep = @import("Build/Step/Compile.zig"); +pub const OptionsStep = @import("Build/Step/Options.zig"); +pub const RemoveDirStep = @import("Build/Step/RemoveDir.zig"); +pub const RunStep = @import("Build/Step/Run.zig"); +pub const TranslateCStep = @import("Build/Step/TranslateC.zig"); +pub const WriteFileStep = @import("Build/Step/WriteFile.zig"); install_tls: TopLevelStep, uninstall_tls: TopLevelStep, diff --git a/lib/std/Build/CheckFileStep.zig b/lib/std/Build/Step/CheckFile.zig similarity index 98% rename from lib/std/Build/CheckFileStep.zig rename to lib/std/Build/Step/CheckFile.zig index 1c2b6b77867b..ad8b1a25f04c 100644 --- a/lib/std/Build/CheckFileStep.zig +++ b/lib/std/Build/Step/CheckFile.zig @@ -2,6 +2,11 @@ //! TODO: make this more flexible, supporting more kinds of checks. //! TODO: generalize the code in std.testing.expectEqualStrings and make this //! CheckFileStep produce those helpful diagnostics when there is not a match. +const CheckFileStep = @This(); +const std = @import("std"); +const Step = std.Build.Step; +const fs = std.fs; +const mem = std.mem; step: Step, expected_matches: []const []const u8, @@ -80,9 +85,3 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { } } } - -const CheckFileStep = @This(); -const std = @import("../std.zig"); -const Step = std.Build.Step; -const fs = std.fs; -const mem = std.mem; diff --git a/lib/std/Build/CheckObjectStep.zig b/lib/std/Build/Step/CheckObject.zig similarity index 99% rename from lib/std/Build/CheckObjectStep.zig rename to lib/std/Build/Step/CheckObject.zig index fbeb87baeeb6..7874caed22c2 100644 --- a/lib/std/Build/CheckObjectStep.zig +++ b/lib/std/Build/Step/CheckObject.zig @@ -1,4 +1,4 @@ -const std = @import("../std.zig"); +const std = @import("std"); const assert = std.debug.assert; const fs = std.fs; const macho = std.macho; diff --git a/lib/std/Build/CompileStep.zig b/lib/std/Build/Step/Compile.zig similarity index 99% rename from lib/std/Build/CompileStep.zig rename to lib/std/Build/Step/Compile.zig index b71298ce6a81..928bd7352004 100644 --- a/lib/std/Build/CompileStep.zig +++ b/lib/std/Build/Step/Compile.zig @@ -1,5 +1,5 @@ const builtin = @import("builtin"); -const std = @import("../std.zig"); +const std = @import("std"); const mem = std.mem; const fs = std.fs; const assert = std.debug.assert; diff --git a/lib/std/Build/ConfigHeaderStep.zig b/lib/std/Build/Step/ConfigHeader.zig similarity index 99% rename from lib/std/Build/ConfigHeaderStep.zig rename to lib/std/Build/Step/ConfigHeader.zig index c1849b410e0b..6bfe28ae6257 100644 --- a/lib/std/Build/ConfigHeaderStep.zig +++ b/lib/std/Build/Step/ConfigHeader.zig @@ -1,3 +1,7 @@ +const std = @import("std"); +const ConfigHeaderStep = @This(); +const Step = std.Build.Step; + pub const Style = union(enum) { /// The configure format supported by autotools. It uses `#undef foo` to /// mark lines that can be substituted with different values. @@ -431,7 +435,3 @@ fn renderValueNasm(output: *std.ArrayList(u8), name: []const u8, value: Value) ! }, } } - -const std = @import("../std.zig"); -const ConfigHeaderStep = @This(); -const Step = std.Build.Step; diff --git a/lib/std/Build/FmtStep.zig b/lib/std/Build/Step/Fmt.zig similarity index 98% rename from lib/std/Build/FmtStep.zig rename to lib/std/Build/Step/Fmt.zig index 2a823423362d..23d5d9e3ff0b 100644 --- a/lib/std/Build/FmtStep.zig +++ b/lib/std/Build/Step/Fmt.zig @@ -1,6 +1,9 @@ //! This step has two modes: //! * Modify mode: directly modify source files, formatting them in place. //! * Check mode: fail the step if a non-conforming file is found. +const std = @import("std"); +const Step = std.Build.Step; +const FmtStep = @This(); step: Step, paths: []const []const u8, @@ -67,7 +70,3 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { return step.evalChildProcess(argv.items); } - -const std = @import("../std.zig"); -const Step = std.Build.Step; -const FmtStep = @This(); diff --git a/lib/std/Build/InstallArtifactStep.zig b/lib/std/Build/Step/InstallArtifact.zig similarity index 99% rename from lib/std/Build/InstallArtifactStep.zig rename to lib/std/Build/Step/InstallArtifact.zig index 50cf6ff323b3..fa357a9ae944 100644 --- a/lib/std/Build/InstallArtifactStep.zig +++ b/lib/std/Build/Step/InstallArtifact.zig @@ -1,4 +1,4 @@ -const std = @import("../std.zig"); +const std = @import("std"); const Step = std.Build.Step; const CompileStep = std.Build.CompileStep; const InstallDir = std.Build.InstallDir; diff --git a/lib/std/Build/InstallDirStep.zig b/lib/std/Build/Step/InstallDir.zig similarity index 99% rename from lib/std/Build/InstallDirStep.zig rename to lib/std/Build/Step/InstallDir.zig index d9ea24891346..28280dcb7f4b 100644 --- a/lib/std/Build/InstallDirStep.zig +++ b/lib/std/Build/Step/InstallDir.zig @@ -1,4 +1,4 @@ -const std = @import("../std.zig"); +const std = @import("std"); const mem = std.mem; const fs = std.fs; const Step = std.Build.Step; diff --git a/lib/std/Build/InstallFileStep.zig b/lib/std/Build/Step/InstallFile.zig similarity index 98% rename from lib/std/Build/InstallFileStep.zig rename to lib/std/Build/Step/InstallFile.zig index 011ad4820853..b6b66fd1e06d 100644 --- a/lib/std/Build/InstallFileStep.zig +++ b/lib/std/Build/Step/InstallFile.zig @@ -1,4 +1,4 @@ -const std = @import("../std.zig"); +const std = @import("std"); const Step = std.Build.Step; const FileSource = std.Build.FileSource; const InstallDir = std.Build.InstallDir; diff --git a/lib/std/Build/ObjCopyStep.zig b/lib/std/Build/Step/ObjCopy.zig similarity index 100% rename from lib/std/Build/ObjCopyStep.zig rename to lib/std/Build/Step/ObjCopy.zig diff --git a/lib/std/Build/OptionsStep.zig b/lib/std/Build/Step/Options.zig similarity index 99% rename from lib/std/Build/OptionsStep.zig rename to lib/std/Build/Step/Options.zig index a0e72e3695f9..101c284cf0b8 100644 --- a/lib/std/Build/OptionsStep.zig +++ b/lib/std/Build/Step/Options.zig @@ -1,4 +1,4 @@ -const std = @import("../std.zig"); +const std = @import("std"); const builtin = @import("builtin"); const fs = std.fs; const Step = std.Build.Step; diff --git a/lib/std/Build/RemoveDirStep.zig b/lib/std/Build/Step/RemoveDir.zig similarity index 97% rename from lib/std/Build/RemoveDirStep.zig rename to lib/std/Build/Step/RemoveDir.zig index a5bf3c32565d..59025a7e9129 100644 --- a/lib/std/Build/RemoveDirStep.zig +++ b/lib/std/Build/Step/RemoveDir.zig @@ -1,4 +1,4 @@ -const std = @import("../std.zig"); +const std = @import("std"); const fs = std.fs; const Step = std.Build.Step; const RemoveDirStep = @This(); diff --git a/lib/std/Build/RunStep.zig b/lib/std/Build/Step/Run.zig similarity index 99% rename from lib/std/Build/RunStep.zig rename to lib/std/Build/Step/Run.zig index 435c7369d039..5f368d469fe5 100644 --- a/lib/std/Build/RunStep.zig +++ b/lib/std/Build/Step/Run.zig @@ -1,4 +1,4 @@ -const std = @import("../std.zig"); +const std = @import("std"); const builtin = @import("builtin"); const Step = std.Build.Step; const CompileStep = std.Build.CompileStep; diff --git a/lib/std/Build/TranslateCStep.zig b/lib/std/Build/Step/TranslateC.zig similarity index 99% rename from lib/std/Build/TranslateCStep.zig rename to lib/std/Build/Step/TranslateC.zig index f2dc23d95074..86727ea2f045 100644 --- a/lib/std/Build/TranslateCStep.zig +++ b/lib/std/Build/Step/TranslateC.zig @@ -1,4 +1,4 @@ -const std = @import("../std.zig"); +const std = @import("std"); const Step = std.Build.Step; const CompileStep = std.Build.CompileStep; const CheckFileStep = std.Build.CheckFileStep; diff --git a/lib/std/Build/WriteFileStep.zig b/lib/std/Build/Step/WriteFile.zig similarity index 99% rename from lib/std/Build/WriteFileStep.zig rename to lib/std/Build/Step/WriteFile.zig index dee79af5bee5..68f7c37c6c94 100644 --- a/lib/std/Build/WriteFileStep.zig +++ b/lib/std/Build/Step/WriteFile.zig @@ -8,6 +8,11 @@ //! during the normal build process, but as a utility run by a developer with //! intention to update source files, which will then be committed to version //! control. +const std = @import("std"); +const Step = std.Build.Step; +const fs = std.fs; +const ArrayList = std.ArrayList; +const WriteFileStep = @This(); step: Step, /// The elements here are pointers because we need stable pointers for the @@ -284,10 +289,3 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { try step.writeManifest(&man); } - -const std = @import("../std.zig"); -const Step = std.Build.Step; -const fs = std.fs; -const ArrayList = std.ArrayList; - -const WriteFileStep = @This();