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

Should not use BuildInfo but rely on build time env #4331

Closed
tisonkun opened this issue Jul 10, 2024 · 8 comments · Fixed by #4343
Closed

Should not use BuildInfo but rely on build time env #4331

tisonkun opened this issue Jul 10, 2024 · 8 comments · Fixed by #4343
Labels
C-bug Category Bugs

Comments

@tisonkun
Copy link
Contributor

What type of bug is this?

Incorrect result

What subsystems are affected?

Standalone mode, Distributed Cluster

Minimal reproduce step

Running GreptimeDB in a brand new directory.

mysql> SELECT * FROM information_schema.build_info;
+------------+------------+------------------+-----------+-------------+
| git_branch | git_commit | git_commit_short | git_dirty | pkg_version |
+------------+------------+------------------+-----------+-------------+
| unknown    | unknown    | unknown          | unknown   | 0.8.2       |
+------------+------------+------------------+-----------+-------------+

What did you expect to see?

We should return the build info, not fetch the info at runtime.

What did you see instead?

as above

What operating system did you use?

unrelated

What version of GreptimeDB did you use?

0030821

Relevant log output and stack trace

No response

@tisonkun tisonkun added the C-bug Category Bugs label Jul 10, 2024
@tisonkun
Copy link
Contributor Author

I add this struct at 4e04a4e, while the previous usage is incorrect also.

@tisonkun
Copy link
Contributor Author

Possibly try use https://crates.io/crates/shadow-rs instead. And no more build-dependencies for all other crates.

@baoyachi
Copy link

I can support in https://crates.io/crates/shadow-rs if possible

@tisonkun
Copy link
Contributor Author

@baoyachi thank you! I'll try it in days.

Originally we make some changes because we'd support build without git, e.g., with a source tarball. I don't know if shadow-rs can populate unknown in such cases or just panic.

The source code should tell but I'm yet to have time investigate it.

@tisonkun
Copy link
Contributor Author

@baoyachi I remembered why I stopped yesterday and why I suggest to use gix now ...

error: failed to select a version for `libgit2-sys`.
    ... required by package `git2 v0.18.0`
    ... which satisfies dependency `git2 = "^0.18.0"` of package `substrait v0.17.0`
    ... which satisfies dependency `substrait_proto = "^0.17"` of package `client v0.8.2 (/Users/tison/GreptimeWorkspace/greptimedb/src/client)`
    ... which satisfies path dependency `client` (locked to 0.8.2) of package `sqlness-runner v0.8.2 (/Users/tison/GreptimeWorkspace/greptimedb/tests/runner)`
versions that meet the requirements `^0.16.0` are: 0.16.2+1.7.2, 0.16.1+1.7.1

the package `libgit2-sys` links to the native library `git2`, but it conflicts with a previous package which links to `git2` as well:
package `libgit2-sys v0.17.0+1.8.1`
    ... which satisfies dependency `libgit2-sys = "^0.17.0"` of package `git2 v0.19.0`
    ... which satisfies dependency `git2 = "^0.19.0"` of package `shadow-rs v0.29.0`
    ... which satisfies dependency `shadow-rs = "^0.29"` of package `common-version v0.8.2 (/Users/tison/GreptimeWorkspace/greptimedb/src/common/version)`
    ... which satisfies path dependency `common-version` (locked to 0.8.2) of package `catalog v0.8.2 (/Users/tison/GreptimeWorkspace/greptimedb/src/catalog)`
    ... which satisfies path dependency `catalog` (locked to 0.8.2) of package `tests-integration v0.8.2 (/Users/tison/GreptimeWorkspace/greptimedb/tests-integration)`
Only one package in the dependency graph may specify the same links value. This helps ensure that only one copy of a native library is linked in the final binary. Try to adjust your dependencies so that only one package uses the `links = "git2"` value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.

failed to select a version for `libgit2-sys` which could resolve this conflict

@tisonkun
Copy link
Contributor Author

tisonkun commented Jul 10, 2024

Maybe I'd upgrade substrait_proto to see if it can fix.

Looks good now. Let me proceed.

@tisonkun

This comment was marked as resolved.

@tisonkun
Copy link
Contributor Author

So here is the patch that I tested works locally - #4343

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category Bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants