Skip to content

build: rename std.Build.*Step to std.Build.Step.* #15020

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 3, 2023

Conversation

sterchelen
Copy link
Contributor

Follow-up actions from #14647

Fixes #14947

Comment on lines +5 to +9
const CheckFileStep = @This();
const std = @import("std");
const Step = std.Build.Step;
const fs = std.fs;
const mem = std.mem;
Copy link
Contributor Author

@sterchelen sterchelen Mar 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Saw const at bottom or at the top of the files...
There are more const at the top for Steps files so I took advantage by doing this PR to make things more consistent.

const std = @import("../std.zig");
const std = @import("std");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. Should files in the std module always be importing std by alias like this now? If so what's the reason(s)? I'm curious if non-std modules should be adopting the same convention.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to note in order to do this type of thing in non-std modules you have to add the module to its own dependencies: #14708 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering if we could avoid relative path on std import. It seems yes, we are already doing this in lib/std/Build/Cache.zig

const std = @import("std");

@andrewrk andrewrk self-requested a review March 21, 2023 06:29
@sterchelen
Copy link
Contributor Author

@andrewrk do you want me to resolve conflicts before reviewing that PR?

@Vexu Vexu merged commit 13eb725 into ziglang:master May 3, 2023
Comment on lines +32 to +45
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");
Copy link
Contributor

@nektro nektro May 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these decls are in the right file location but not the right namespace and does not implement the title as stated

@andrewrk
Copy link
Member

andrewrk commented May 3, 2023

For future reference when I request a review from myself, it is a polite way to say "please don't merge this until I approve it"

@sterchelen sterchelen deleted the move-step branch May 3, 2023 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rename std.Build.FooStep to std.Build.Step.Foo
6 participants