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

Obtain git hash from git_version crate #517

Closed
Urhengulas opened this issue Jun 23, 2021 · 4 comments · Fixed by #518
Closed

Obtain git hash from git_version crate #517

Urhengulas opened this issue Jun 23, 2021 · 4 comments · Fixed by #518
Labels
difficulty: easy Pretty easy to solve priority: low Low priority for the Knurling team status: needs PR Issue just needs a Pull Request implementing the changes type: refactor parts of the code that should be improved or redesigned

Comments

@Urhengulas
Copy link
Member

Use the git_version crate for obtaining the git hash, instead of the custom build-script we used so far. Similar to knurling-rs/probe-run#221

@Urhengulas Urhengulas added priority: low Low priority for the Knurling team status: needs PR Issue just needs a Pull Request implementing the changes difficulty: easy Pretty easy to solve type: refactor parts of the code that should be improved or redesigned labels Jun 23, 2021
@Urhengulas
Copy link
Member Author

@japaric We discussed the possibility to completely get rid of build.rs with this change. But since we still want to alter the linker-script and insert the version, this isn't really possible is it?

@japaric
Copy link
Member

japaric commented Jun 24, 2021

@Urhengulas correct, we need the build script to put the defmt.x linker script in the project's target directory otherwise the linker won't find it. So we want to keep this line even if we don't modify defmt.x in the build script.

defmt/build.rs

Line 38 in fde2aab

fs::write(out.join("defmt.x"), linker_script)?;

@Urhengulas
Copy link
Member Author

@Urhengulas correct, we need the build script to put the defmt.x linker script in the project's target directory otherwise the linker won't find it. So we want to keep this line even if we don't modify defmt.x in the build script.

defmt/build.rs

Line 38 in fde2aab

fs::write(out.join("defmt.x"), linker_script)?;

But we want to modify it, don't we? To insert the version into it?

@japaric
Copy link
Member

japaric commented Jun 24, 2021

But we want to modify it, don't we? To insert the version into it?

yes, we want to continue doing that. (the last line of my last comment was referring to an hypothetical scenario)

@bors bors bot closed this as completed in 7d5aaed Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: easy Pretty easy to solve priority: low Low priority for the Knurling team status: needs PR Issue just needs a Pull Request implementing the changes type: refactor parts of the code that should be improved or redesigned
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants