Skip to content

How to get git hash in build.rs ? #1566

Answered by enomado
enomado asked this question in Q&A
Discussion options

You must be logged in to vote

Looks like a found a problem.

stderr was fatal: not a git repository (or any parent up to mount point /home/sc/t/bur)

real problem was what my repo is not equal to workspace root.
I have something like

git_repo
    .git
    my_rust_project

when I run cross build, my pwd is git_repo/my_rust_project, so I have mounted only my_rust_project, and ./../.git is not accessible.

Is there any way to set mount point as ./../, or should I reorganize my repository?

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@enomado
Comment options

@enomado
Comment options

Answer selected by enomado
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants