| author | |
| committer | |
| log | 591db1e4a69d7c6cdd95c486ee0abeb686de88fe |
| tree | c33a2145b52d5718dc2981369a88228b5adca0a3 |
| parent | c4c6faddf9cebfa2068fa789325be7c1ac7e00ac |
3 files changed, 6 insertions(+), 5 deletions(-)
docs/deps.zig.md+2-1| ... | @@ -1,5 +1,5 @@ | ... | @@ -1,5 +1,5 @@ |
| 1 | ## `deps.zig` Reference | 1 | ## `deps.zig` Reference |
| 2 | This 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. | 2 | This 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. |
| 3 | 3 | ||
| 4 | ### `cache` | 4 | ### `cache` |
| 5 | - Type: `[]const u8` | 5 | - Type: `[]const u8` |
| ... | @@ -18,6 +18,7 @@ pub const Package = struct { | ... | @@ -18,6 +18,7 @@ pub const Package = struct { |
| 18 | c_source_files: []const string = &.{}, | 18 | c_source_files: []const string = &.{}, |
| 19 | c_source_flags: []const string = &.{}, | 19 | c_source_flags: []const string = &.{}, |
| 20 | system_libs: []const string = &.{}, | 20 | system_libs: []const string = &.{}, |
| 21 | vcpkg: bool = false, | ||
| 21 | }; | 22 | }; |
| 22 | ``` | 23 | ``` |
| 23 | 24 |
docs/principles.md+1-1| ... | @@ -2,7 +2,7 @@ | ... | @@ -2,7 +2,7 @@ |
| 2 | Zigmod 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. | 2 | Zigmod 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. |
| 3 | 3 | ||
| 4 | ### 1. Be declarative | 4 | ### 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. |
| 6 | 6 | ||
| 7 | ### 2. Be Immutable/Avoid the network as much as possible | 7 | ### 2. Be Immutable/Avoid the network as much as possible |
| 8 | The 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. | 8 | The 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 | ... | @@ -48,11 +48,11 @@ This is a list of `Dep` objects. `Dep` objects are how you include the other peo |
| 48 | 48 | ||
| 49 | ### `root_dependencies` | 49 | ### `root_dependencies` |
| 50 | - Type: `[]Dep` | 50 | - Type: `[]Dep` |
| 51 | Similar to `dependencies` but will only get added to the project if the current `zig.mod` is the root module. | 51 | Similar to `dependencies` but will only get added to the project if the current `zigmod.yml` is the root module. |
| 52 | 52 | ||
| 53 | ### `build_dependencies` | 53 | ### `build_dependencies` |
| 54 | - Type: `[]Dep` | 54 | - Type: `[]Dep` |
| 55 | Similar 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. | 55 | Similar 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. |
| 56 | 56 | ||
| 57 | ### `min_zig_version` | 57 | ### `min_zig_version` |
| 58 | - Type: `string` | 58 | - Type: `string` |
| ... | @@ -127,4 +127,4 @@ This attribute is a manual override for having an external repo that contains no | ... | @@ -127,4 +127,4 @@ This attribute is a manual override for having an external repo that contains no |
| 127 | This 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. | 127 | This 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. |
| 128 | 128 | ||
| 129 | #### Dep Overrides | 129 | #### Dep Overrides |
| 130 | There 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`. | 130 | There 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`. |