Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ jobs:
. /etc/profile
test "$(cygpath -aw /)" = "${{github.workspace}}\minimal-sdk" || exit 1
test "$(type -p gcc)" = "/clangarm64/bin/gcc" || exit 1
make -C ../git DEVELOPER=1 NO_PERL=1 NO_RUST=UnfortunatelyYes SKIP_DASHED_BUILT_INS=YesPlease -j8 all strip
make -C ../git DEVELOPER=1 NO_PERL=1 \
SKIP_DASHED_BUILT_INS=YesPlease -j8 all strip
- name: show build-options
shell: bash
run: . /etc/profile && ../git/git version --build-options
Expand Down
18 changes: 17 additions & 1 deletion .sparse/minimal-sdk
Original file line number Diff line number Diff line change
Expand Up @@ -239,5 +239,21 @@
/usr/bin/xargs.exe
/usr/bin/zipinfo.exe

# To accommodate Rust
# Rust
/clangarm64/bin/aarch64-w64-mingw32-clang.exe
/clangarm64/lib/libsynchronization.a
/clangarm64/lib/libuserenv.a
/clangarm64/bin/cargo.exe
/clangarm64/bin/libgit2*.dll
/clangarm64/bin/libhttp_parser*.dll
/clangarm64/bin/libsqlite*.dll
/clangarm64/bin/libunwind.dll
/clangarm64/bin/rustc.exe
/clangarm64/bin/rustc_driver*.dll
/clangarm64/bin/std-*.dll
/clangarm64/bin/libLLVM*.dll
/clangarm64/bin/libxml2*.dll
/clangarm64/bin/libLTO.dll
/clangarm64/bin/libRemarks.dll
/clangarm64/lib/rustlib/aarch64-pc-windows-gnullvm/lib/
/clangarm64/lib/libdbghelp.a
Binary file added clangarm64/bin/cargo-clippy.exe
Binary file not shown.
Binary file added clangarm64/bin/cargo-fmt.exe
Binary file not shown.
Binary file added clangarm64/bin/cargo.exe
Binary file not shown.
Binary file added clangarm64/bin/clippy-driver.exe
Binary file not shown.
Binary file added clangarm64/bin/git2.exe
Binary file not shown.
Binary file added clangarm64/bin/libgit2-1.9.dll
Binary file not shown.
Binary file added clangarm64/bin/libhttp_parser-2.dll
Binary file not shown.
39 changes: 39 additions & 0 deletions clangarm64/bin/rust-gdb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/sh
# Exit if anything fails
set -e

# Prefer rustc in the same directory as this script
DIR="$(dirname "$0")"
if [ -x "$DIR/rustc" ]; then
RUSTC="$DIR/rustc"
else
RUSTC="rustc"
fi

# Find out where the pretty printer Python module is
RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)"
GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
# Get the commit hash for path remapping
RUSTC_COMMIT_HASH="$("$RUSTC" -vV | sed -n 's/commit-hash: \([a-zA-Z0-9_]*\)/\1/p')"

# Set the environment variable `RUST_GDB` to overwrite the call to a
# different/specific command (defaults to `gdb`).
RUST_GDB="${RUST_GDB:-gdb}"

# Run GDB with the additional arguments that load the pretty printers
# Prepend base GDB flags ahead of any arguments passed by the user
set -- \
--directory="$GDB_PYTHON_MODULE_DIRECTORY" \
-iex "add-auto-load-safe-path $GDB_PYTHON_MODULE_DIRECTORY" \
-iex "set substitute-path /rustc/$RUSTC_COMMIT_HASH $RUSTC_SYSROOT/lib/rustlib/src/rust" \
"$@"

# Unstable (nightly-only) trim-paths feature, activated only if
# - RUST_GDB_TRIM_PATHS=unstable is set
# - and if the python file is present (only shipped on nightly)
GDB_TRIM_PATHS="$GDB_PYTHON_MODULE_DIRECTORY/gdb_trim_paths.py"
if [ "${RUST_GDB_TRIM_PATHS:-}" = "unstable" ] && [ -f "$GDB_TRIM_PATHS" ]; then
set -- -x "$GDB_TRIM_PATHS" "$@"
fi

PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" exec ${RUST_GDB} "$@"
67 changes: 67 additions & 0 deletions clangarm64/bin/rust-gdbgui
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/bin/sh

# Exit if anything fails
set -e

if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ] || [ "$1" = "--help" ]; then
echo "
rust-gdbgui
===========
gdbgui - https://gdbgui.com - is a graphical front-end to GDB
that runs in a browser. This script invokes gdbgui with the Rust
pretty printers loaded.

Simple usage : rust-gdbgui target/debug/myprog
With arguments: rust-gdbgui 'target/debug/myprog arg1 arg2...'
(note the quotes)


Hints
=====
gdbgui won't be able to find the rust 'main' method automatically, so
in its options make sure to disable the 'Add breakpoint to main after
loading executable' setting to avoid a 'File not found: main' warning
on startup.

