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

Add --version arg to all buildable binaries #5385

Open
wileyj opened this issue Oct 25, 2024 · 6 comments
Open

Add --version arg to all buildable binaries #5385

wileyj opened this issue Oct 25, 2024 · 6 comments
Assignees
Labels
enhancement Iterations on existing features or infrastructure. good first issue Appropriate for a new open source contribution.

Comments

@wileyj
Copy link
Contributor

wileyj commented Oct 25, 2024

currently, only stacks-node and stacks-signer respond to the --version arg:

$ target/release/stacks-node --version
INFO [1729868721.863293] [testnet/stacks-node/src/main.rs:285] [main] stacks-node 0.1.0 (:, release build, linux [x86_64])
target/release/stacks-node <SUBCOMMAND>
Run a stacks-node.

USAGE:
stacks-node <SUBCOMMAND>
...

All binaries should respond similarly to that arg.

@wileyj wileyj added enhancement Iterations on existing features or infrastructure. good first issue Appropriate for a new open source contribution. labels Oct 25, 2024
@saralab saralab added this to the Nakamoto-3.0.x milestone Oct 30, 2024
@cipherzzz
Copy link

@wileyj - you can assign this to me

@wileyj
Copy link
Contributor Author

wileyj commented Nov 7, 2024

@wileyj - you can assign this to me

its a little more complicated as it turns out: #5399

basically, updating cargo.toml won't work since we use a custom version string. i'd prefer to not have to update source code files with version either though.

if you have a different idea (maybe a simple text file or yml that is read on compile?) i'd be interested though, and we can see what @hstove thinks

@cipherzzz
Copy link

cipherzzz commented Nov 9, 2024

@wileyj
So, I build the lite version and I'm seeing the following binaries. The checked ones have a version flag from what I can see.

  • blockstack-cli
  • clarity-cli
  • relay-server
  • stacks-events
  • stacks-inspect
  • stacks-node
  • stacks-signer

Is this what you're wanting? For all the unchecked binaries to have a version flag?

@wileyj
Copy link
Contributor Author

wileyj commented Nov 9, 2024

correct. additionally, there needs to be an easier way to set the version (in the linked PR, @hstove proposes updating the source files, but i think we can do it more simply like in a yaml or plain text. yaml sounds better to be honest).
All binaries should refer to this file, but an env var should override.

examplle of what this file may look like:

stacks-node: 3.0.0.0.2
stacks-signer: 3.0.0.0.2.0
blockstack-cli: 3.0.0.0.2
...

and if an env var is set, that should override the values in the file.
i.e.

STACKS_NODE_VERSION="3.0.0.0.5" cargo build ...

should override it any values in the yaml

@cipherzzz
Copy link

@wileyj - are you wanting the env var to be passed in the binary root build command or the monorepo root? Ie. Set the stacks-node version in its own build.rs or set all the versions from the root build.rs?

@hstove
Copy link
Contributor

hstove commented Nov 11, 2024

I think a build.rs script makes sense (it would probably be needed if we had a root YAML) file, and then we would want to provide two separate versions ("stacks node" version and signer version). It'd probably make sense to have the build script be in stacks-common, since that's a shared dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Iterations on existing features or infrastructure. good first issue Appropriate for a new open source contribution.
Projects
Status: Status: 🆕 New
Development

No branches or pull requests

4 participants