[GH-ISSUE #695] Don't read git config in build.rs #391

Open
opened 2026-02-28 14:32:42 +03:00 by kerem · 4 comments
Owner

Originally created by @colemickens on GitHub (Sep 25, 2025).
Original GitHub issue: https://github.com/jpochyla/psst/issues/695

Describe the bug

I find it very inappropriate that psst-core's build.rs is... reading the git configuration.

We have to patch this in nixpkgs, and I'm glad that we do. It would be great to not have to carry a patch and manually rebase it constantly because of the choices to try to embed this information in the binary, in this way.

To Reproduce

see: https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/ps/psst/make-build-reproducible.patch

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment

  • OS:
  • Version:

Additional context
Add any other context about the problem here.

Originally created by @colemickens on GitHub (Sep 25, 2025). Original GitHub issue: https://github.com/jpochyla/psst/issues/695 **Describe the bug** I find it very inappropriate that psst-core's `build.rs` is... reading the git configuration. We have to patch this in nixpkgs, and I'm glad that we do. It would be great to not have to carry a patch and manually rebase it constantly because of the choices to try to embed this information in the binary, in this way. **To Reproduce** see: https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/ps/psst/make-build-reproducible.patch **Expected behavior** A clear and concise description of what you expected to happen. **Screenshots** If applicable, add screenshots to help explain your problem. **Environment** - OS: - Version: **Additional context** Add any other context about the problem here.
Author
Owner

@colemickens commented on GitHub (Sep 25, 2025):

By the way, I hit this when trying to test the auth fixes.

<!-- gh-comment-id:3333649327 --> @colemickens commented on GitHub (Sep 25, 2025): By the way, I hit this when trying to test the auth fixes.
Author
Owner

@jacksongoode commented on GitHub (Sep 25, 2025):

I see, we read it just to get the build commit sha. Would there be another way you'd suggest that would be more preferable so this info can be kept?

<!-- gh-comment-id:3333710809 --> @jacksongoode commented on GitHub (Sep 25, 2025): I see, we read it just to get the build commit sha. Would there be another way you'd suggest that would be more preferable so this info can be kept?
Author
Owner

@colemickens commented on GitHub (Sep 25, 2025):

So, I think there's a method we can do to provide a "fake-git" to the package so that some things will work, but I'm not sure that will include the origin the way the build script expects it.

I'll dig in and send a patch when I figure out the least disruptive change on both sides.

Thanks for the quick reply!

<!-- gh-comment-id:3333744931 --> @colemickens commented on GitHub (Sep 25, 2025): So, I think there's a method we can do to provide a "fake-git" to the package so that some things will work, but I'm not sure that will include the origin the way the build script expects it. I'll dig in and send a patch when I figure out the least disruptive change on both sides. Thanks for the quick reply!
Author
Owner

@kingosticks commented on GitHub (Sep 25, 2025):

Have you looked at https://github.com/rustyhorde/vergen/ ? I think it leaves a placeholder in the values when they are unavailable due to missing git dir.

<!-- gh-comment-id:3334117189 --> @kingosticks commented on GitHub (Sep 25, 2025): Have you looked at https://github.com/rustyhorde/vergen/ ? I think it leaves a placeholder in the values when they are unavailable due to missing git dir.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/psst#391
No description provided.