Instead, type 'main' into gdbgui's file browser and you should get
auto-completion on the filename. Just pick 'main.rs', add a breakpoint
by clicking in the line number gutter, and type 'r' or hit the Restart
icon to start your program running.
"
exit 0
fi

# Prefer rustc in the same directory as this script
DIR="$(dirname "$0")"
if [ -x "$DIR/rustc" ]; then
RUSTC="$DIR/rustc"
else
RUSTC="rustc"
fi

# Find out where the pretty printer Python module is
RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)"
GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
# Get the commit hash for path remapping
RUSTC_COMMIT_HASH="$("$RUSTC" -vV | sed -n 's/commit-hash: \([a-zA-Z0-9_]*\)/\1/p')"

# Set the environment variable `RUST_GDB` to overwrite the call to a
# different/specific command (defaults to `gdb`).
RUST_GDB="${RUST_GDB:-gdb}"

# Set the environment variable `RUST_GDBGUI` to overwrite the call to a
# different/specific command (defaults to `gdbgui`).
RUST_GDBGUI="${RUST_GDBGUI:-gdbgui}"

# These arguments get passed through to GDB and make it load the
# Rust pretty printers.
GDB_ARGS="--directory=\"$GDB_PYTHON_MODULE_DIRECTORY\" \
-iex \"add-auto-load-safe-path $GDB_PYTHON_MODULE_DIRECTORY\" \
-iex \"set substitute-path /rustc/$RUSTC_COMMIT_HASH $RUSTC_SYSROOT/lib/rustlib/src/rust\""

# Finally we execute gdbgui.
PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" \
exec ${RUST_GDBGUI} \
--gdb-cmd "${RUST_GDB} ${GDB_ARGS}" \
"${@}"

44 changes: 44 additions & 0 deletions clangarm64/bin/rust-lldb
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/sh

# Exit if anything fails
set -e

# Find the host triple so we can find lldb in rustlib.
host=$(rustc --print host-tuple)

# Find out where to look for the pretty printer Python module
RUSTC_SYSROOT=$(rustc --print sysroot)
RUST_LLDB="$RUSTC_SYSROOT/lib/rustlib/$host/bin/lldb"

lldb=lldb
if [ -f "$RUST_LLDB" ]; then
lldb="$RUST_LLDB"
else
if ! command -v "$lldb" > /dev/null; then
echo "$lldb not found! Please install it." >&2
exit 1
else
LLDB_VERSION=$("$lldb" --version | cut -d ' ' -f3)

if [ "$LLDB_VERSION" = "3.5.0" ]; then
cat << EOF >&2
***
WARNING: This version of LLDB has known issues with Rust and cannot display the contents of local variables!
***
EOF
fi
fi
fi

script_import="command script import \"$RUSTC_SYSROOT/lib/rustlib/etc/lldb_lookup.py\""

# Unstable (nightly-only) trim-paths feature, activated only if
# - RUST_LLDB_TRIM_PATHS=unstable is set
# - and if the python file is present (only shipped on nightly)
LLDB_TRIM_PATHS="$RUSTC_SYSROOT/lib/rustlib/etc/lldb_trim_paths.py"
if [ "${RUST_LLDB_TRIM_PATHS:-}" = "unstable" ] && [ -f "$LLDB_TRIM_PATHS" ]; then
set -- --one-line-before-file "command script import \"$LLDB_TRIM_PATHS\"" "$@"
fi

# Call LLDB with the commands added to the argument list
exec "$lldb" --one-line-before-file "$script_import" "$@"
Binary file added clangarm64/bin/rustc.exe
Binary file not shown.
Binary file added clangarm64/bin/rustc_driver-c4e8db708a545c90.dll
Binary file not shown.
Binary file added clangarm64/bin/rustdoc.exe
Binary file not shown.
Binary file added clangarm64/bin/rustfmt.exe
Binary file not shown.
74 changes: 74 additions & 0 deletions clangarm64/include/git2.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* Copyright (C) the libgit2 contributors. All rights reserved.
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/

#ifndef INCLUDE_git_git_h__
#define INCLUDE_git_git_h__

