Skip to content

Conversation

dbalan
Copy link
Contributor

@dbalan dbalan commented Dec 3, 2023

This commit lets flake users import wander package directly from the repo, as well as quickly run wander with

nix run "github:robinovitch61/wander"

This commit lets flake users import wander package directly from the
repo, as well as quickly run wander with

nix run "github:robinovitch61/wander"
@robinovitch61
Copy link
Owner

robinovitch61 commented Dec 3, 2023

This is awesome! Thank you @dbalan :) Question: the version shown on wander is devel when run with nix flakes, which means "version unknown":

image

The version is pulled either from the git repo if it's being built in a context with the repo data, or manually specified with ldflags as per this bit of the README. My preference would be to have the version set and not have to be manually specified and kept in sync with the git tags. Think there's any way to do this reliably?

Co-authored-by: Leo Robinovitch <leorobinovitch@gmail.com>
Comment on lines +18 to +19
src = ./.;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
src = ./.;
src = ./.;
ldflags =
[ "-X github.com/robinovitch61/wander/cmd.Version=v0.14.0" ];

The way to plug in version would be to add it to the build spec like above. I don't think there is any way to plug this in dynamically.

By default, nix flake just grabs whatever commit main is on, and pins that version in flake.lock. If we have a workflow to keep bumping this on releases, the actual code would but the release tag and commits on top.

How do you feel about it? The other option is to set the version for flake to something static like, v{version}-flake or just flake.

Copy link
Contributor Author

@dbalan dbalan Dec 8, 2023

Choose a reason for hiding this comment

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

ping @robinovitch61 :)

Copy link
Owner

Choose a reason for hiding this comment

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

Ah sorry for the delay, for some reason wasn't getting emails about this! Gonna merge as is and see what I can do about the version embed later, thanks so much for this :)

@robinovitch61 robinovitch61 merged commit c432c91 into robinovitch61:main Dec 12, 2023
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