mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-29 16:45:30 +08:00
Merge #4812
4812: Allow `MEILI_NO_VERGEN` env var to skip vergen r=irevoire a=dureuill - vergen checks the state of the `.git` directory to embed commit information into the `meilisearch` binary and the `cargo xtask bench` invocations. - This check unfortunately results in too many recompilation of the `meilisearch` binary. - This PR allows skipping vergen when the `MEILI_NO_VERGEN` variable is present in the environment Co-authored-by: Louis Dureuil <louis@meilisearch.com>
This commit is contained in:
commit
48bc797dce
@ -62,6 +62,10 @@ We recommend using the standard `$HOME/.cache/lindera` directory:
|
|||||||
export LINDERA_CACHE=$HOME/.cache/lindera
|
export LINDERA_CACHE=$HOME/.cache/lindera
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Furthermore, you can improve incremental compilation by setting the `MEILI_NO_VERGEN` environment variable.
|
||||||
|
Setting this variable will prevent the Meilisearch binary from being rebuilt each time the directory that hosts the Meilisearch repository changes.
|
||||||
|
Do not enable this environment variable for production builds (as it will break the `version` route, among other things).
|
||||||
|
|
||||||
#### Snapshot-based tests
|
#### Snapshot-based tests
|
||||||
|
|
||||||
We are using [insta](https://insta.rs) to perform snapshot-based testing.
|
We are using [insta](https://insta.rs) to perform snapshot-based testing.
|
||||||
|
@ -5,6 +5,13 @@ fn main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn emit_git_variables() -> anyhow::Result<()> {
|
fn emit_git_variables() -> anyhow::Result<()> {
|
||||||
|
println!("cargo::rerun-if-env-changed=MEILI_NO_VERGEN");
|
||||||
|
|
||||||
|
let has_vergen =
|
||||||
|
!matches!(std::env::var_os("MEILI_NO_VERGEN"), Some(x) if x != "false" && x != "0");
|
||||||
|
|
||||||
|
anyhow::ensure!(has_vergen, "disabled via `MEILI_NO_VERGEN`");
|
||||||
|
|
||||||
// Note: any code that needs VERGEN_ environment variables should take care to define them manually in the Dockerfile and pass them
|
// Note: any code that needs VERGEN_ environment variables should take care to define them manually in the Dockerfile and pass them
|
||||||
// in the corresponding GitHub workflow (publish_docker.yml).
|
// in the corresponding GitHub workflow (publish_docker.yml).
|
||||||
// This is due to the Dockerfile building the binary outside of the git directory.
|
// This is due to the Dockerfile building the binary outside of the git directory.
|
||||||
|
Loading…
Reference in New Issue
Block a user