#include "git2/annotated_commit.h"
#include "git2/apply.h"
#include "git2/attr.h"
#include "git2/blob.h"
#include "git2/blame.h"
#include "git2/branch.h"
#include "git2/buffer.h"
#include "git2/cert.h"
#include "git2/checkout.h"
#include "git2/cherrypick.h"
#include "git2/clone.h"
#include "git2/commit.h"
#include "git2/common.h"
#include "git2/config.h"
#include "git2/credential.h"
#include "git2/deprecated.h"
#include "git2/describe.h"
#include "git2/diff.h"
#include "git2/email.h"
#include "git2/errors.h"
#include "git2/experimental.h"
#include "git2/filter.h"
#include "git2/global.h"
#include "git2/graph.h"
#include "git2/ignore.h"
#include "git2/index.h"
#include "git2/indexer.h"
#include "git2/mailmap.h"
#include "git2/merge.h"
#include "git2/message.h"
#include "git2/net.h"
#include "git2/notes.h"
#include "git2/object.h"
#include "git2/odb.h"
#include "git2/odb_backend.h"
#include "git2/oid.h"
#include "git2/pack.h"
#include "git2/patch.h"
#include "git2/pathspec.h"
#include "git2/proxy.h"
#include "git2/rebase.h"
#include "git2/refdb.h"
#include "git2/reflog.h"
#include "git2/refs.h"
#include "git2/refspec.h"
#include "git2/remote.h"
#include "git2/repository.h"
#include "git2/reset.h"
#include "git2/revert.h"
#include "git2/revparse.h"
#include "git2/revwalk.h"
#include "git2/signature.h"
#include "git2/stash.h"
#include "git2/status.h"
#include "git2/submodule.h"
#include "git2/tag.h"
#include "git2/transport.h"
#include "git2/transaction.h"
#include "git2/tree.h"
#include "git2/types.h"
#include "git2/version.h"
#include "git2/worktree.h"

#endif
132 changes: 132 additions & 0 deletions clangarm64/include/git2/annotated_commit.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
/*
* Copyright (C) the libgit2 contributors. All rights reserved.
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#ifndef INCLUDE_git_annotated_commit_h__
#define INCLUDE_git_annotated_commit_h__

#include "common.h"
#include "repository.h"
#include "types.h"

/**
* @file git2/annotated_commit.h
* @brief A commit and information about how it was looked up by the user.
* @defgroup git_annotated_commit Git annotated commit routines
* @ingroup Git
*
* An "annotated commit" is a commit that contains information about
* how the commit was resolved, which can be used for maintaining the
* user's "intent" through commands like merge and rebase. For example,
* if a user wants to "merge HEAD" then an annotated commit is used to
* both contain the HEAD commit _and_ the fact that it was resolved as
* the HEAD ref.
* @{
*/
GIT_BEGIN_DECL

/**
* Creates a `git_annotated_commit` from the given reference.
* The resulting git_annotated_commit must be freed with
* `git_annotated_commit_free`.
*
* @param[out] out pointer to store the git_annotated_commit result in
* @param repo repository that contains the given reference
* @param ref reference to use to lookup the git_annotated_commit
* @return 0 on success or error code
*/
GIT_EXTERN(int) git_annotated_commit_from_ref(
git_annotated_commit **out,
git_repository *repo,
const git_reference *ref);

/**
* Creates a `git_annotated_commit` from the given fetch head data.
* The resulting git_annotated_commit must be freed with
* `git_annotated_commit_free`.
*
* @param[out] out pointer to store the git_annotated_commit result in
* @param repo repository that contains the given commit
* @param branch_name name of the (remote) branch
* @param remote_url url of the remote
* @param id the commit object id of the remote branch
* @return 0 on success or error code
*/
GIT_EXTERN(int) git_annotated_commit_from_fetchhead(
git_annotated_commit **out,
git_repository *repo,
const char *branch_name,
const char *remote_url,
const git_oid *id);

/**
* Creates a `git_annotated_commit` from the given commit id.
* The resulting git_annotated_commit must be freed with
* `git_annotated_commit_free`.
*
* An annotated commit contains information about how it was
* looked up, which may be useful for functions like merge or
* rebase to provide context to the operation. For example,
* conflict files will include the name of the source or target
* branches being merged. It is therefore preferable to use the
* most specific function (eg `git_annotated_commit_from_ref`)
* instead of this one when that data is known.
*
* @param[out] out pointer to store the git_annotated_commit result in
* @param repo repository that contains the given commit
* @param id the commit object id to lookup
* @return 0 on success or error code
*/
GIT_EXTERN(int) git_annotated_commit_lookup(
git_annotated_commit **out,
git_repository *repo,
const git_oid *id);

/**
* Creates a `git_annotated_commit` from a revision string.
*
* See `man gitrevisions`, or
* http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for
* information on the syntax accepted.
*
* @param[out] out pointer to store the git_annotated_commit result in
* @param repo repository that contains the given commit
* @param revspec the extended sha syntax string to use to lookup the commit
* @return 0 on success or error code
*/
GIT_EXTERN(int) git_annotated_commit_from_revspec(
git_annotated_commit **out,
git_repository *repo,
const char *revspec);

/**
* Gets the commit ID that the given `git_annotated_commit` refers to.
*
* @param commit the given annotated commit
* @return commit id
*/
GIT_EXTERN(const git_oid *) git_annotated_commit_id(
const git_annotated_commit *commit);

/**
* Get the refname that the given `git_annotated_commit` refers to.
*
* @param commit the given annotated commit
* @return ref name.
*/
GIT_EXTERN(const char *) git_annotated_commit_ref(
const git_annotated_commit *commit);

/**
* Frees a `git_annotated_commit`.
*
* @param commit annotated commit to free
*/
GIT_EXTERN(void) git_annotated_commit_free(
git_annotated_commit *commit);

/** @} */
GIT_END_DECL
#endif
Loading