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 default version to version_string function #5399

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

hstove
Copy link
Contributor

@hstove hstove commented Oct 29, 2024

This PR updates the version_string function, along with our release process docs, to add a "hard-coded" version. When the STACKS_NODE_VERSION environment variable is not present (such as when building from source), the resulting version string will contain this default value.

I tried using the Cargo.toml version, which is a cleaner solution, but cargo is strict about the version format and doesn't allow our versioning scheme.

@hstove hstove requested review from kantai, obycode and wileyj October 29, 2024 17:16
@hstove hstove requested review from a team as code owners October 29, 2024 17:16
@hstove hstove changed the base branch from master to develop October 29, 2024 17:16
@wileyj
Copy link
Contributor

wileyj commented Oct 29, 2024 via email

@hstove
Copy link
Contributor Author

hstove commented Oct 30, 2024

Yeah I'm totally open to other ideas, but at least this only means we update the version in two total places. If we went with the Cargo.toml file, we'd have to change it in a number of different packages.

@wileyj
Copy link
Contributor

wileyj commented Oct 30, 2024

What if, instead of updating several source files, we used either a common file or even a text/yml file?

the idea i had was to keep version constants here: stacks-common/src/libcommon.rs
or a dedicated file in that dir that can be used during compile:
./versions.yml or something

@hstove
Copy link
Contributor Author

hstove commented Nov 15, 2024

@wileyj I've updated this PR to have a top-level versions.toml file (I used TOML because we have toml dependencies elsewhere, so it was just easier/better than a new dep). A build script automatically generates the Rust code for these constants.

Copy link
Contributor

@obycode obycode left a comment

Choose a reason for hiding this comment

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

This looks good, just had 2 questions. Also, is there a good way to write a test for this?

docs/release-process.md Outdated Show resolved Hide resolved
stacks-signer/release-process.md Outdated Show resolved Hide resolved
@hstove
Copy link
Contributor Author

hstove commented Dec 16, 2024

@obycode regarding "can we test this" - there is this old Rust issue marked "closed as needs RFC" regarding writing tests for a build script. What we would have to do is either:

  • If we want to keep toml out of stacks-common deps, then we'd have to make a new workspace package with this code, which we can test as usual. Then, the build.rs script would import that code, and stacks-common would import it as a build dependency
  • Add toml to stacks-common and write code & unit tests as usual

versions.toml Show resolved Hide resolved
@hstove hstove requested review from obycode and wileyj December 20, 2024 15:06
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.

3 participants