Skip to content

std.Build.Step.Fmt handles paths incorrectly #23957

@mlugg

Description

@mlugg

std.Build.Step.Fmt takes a []const []const u8 to represents its paths. They are interpreted as relative to the step's owner Build's build root.

This is inappropriate. They should likely be relative to a user-provided "root" LazyPath, like how std.Build.Module.addCSourceFiles takes its list of file paths.

This would eliminate the last calls to std.Build.pathFromRoot outside of lib/std/Build.zig, allowing us to mark it as non-pub. That's a good idea; build scripts should work in LazyPaths, and Step.make implementations should resolve those LazyPaths to strings with the provided methods.

Fixing this will require a breaking change to std.Build.Step.Fmt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    breakingImplementing this issue could cause existing code to no longer compile or have different behavior.enhancementSolving this issue will likely involve adding new logic or components to the codebase.standard libraryThis issue involves writing Zig code for the standard library.zig build systemstd.Build, the build runner, `zig build` subcommand, package management

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions