From: Phillip Wood <phillip.wood123@gmail.com>
To: Calvin Wan <calvinwan@google.com>, git@vger.kernel.org
Cc: nasamuffin@google.com, jonathantanmy@google.com,
linusa@google.com, vdye@github.com
Subject: Re: [PATCH v3 5/6] git-std-lib: introduce git standard library
Date: Mon, 11 Sep 2023 14:22:55 +0100 [thread overview]
Message-ID: <4cefe4f8-04ee-48fb-aee4-07342b7a062f@gmail.com> (raw)
In-Reply-To: <20230908174443.1027716-5-calvinwan@google.com>
Hi Calvin
On 08/09/2023 18:44, Calvin Wan wrote:
> +ifndef GIT_STD_LIB
> LIB_OBJS += abspath.o
> LIB_OBJS += add-interactive.o
> LIB_OBJS += add-patch.o
> @@ -1196,6 +1198,27 @@ LIB_OBJS += write-or-die.o
> LIB_OBJS += ws.o
> LIB_OBJS += wt-status.o
> LIB_OBJS += xdiff-interface.o
> +else ifdef GIT_STD_LIB
> +LIB_OBJS += abspath.o
> +LIB_OBJS += ctype.o
> +LIB_OBJS += date.o
> +LIB_OBJS += hex-ll.o
> +LIB_OBJS += parse.o
> +LIB_OBJS += strbuf.o
> +LIB_OBJS += usage.o
> +LIB_OBJS += utf8.o
> +LIB_OBJS += wrapper.o
It is still not clear to me how re-using LIB_OBJS like this is
compatible with building libgit.a and git-stb-lib.a in a single make
process c.f. [1].
> +ifdef GIT_STD_LIB
> + BASIC_CFLAGS += -DGIT_STD_LIB
> + BASIC_CFLAGS += -DNO_GETTEXT
As I've said before [2] I think that being able to built git-std-lib.a
with gettext support is a prerequisite for using it to build git (just
like trace2 support is). If we cannot build git using git-std-lib then
the latter is likely to bit rot and so I don't think git-std-lib should
be merged until there is a demonstration of building git using it.
> +### Libified Git rules
> +
> +# git-std-lib
> +# `make git-std-lib.a GIT_STD_LIB=YesPlease STUB_TRACE2=YesPlease STUB_PAGER=YesPlease`
> +STD_LIB = git-std-lib.a
> +
> +$(STD_LIB): $(LIB_OBJS) $(COMPAT_OBJS) $(STUB_OBJS)
> + $(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^
This is much nicer that the previous version.
> diff --git a/git-compat-util.h b/git-compat-util.h
> index 3e7a59b5ff..14bf71c530 100644
> --- a/git-compat-util.h
> +++ b/git-compat-util.h
> @@ -455,8 +455,8 @@ static inline int noop_core_config(const char *var UNUSED,
> #define platform_core_config noop_core_config
> #endif
>
> +#if !defined(__MINGW32__) && !defined(_MSC_VER) && !defined(GIT_STD_LIB)
> int lstat_cache_aware_rmdir(const char *path);
> -#if !defined(__MINGW32__) && !defined(_MSC_VER)
> #define rmdir lstat_cache_aware_rmdir
> #endif
I thought we'd agreed that this represents a change in behavior that
should be fixed c.f. [2]
> @@ -1462,14 +1464,17 @@ static inline int is_missing_file_error(int errno_)
> return (errno_ == ENOENT || errno_ == ENOTDIR);
> }
>
> +#ifndef GIT_STD_LIB
> int cmd_main(int, const char **);
>
> /*
> * Intercept all calls to exit() and route them to trace2 to
> * optionally emit a message before calling the real exit().
> */
> +
Nit: this blank line seems unnecessary
> int common_exit(const char *file, int line, int code);
> #define exit(code) exit(common_exit(__FILE__, __LINE__, (code)))
> +#endif
>
> /*
> * You can mark a stack variable with UNLEAK(var) to avoid it being
> diff --git a/stubs/pager.c b/stubs/pager.c
> diff --git a/stubs/pager.h b/stubs/pager.h
> new file mode 100644
> index 0000000000..b797910881
> --- /dev/null
> +++ b/stubs/pager.h
> @@ -0,0 +1,6 @@
> +#ifndef PAGER_H
> +#define PAGER_H
> +
> +int pager_in_use(void);
> +
> +#endif /* PAGER_H */
Is this file actually used for anything? pager_in_use() is already
declared in pager.h in the project root directory.
> diff --git a/wrapper.c b/wrapper.c
> index 7da15a56da..eeac3741cf 100644
> --- a/wrapper.c
> +++ b/wrapper.c
> @@ -5,7 +5,6 @@
> #include "abspath.h"
> #include "parse.h"
> #include "gettext.h"
> -#include "repository.h"
It is probably worth splitting this change out with a commit message
explaining why the include is unneeded.
This is looking good, it would be really nice to see a demonstration of
building git using git-std-lib (with gettext support) in the next iteration.
Best Wishes
Phillip
[1]
https://lore.kernel.org/git/a0f04bd7-3a1e-b303-fd52-eee2af4d38b3@gmail.com/
[2]
https://lore.kernel.org/git/CAFySSZBMng9nEdCkuT5+fc6rfFgaFfU2E0NP3=jUQC1yRcUE6Q@mail.gmail.com/
next prev parent reply other threads:[~2023-09-11 21:38 UTC|newest]
Thread overview: 111+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-27 19:52 [RFC PATCH 0/8] Introduce Git Standard Library Calvin Wan
2023-06-27 19:52 ` [RFC PATCH 1/8] trace2: log fsync stats in trace2 rather than wrapper Calvin Wan
2023-06-28 2:05 ` Victoria Dye
2023-07-05 17:57 ` Calvin Wan
2023-07-05 18:22 ` Victoria Dye
2023-07-11 20:07 ` Jeff Hostetler
2023-06-27 19:52 ` [RFC PATCH 2/8] hex-ll: split out functionality from hex Calvin Wan
2023-06-28 13:15 ` Phillip Wood
2023-06-28 16:55 ` Calvin Wan
2023-06-27 19:52 ` [RFC PATCH 3/8] object: move function to object.c Calvin Wan
2023-06-27 19:52 ` [RFC PATCH 4/8] config: correct bad boolean env value error message Calvin Wan
2023-06-27 19:52 ` [RFC PATCH 5/8] parse: create new library for parsing strings and env values Calvin Wan
2023-06-27 22:58 ` Junio C Hamano
2023-06-27 19:52 ` [RFC PATCH 6/8] pager: remove pager_in_use() Calvin Wan
2023-06-27 23:00 ` Junio C Hamano
2023-06-27 23:18 ` Calvin Wan
2023-06-28 0:30 ` Glen Choo
2023-06-28 16:37 ` Glen Choo
2023-06-28 16:44 ` Calvin Wan
2023-06-28 17:30 ` Junio C Hamano
2023-06-28 20:58 ` Junio C Hamano
2023-06-27 19:52 ` [RFC PATCH 7/8] git-std-lib: introduce git standard library Calvin Wan
2023-06-28 13:27 ` Phillip Wood
2023-06-28 21:15 ` Calvin Wan
2023-06-30 10:00 ` Phillip Wood
2023-06-27 19:52 ` [RFC PATCH 8/8] git-std-lib: add test file to call git-std-lib.a functions Calvin Wan
2023-06-28 0:14 ` [RFC PATCH 0/8] Introduce Git Standard Library Glen Choo
2023-06-28 16:30 ` Calvin Wan
2023-06-30 7:01 ` Linus Arver
2023-08-10 16:33 ` [RFC PATCH v2 0/7] " Calvin Wan
2023-08-10 16:36 ` [RFC PATCH v2 1/7] hex-ll: split out functionality from hex Calvin Wan
2023-08-10 16:36 ` [RFC PATCH v2 2/7] object: move function to object.c Calvin Wan
2023-08-10 20:32 ` Junio C Hamano
2023-08-10 22:36 ` Glen Choo
2023-08-10 22:43 ` Junio C Hamano
2023-08-10 16:36 ` [RFC PATCH v2 3/7] config: correct bad boolean env value error message Calvin Wan
2023-08-10 20:36 ` Junio C Hamano
2023-08-10 16:36 ` [RFC PATCH v2 4/7] parse: create new library for parsing strings and env values Calvin Wan
2023-08-10 23:21 ` Glen Choo
2023-08-10 23:43 ` Junio C Hamano
2023-08-14 22:15 ` Jonathan Tan
2023-08-14 22:09 ` Jonathan Tan
2023-08-14 22:19 ` Junio C Hamano
2023-08-10 16:36 ` [RFC PATCH v2 5/7] date: push pager.h dependency up Calvin Wan
2023-08-10 23:41 ` Glen Choo
2023-08-14 22:17 ` Jonathan Tan
2023-08-10 16:36 ` [RFC PATCH v2 6/7] git-std-lib: introduce git standard library Calvin Wan
2023-08-14 22:26 ` Jonathan Tan
2023-08-10 16:36 ` [RFC PATCH v2 7/7] git-std-lib: add test file to call git-std-lib.a functions Calvin Wan
2023-08-14 22:28 ` Jonathan Tan
2023-08-10 22:05 ` [RFC PATCH v2 0/7] Introduce Git Standard Library Glen Choo
2023-08-15 9:20 ` Phillip Wood
2023-08-16 17:17 ` Calvin Wan
2023-08-16 21:19 ` Junio C Hamano
2023-08-15 9:41 ` Phillip Wood
2023-09-08 17:41 ` [PATCH v3 0/6] " Calvin Wan
2023-09-08 17:44 ` [PATCH v3 1/6] hex-ll: split out functionality from hex Calvin Wan
2023-09-08 17:44 ` [PATCH v3 2/6] wrapper: remove dependency to Git-specific internal file Calvin Wan
2023-09-15 17:54 ` Jonathan Tan
2023-09-08 17:44 ` [PATCH v3 3/6] config: correct bad boolean env value error message Calvin Wan
2023-09-08 17:44 ` [PATCH v3 4/6] parse: create new library for parsing strings and env values Calvin Wan
2023-09-08 17:44 ` [PATCH v3 5/6] git-std-lib: introduce git standard library Calvin Wan
2023-09-11 13:22 ` Phillip Wood [this message]
2023-09-27 14:14 ` Phillip Wood
2023-09-15 18:39 ` Jonathan Tan
2023-09-26 14:23 ` phillip.wood123
2023-09-08 17:44 ` [PATCH v3 6/6] git-std-lib: add test file to call git-std-lib.a functions Calvin Wan
2023-09-09 5:26 ` Junio C Hamano
2023-09-15 18:43 ` Jonathan Tan
2023-09-15 20:22 ` Junio C Hamano
2023-09-08 20:36 ` [PATCH v3 0/6] Introduce Git Standard Library Junio C Hamano
2023-09-08 21:30 ` Junio C Hamano
2023-09-29 21:20 ` [PATCH v4 0/4] Preliminary patches before git-std-lib Jonathan Tan
2023-09-29 21:20 ` [PATCH v4 1/4] hex-ll: separate out non-hash-algo functions Jonathan Tan
2023-10-21 4:14 ` Linus Arver
2023-09-29 21:20 ` [PATCH v4 2/4] wrapper: reduce scope of remove_or_warn() Jonathan Tan
2023-10-10 9:59 ` phillip.wood123
2023-10-10 16:13 ` Junio C Hamano
2023-10-10 17:38 ` Jonathan Tan
2023-09-29 21:20 ` [PATCH v4 3/4] config: correct bad boolean env value error message Jonathan Tan
2023-09-29 23:03 ` Junio C Hamano
2023-09-29 21:20 ` [PATCH v4 4/4] parse: separate out parsing functions from config.h Jonathan Tan
2023-10-10 10:00 ` phillip.wood123
2023-10-10 17:43 ` Jonathan Tan
2023-10-10 17:58 ` Phillip Wood
2023-10-10 20:57 ` Junio C Hamano
2023-10-10 10:05 ` [PATCH v4 0/4] Preliminary patches before git-std-lib phillip.wood123
2023-10-10 16:21 ` Jonathan Tan
2024-02-22 17:50 ` [PATCH v5 0/3] Introduce Git Standard Library Calvin Wan
2024-02-22 17:50 ` [PATCH v5 1/3] pager: include stdint.h because uintmax_t is used Calvin Wan
2024-02-22 21:43 ` Junio C Hamano
2024-02-26 18:59 ` Kyle Lippincott
2024-02-27 0:20 ` Junio C Hamano
2024-02-27 0:56 ` Kyle Lippincott
2024-02-27 2:45 ` Junio C Hamano
2024-02-27 22:29 ` Kyle Lippincott
2024-02-27 23:25 ` Junio C Hamano
2024-02-27 8:45 ` Jeff King
2024-02-27 9:05 ` Jeff King
2024-02-27 20:10 ` Kyle Lippincott
2024-02-24 1:33 ` Kyle Lippincott
2024-02-24 7:58 ` Junio C Hamano
2024-02-22 17:50 ` [PATCH v5 2/3] git-std-lib: introduce Git Standard Library Calvin Wan
2024-02-29 11:16 ` Phillip Wood
2024-02-29 17:23 ` Junio C Hamano
2024-02-29 18:27 ` Linus Arver
2024-02-29 18:54 ` Junio C Hamano
2024-02-29 20:03 ` Linus Arver
2024-02-22 17:50 ` [PATCH v5 3/3] test-stdlib: show that git-std-lib is independent Calvin Wan
2024-02-22 22:24 ` Junio C Hamano
2024-03-07 21:13 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4cefe4f8-04ee-48fb-aee4-07342b7a062f@gmail.com \
--to=phillip.wood123@gmail.com \
--cc=calvinwan@google.com \
--cc=git@vger.kernel.org \
--cc=jonathantanmy@google.com \
--cc=linusa@google.com \
--cc=nasamuffin@google.com \
--cc=phillip.wood@dunelm.org.uk \
--cc=vdye@github.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).