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 ability to add or replace variables #77

Open
lukaslueg opened this issue Dec 29, 2024 · 0 comments
Open

Add ability to add or replace variables #77

lukaslueg opened this issue Dec 29, 2024 · 0 comments

Comments

@lukaslueg
Copy link
Owner

lukaslueg commented Dec 29, 2024

One cannot retrieve git information if, for some reason, you are stuck with a non-regular clone. In my case, I have access to the full repository but since I want to build a subdirectory (monorepo) in docker, I lose my git context (which is completely reasonable).

In this case, I want to be able to provide the "lost" information manually, e.g. via an environment variable or by calling the write_variable macro myself in build.rs. This seems like a feature which would help alleviate the OP's issue as well.

I'm therefore suggesting two distinct features:

  1. The ability to include certain environment variables in built.rs. This could be done by adding variables with a BUILT_ prefix` .
  2. The ability to add or replace variables from build.rs. This could e.g. take the form of a macro set_variable!("GIT_COMMIT_HASH_SHORT", "Option<&str>", "abc1234").

If 2. is implemented, 1. probably isn't necessary as developers could easily implement the functionality themselves.

Originally posted by @FelixZY in #38 (comment)

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

No branches or pull requests

1 participant