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

Encode dependencies in the repo data #40

Open
ikskuh opened this issue Sep 27, 2022 · 0 comments
Open

Encode dependencies in the repo data #40

ikskuh opened this issue Sep 27, 2022 · 0 comments
Labels
proposal Some changes are proposed

Comments

@ikskuh
Copy link
Member

ikskuh commented Sep 27, 2022

I'm using a private repository similar to this for my own "package manager" (it's just a way to quickly add submodules). The current format allows these two configurations:

"parser-toolkit": {
  "git": "https://github.com/MasterQ32/parser-toolkit",
  "pkg_file": "src/main.zig"
},
"sdl": {
  "git": "https://github.com/MasterQ32/SDL.zig",
  "sdk_file": "Sdk.zig"
}

The pkg_file item can be set for repositories that export a single zig package (like zig-args), the sdk_file can be used for packages that use a build time package (like SDL.zig).

What's currently not covered is repos that export more than one package (like SDL.zig). What we could do for those is either using a sdk_file or this:

"sdl": {
  "git": "https://github.com/MasterQ32/SDL.zig",
  "sdk_file": "Sdk.zig",
  "packages": {
    "native": "src/binding/sdl.zig",
    "wrapper": "src/wrapper/sdl.zig"
  }
}

This does not cover any dependencies yet, so what i'm experimenting around with is this structure:

"ziglyph": {
  "git": "https://github.com/jecolon/ziglyph",
  "pkg_file": "src/ziglyph.zig"
},
"zigstr": {
  "git": "https://github.com/jecolon/zigstr",
  "pkg_file": "src/Zigstr.zig",
  "dependencies": [
    "ziglyph"
  ]
}

This does not properly encode multi-package-repos yet, neither as a dependency nor as source package. The dependencies field could use a string-formatted variant like "sdl/native" or similar, while multi-package repos could use a { "file": "", "dependencies": [ … ] } structure for the packages items.

Any thoughts?

@mattnite and @nektro already have designed a similar system, so i'd appreciate some input on these thoughts. Am i missing some important data or could this actually be enough to model a zig package structure (excluding any kind of versions)

@ikskuh ikskuh added the proposal Some changes are proposed label Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Some changes are proposed
Projects
None yet
Development

No branches or pull requests

1 participant