-
Notifications
You must be signed in to change notification settings - Fork 319
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
cargo: enable vendored-libgit2, document how to properly dynamically link libgit2 #4163
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yuja
approved these changes
Jul 27, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I'm not a big fan of static linking, but) this should be better than ./configure
-like auto detection.
martinvonz
reviewed
Jul 27, 2024
…link libgit2 This changes less than it seems. Our CI builds already mostly linked a vendored copy of libgit2. This is because before this commit, it turns out that `git2` could link `libgit2` *either* statically or dynamically based on whether it could find a version of libgit2 it liked to link dynamically. Our CI builds usually did not provide such a version AFAIK. This made the kind of binary `cargo install` would produce unpredictable and may have contributed to martinvonz#2896. I was once very surprised when I did `brew upgrade libgit2` and then `cargo build --release` suddenly switched from building dynamically linked `jj` to the vendored version. Instead, if a packager wants to link `libgit2` dynamically, they should set an environment variable, as described inside the diff of this commit. I also think we should recommend static linking as `git2` is quite picky about the versions of `libgit2` it supports. See also rust-lang/git2-rs#1073 This might be related to martinvonz#4115.
martinvonz
approved these changes
Jul 28, 2024
tmeijn
pushed a commit
to tmeijn/dotfiles
that referenced
this pull request
Aug 15, 2024
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [martinvonz/jj](https://github.com/martinvonz/jj) | minor | `v0.19.0` -> `v0.20.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>martinvonz/jj (martinvonz/jj)</summary> ### [`v0.20.0`](https://github.com/martinvonz/jj/releases/tag/v0.20.0) [Compare Source](martinvonz/jj@v0.19.0...v0.20.0) ##### Note to packagers - `jj` now links `libgit2` statically by default. To use dynamic linking, you need to set the environment variable `LIBGIT2_NO_VENDOR=1` while compiling. ([#​4163](martinvonz/jj#4163)) ##### Breaking changes - `jj rebase --skip-empty` has been renamed to `jj rebase --skip-emptied` - `jj backout --revision` has been renamed to `jj backout --revisions`. The short alias `-r` is still supported. - [The default `immutable_heads()` set](docs/config.md#set-of-immutable-commits) now includes `untracked_remote_branches()` with the assumption that untracked branches aren't managed by you. Therefore, untracked branches are no longer displayed in `jj log` by default. - Updated defaults for graph node symbol templates `templates.log_node` and `templates.op_log_node`. - [The "fileset" language](docs/filesets.md) is now enabled by default. It can still be disable by setting `ui.allow-filesets=false`. - On `jj git fetch`/`import`, commits referred to by `HEAD@git` are no longer preserved. If a checked-out named branch gets deleted locally or remotely, the corresponding commits will be abandoned. - `jj --at-op=@​` no longer merges concurrent operations if explicitly specified. - `jj obslog -p` no longer shows diffs at non-partial squash operations. Previously, it showed the same diffs as the second predecessor. ##### Deprecations - The original configuration syntax for `jj fix` is now deprecated in favor of one that allows defining multiple tools that can affect different filesets. These can be used in combination for now. See `jj help fix` for details. ##### New features - External diff tools can now be configured to invoke the tool on each file individually instead of being passed a directory by setting `merge-tools.$TOOL.diff-invocation-mode="file-by-file"` in config.toml. - In git diffs, word-level hunks are now highlighted with underline. See [diff colors and styles](docs/config.md#diff-colors-and-styles) for customization. - New `.diff().<format>()` commit template methods are added. They can be used in order to show diffs conditionally. For example, `if(current_working_copy, diff.summary())`. - `jj git clone` and `jj git init` with an existing git repository adds the default branch of the remote as repository settings for `revset-aliases."trunk()"`.\` - `jj workspace forget` now abandons the workspace's working-copy commit if it was empty. - `jj backout` now includes the backed out commit's subject in the new commit message. - `jj backout` can now back out multiple commits at once. - `jj git clone some/nested/path` now creates the full directory tree for nested destination paths if they don't exist. - String patterns now support case‐insensitive matching by suffixing any pattern kind with `-i`. `mine()` uses case‐insensitive matching on your email address unconditionally. Only ASCII case folding is currently implemented, but this will likely change in the future. - String patterns now support `regex:"pattern"`. - New `tracked_remote_branches()` and `untracked_remote_branches()` revset functions can be used to select tracked/untracked remote branches. - The `file()` revset function now accepts fileset as argument. - New `diff_contains()` revset function can be used to search diffs. - New command `jj operation diff` that can compare changes made between two operations. - New command `jj operation show` that can show the changes made in a single operation. - New config setting `git.private-commits` to prevent commits from being pushed. - [The default commit description template](docs/config.md#default-description) can now be configured by `templates.draft_commit_description`. - `jj fix` can now be configured to run different tools on different filesets. This simplifies the use case of configuring code formatters for specific file types. See `jj help fix` for details. - Added revset functions `author_date` and `committer_date`. - `jj describe` can now update the description of multiple commits. ##### Fixed bugs - `jj status` will show different messages in a conflicted tree, depending on the state of the working commit. In particular, if a child commit fixes a conflict in the parent, this will be reflected in the hint provided by `jj status` - `jj diff --git` no longer shows the contents of binary files. - Windows binaries no longer require `vcruntime140.dll` to be installed (normally through Visual Studio.) - On quit, the builtin pager no longer waits for all outputs to be discarded. - `jj branch rename` no longer shows a warning in colocated repos. ##### Contributors Thanks to the people who made this release happen! - Anton Älgmyr ([@​algmyr](https://github.com/algmyr)) - Austin Seipp ([@​thoughtpolice](https://github.com/thoughtpolice)) - Benjamin Tan ([@​bnjmnt4n](https://github.com/bnjmnt4n)) - Daniel Ploch ([@​torquestomp](https://github.com/torquestomp)) - Danny Hooper ([@​hooper](https://github.com/hooper)) - Emily ([@​emilazy](https://github.com/emilazy)) - Essien Ita Essien ([@​essiene](https://github.com/essiene)) - Erich Gubler ([@​ErichDonGubler](https://github.com/ErichDonGubler)) - Fedor Sheremetyev ([@​sheremetyev](https://github.com/sheremetyev)) - Ilya Grigoriev ([@​ilyagr](https://github.com/ilyagr)) - Jonathan Tan ([@​jonathantanmy](https://github.com/jonathantanmy)) - Julien Vincent ([@​julienvincent](https://github.com/julienvincent)) - Martin von Zweigbergk ([@​martinvonz](https://github.com/martinvonz)) - Matt Kulukundis ([@​fowles](https://github.com/fowles)) - Matt Stark ([@​matts1](https://github.com/matts1)) - mlcui ([@​mlcui-corp](https://github.com/mlcui-corp)) - Philip Metzger ([@​PhilipMetzger](https://github.com/PhilipMetzger)) - Scott Taylor ([@​scott2000](https://github.com/scott2000)) - Skyler Grey ([@​Minion3665](https://github.com/Minion3665)) - Stephen Jennings ([@​jennings](https://github.com/jennings)) - Tim Janik ([@​tim-janik](https://github.com/tim-janik)) - Vincent Ging Ho Yim ([@​cenviity](https://github.com/cenviity)) - Vladimír Čunát ([@​vcunat](https://github.com/vcunat)) - Vladimir ([@​0xdeafbeef](https://github.com/0xdeafbeef)) - Yuya Nishihara ([@​yuja](https://github.com/yuja)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR succeeds #4120.
This changes less than it seems. Our CI builds already mostly linked a vendored copy of libgit2. This is because before this commit, it turns out that
git2
could linklibgit2
either statically or dynamically based on whether it could find a version of libgit2 it liked to link dynamically. Our CI builds usually did not provide such a version AFAIK.This made the kind of binary
cargo install
would produce unpredictable and may have contributed to #2896. I was once very surprised when I didbrew upgrade libgit2
and thencargo build --release
suddenly switched from building dynamically linkedjj
to the vendored version.Instead, if a packager wants to link
libgit2
dynamically, they should set an environment variable, as described inside the diff of this commit. I also think we should recommend static linking asgit2
is quite picky about the versions oflibgit2
it supports. See also rust-lang/git2-rs#1073This might be related to #4115.
Also cc #4080, though I think this is orthogonal to upgrading out
git2
version.