Skip to content

Simplify lazy dependency handling - #45

Merged
MasonRemaley merged 1 commit into
mainfrom
mason/simplify-lazy-deps
Oct 16, 2026
Merged

MasonRemaley merged 1 commit into
mainfrom
mason/simplify-lazy-deps

Conversation

@MasonRemaley

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread build.zig.zon
.name = .sdl,
.fingerprint = 0xec638ccbd103848b,
.version = "1.0.7+3.4.18",
.version = "1.0.8+3.4.18",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.0.7 has no functional changes yet, so you could use it for this stuff.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now the build system ignores these version numbers, but in the future we'd like to use them to make decisions in situations where multiple versions of a package are present simultaneously. However, this doesn't work if multiple PRs are merged into master without bumping the version number, since this means two users who fetch latest master could have different commits with the same version number, and the build system has no way of knowing which is newer.

My plan is to follow this pattern until we have these features nailed down (likely in the 0.18 release cycle) at which point I can reevaluate whether this pattern makes sense given how the features end up being implemented.

To save some busy work though, I don't think we need to make a new tag for each patch release. Tags are a useful way to find old releases quickly, but I don't think there are many use cases for intentionally fetching an old patch release. Most users will just want whatever is latest on master, the users looking for an old release are probably looking for a particular Zig or SDL version.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been tagging when I want to pull a new version into SDL_image or SDL_ttf. (I know I could just use commit too, but it's nice when there's a tag attached.)

I do fear the upcoming package manager changes are going to create a lot of problems or busy work if every commit effectively has to have a unique version. It'd be nice if the package manager could support version templating or something when used in conjunction with version control tags. .version = "1.0.8-dev.{n}+upstream.3.4.18.git.{id}". Obviously that wouldn't work with archives, but most distributions will only be producing archives for tagged, concrete versions anyway.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been tagging when I want to pull a new version into SDL_image or SDL_ttf. (I know I could just use commit too, but it's nice when there's a tag attached.)

Gotcha, that makes sense.

I do fear the upcoming package manager changes are going to create a lot of problems or busy work if every commit effectively has to have a unique version. It'd be nice if the package manager could support version templating or something when used in conjunction with version control tags. .version = "1.0.8-dev.{n}+upstream.3.4.18.git.{id}". Obviously that wouldn't work with archives, but most distributions will only be producing archives for tagged, concrete versions anyway.

I think there's still room to explore how exactly this works in the build system (just saw your comment on the respective issue.)

FWIW I don't think every commit needs a unique version--just anything that main is going to point at for a substantial amount of time. For example, there's no reason to bump the version multiple times within the same PR since on merge main will jump to the last commit. Similarly, if merging two PRs in a row, it's probably fine to do the version bump after the sequence of merges.

An alternative strategy would be to not treat main as stable, and instead tag any release that's intended to be depended on. There are definitely advantages to this, but I'm experimenting with the former approach first since it requires less clicks.

@MasonRemaley
MasonRemaley force-pushed the mason/simplify-lazy-deps branch from 238d7f0 to 00d355a Compare October 16, 2026 19:06
@MasonRemaley
MasonRemaley merged commit 5b3f01d into main Oct 16, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants