authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-03-07 21:19:08 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-03-07 21:19:08 -08:00
log591db1e4a69d7c6cdd95c486ee0abeb686de88fe
treec33a2145b52d5718dc2981369a88228b5adca0a3
parentc4c6faddf9cebfa2068fa789325be7c1ac7e00ac

docs- fix some things out of sync


3 files changed, 6 insertions(+), 5 deletions(-)

docs/deps.zig.md+2-1
......@@ -1,5 +1,5 @@
11## `deps.zig` Reference
2This file is generated by [`zigmod fetch`](commands/fetch.md) or [`zigmod ci`](commands/ci.md) and is an amalgamation of all of the sources and dependencies used in this project. Many of the fields listed here align with fields present in [`zig.mod`](zig.mod.md) but contain those values for the entire dependency tree.
2This file is generated by [`zigmod fetch`](commands/fetch.md) or [`zigmod ci`](commands/ci.md) and is an amalgamation of all of the sources and dependencies used in this project. Many of the fields listed here align with fields present in [`zigmod.yml`](zig.mod.md) but contain those values for the entire dependency tree.
33
44### `cache`
55- Type: `[]const u8`
......@@ -18,6 +18,7 @@ pub const Package = struct {
1818 c_source_files: []const string = &.{},
1919 c_source_flags: []const string = &.{},
2020 system_libs: []const string = &.{},
21 vcpkg: bool = false,
2122};
2223```
2324
docs/principles.md+1-1
......@@ -2,7 +2,7 @@
22Zigmod is a prototype package manager for Zig. An official one will eventually be made so I wanted to add this page to the docs to go over some of the guiding principles used in this project. Some are general good practice for app development but there will be added context in how they apply to making a package manager.
33
44### 1. Be declarative
5`zig.mod` is a static Yaml file that does not contain any Zig code. Placing packages' definition in its own file (say as opposed to in `build.zig`) was an intentional decision from the start to not allow packages to run arbitrary code on the developer's machine. A maintainer's computer is an arguably much more high risk attack surface so the trust of code should be kept to a minimum. Given that the environment may contain API/ssh/etc keys that provide access to things far wider than just the user's computer.
5`zigmod.yml` is a static Yaml file that does not contain any Zig code. Placing packages' definition in its own file (say as opposed to in `build.zig`) was an intentional decision from the start to not allow packages to run arbitrary code on the developer's machine. A maintainer's computer is an arguably much more high risk attack surface so the trust of code should be kept to a minimum. Given that the environment may contain API/ssh/etc keys that provide access to things far wider than just the user's computer.
66
77### 2. Be Immutable/Avoid the network as much as possible
88The network is slow and unreliable. So we should cache only what we need and avoid fetching unchanged data. This is achieved from a user's perspective by using versions on your dependencies that dont change. For example tags or commits when using git, or specifying a hash when using http.
docs/zig.mod.md+3-3
......@@ -48,11 +48,11 @@ This is a list of `Dep` objects. `Dep` objects are how you include the other peo
4848
4949### `root_dependencies`
5050- Type: `[]Dep`
51Similar to `dependencies` but will only get added to the project if the current `zig.mod` is the root module.
51Similar to `dependencies` but will only get added to the project if the current `zigmod.yml` is the root module.
5252
5353### `build_dependencies`
5454- Type: `[]Dep`
55Similar to `dependencies` but will only get added to the project if the current `zig.mod` is the root module. Exposed in `deps.zig` through the `deps.imports` decl.
55Similar to `dependencies` but will only get added to the project if the current `zigmod.yml` is the root module. Exposed in `deps.zig` through the `deps.imports` decl.
5656
5757### `min_zig_version`
5858- Type: `string`
......@@ -127,4 +127,4 @@ This attribute is a manual override for having an external repo that contains no
127127This attribute is a flag to call `try exe.addVcpkgPaths(.static);` when on Windows. Likely used in conjunction with adding system libraries/C code. `true` is the only value that will enable this flag.
128128
129129#### Dep Overrides
130There are a number of fields you can add to a `Dep` object that will override it's top-level value. This is most useful in the case where a project you want to use does not have a `zig.mod` manifest. You can then use overrides to define the values for them. The only top-level value you can not override is `dependencies`.
130There are a number of fields you can add to a `Dep` object that will override it's top-level value. This is most useful in the case where a project you want to use does not have a `zigmod.yml` manifest. You can then use overrides to define the values for them. The only top-level value you can not override is `dependencies`.