Skip to content
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

all: use snake_case for package names and build CLI flags #1157

Open
slimsag opened this issue Feb 10, 2024 · 0 comments
Open

all: use snake_case for package names and build CLI flags #1157

slimsag opened this issue Feb 10, 2024 · 0 comments
Labels
Milestone

Comments

@slimsag
Copy link
Member

slimsag commented Feb 10, 2024

Point 1: use snake_case for all package names in build.zig.zon

If build.zig.zon contains .name = "mach-dxcompiler" then zig fetch --save will produce an entry like this using @"" syntax:

.dependencies = .{
    .@"mach-dxcompiler" = .{ ... }
},

Rather than the nicer form:

.dependencies = .{
    .mach_dxcompiler = .{ ... }
},

We can control this using the name parameter to zig fetch --save, of course, but it'd be nice to be able to rely on the defaults and get good names by default.

Point 2: use snake_case for build.zig CLI flags always

In build.zig, CLI option flags are often defined as e.g.:

const debug_symbols = b.option(bool, "debug-symbols", "Whether to produce detailed debug symbols (g0) or not.") orelse false;

And would be used via zig build -Ddebug-symbols=true. However, they are also specified when using the package in Zig code:

    const mach_dxcompiler = b.dependency("mach_dxcompiler", .{
        .@"debug-symbols" = false,
    });

Again, it would be nice to avoid @"" syntax - so we will use debug_symbols instead (.debug_symbols = false, and -Ddebug_symbols=true as the CLI flag.)

@slimsag slimsag added the all label Feb 10, 2024
@slimsag slimsag added this to the Mach 0.4 milestone Feb 10, 2024
slimsag added a commit to hexops/mach-dxcompiler that referenced this issue Feb 10, 2024
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
slimsag added a commit to hexops/mach-freetype that referenced this issue Apr 20, 2024
Helps hexops/mach#1157

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant