-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
acceptedThis proposal is planned.This proposal is planned.breakingImplementing this issue could cause existing code to no longer compile or have different behavior.Implementing this issue could cause existing code to no longer compile or have different behavior.proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.This issue suggests modifications. If it also has the "accepted" label then it is planned.zig build systemstd.Build, the build runner, `zig build` subcommand, package managementstd.Build, the build runner, `zig build` subcommand, package management
Milestone
Description
Status Quo
- A project is a directory of files, uniquely identified by a hash of all files. Projects can export any number of compilation artifacts and packages.
- A dependency is a directed edge between projects. A project may depend on any number of projects. A project may be a dependency of any number of projects.
- A package is a directory of files, along with a root source file that identifies the file referred to when the package is used with
@import. - A compilation artifact is a static library, a dynamic library, an executable, or an object file. Corresponds to
std.build.LibExeObjStep.
The Problem
We have been using the word "package" already, including in build system APIs:
Lines 1479 to 1483 in d813cef
| pub const Pkg = struct { | |
| name: []const u8, | |
| source: FileSource, | |
| dependencies: ?[]const Pkg = null, | |
| }; |
zig/lib/std/build/LibExeObjStep.zig
Lines 977 to 980 in d813cef
| pub fn addPackage(self: *LibExeObjStep, package: Pkg) void { | |
| self.packages.append(self.builder.dupePkg(package)) catch unreachable; | |
| self.addRecursiveBuildDeps(package); | |
| } |
However, people are 100% going to say "package" when they mean "project". This is unavoidable, inescapable, and we should not fight against it, but rather embrace it. That leaves us with the following lingo:
- A package is a directory of files, uniquely identified by a hash of all files. Packages can export any number of compilation artifacts and packages.
- A package is a directory of files, along with a root source file that identifies the file referred to when the package is used with
@import.
Ambiguity strikes ruthlessly.
The Solution
Our hero is the word "module". The word "project" is no longer needed.
- A package is a directory of files, uniquely identified by a hash of all files. Packages can export any number of compilation artifacts and modules.
- A dependency is a directed edge between packages. A package may depend on any number of packages. A package may be a dependency of any number of packages.
- A module is a directory of files, along with a root source file that identifies the file referred to when the module is used with
@import. - A compilation artifact is a static library, a dynamic library, an executable, or an object file. Corresponds to
std.build.LibExeObjStep.
I would also like to rename LibExeObjStep to CompilationArtifact while we're at it.
This issue is to do the following things:
- update the terminology in documentation
- update the terminology in the zig compiler internal source code
- update the terminology in the build system APIs and internal source code
- update the terminology in build.zig.zon
- update the CLI arguments
miktwon, 0x08088405, jayschwa, natecraddock, cryptocode and 41 morevoltflake, natecraddock, famuyiwadayo, prajwalch, lin72h and 14 moremarler8997, melroy89, inthevibe and johan0A
Metadata
Metadata
Assignees
Labels
acceptedThis proposal is planned.This proposal is planned.breakingImplementing this issue could cause existing code to no longer compile or have different behavior.Implementing this issue could cause existing code to no longer compile or have different behavior.proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.This issue suggests modifications. If it also has the "accepted" label then it is planned.zig build systemstd.Build, the build runner, `zig build` subcommand, package managementstd.Build, the build runner, `zig build` subcommand, package management
Type
Projects
Status
Urgent Enhancements