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

ci: fix the vs-build job after adding git maintenance #807

Closed
wants to merge 1 commit into from

Conversation

dscho
Copy link
Member

@dscho dscho commented Dec 4, 2020

Together with #805, this should fix the vs-build job in the CI build of seen.

cc: Jeff King peff@peff.net

In 0a21d0e (Makefile: mark git-maintenance as a builtin,
2020-12-01), we marked git-maintenance as a builtin in the Makefile, but
forgot to do the same in `CMakeLists.txt`.

Rather than always play catch-up and adjust `git_builtin_extra`
manually, use the `BUILT_INS` definitions in the Makefile as
authoritative source and generate `git_builtin_extra` dynamically.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho
Copy link
Member Author

dscho commented Dec 4, 2020

/submit

@gitgitgadget
Copy link

gitgitgadget bot commented Dec 4, 2020

Submitted as pull.807.git.1607110436367.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git pr-807/dscho/cmake-and-extra-builtins-v1

To fetch this version to local tag pr-807/dscho/cmake-and-extra-builtins-v1:

git fetch --no-tags https://github.com/gitgitgadget/git tag pr-807/dscho/cmake-and-extra-builtins-v1

@gitgitgadget
Copy link

gitgitgadget bot commented Dec 4, 2020

On the Git mailing list, Junio C Hamano wrote (reply to this):

"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:

> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> In 0a21d0e08902 (Makefile: mark git-maintenance as a builtin,
> 2020-12-01), we marked git-maintenance as a builtin in the Makefile, but
> forgot to do the same in `CMakeLists.txt`.
>
> Rather than always play catch-up and adjust `git_builtin_extra`
> manually, use the `BUILT_INS` definitions in the Makefile as
> authoritative source and generate `git_builtin_extra` dynamically.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
>     ci: fix the vs-build job after adding git maintenance
>     
>     Together with https://github.com/gitgitgadget/git/pull/805, this should
>     fix the vs-build job in the CI build of seen.

I suspect that the breakage 805 addresses affects even 'master'; is
the breakage this patch fixes limited to 'seen', or affect everybody?

> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-807%2Fdscho%2Fcmake-and-extra-builtins-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-807/dscho/cmake-and-extra-builtins-v1
> Pull-Request: https://github.com/gitgitgadget/git/pull/807
>
>  contrib/buildsystems/CMakeLists.txt | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt
> index df539a44fa..c151dd7257 100644
> --- a/contrib/buildsystems/CMakeLists.txt
> +++ b/contrib/buildsystems/CMakeLists.txt
> @@ -114,6 +114,16 @@ macro(parse_makefile_for_scripts list_var regex lang)
>  	endif()
>  endmacro()
>  
> +macro(parse_makefile_for_executables list_var regex)
> +	file(STRINGS ${CMAKE_SOURCE_DIR}/Makefile ${list_var} REGEX "^${regex} \\+= git-(.*)")
> +	string(REPLACE "${regex} +=" "" ${list_var} ${${list_var}})
> +	string(STRIP ${${list_var}} ${list_var}) #remove trailing/leading whitespaces
> +	string(REPLACE "git-" "" ${list_var} ${${list_var}}) #strip `git-` prefix
> +	string(REPLACE "\$X" ";" ${list_var} ${${list_var}}) #strip $X, ; is for converting the string into a list
> +	list(TRANSFORM ${list_var} STRIP) #remove trailing/leading whitespaces for each element in list
> +	list(REMOVE_ITEM ${list_var} "") #remove empty list elements
> +endmacro()
> +
>  include(CheckTypeSize)
>  include(CheckCSourceRuns)
>  include(CheckCSourceCompiles)
> @@ -673,10 +683,7 @@ if(CURL_FOUND)
>  	endif()
>  endif()
>  
> -set(git_builtin_extra
> -	cherry cherry-pick format-patch fsck-objects
> -	init merge-subtree restore show
> -	stage status switch whatchanged)
> +parse_makefile_for_executables(git_builtin_extra "BUILT_INS")
>  
>  #Creating hardlinks
>  foreach(s ${git_SOURCES} ${git_builtin_extra})
>
> base-commit: 898f80736c75878acc02dc55672317fcc0e0a5a6

@gitgitgadget
Copy link

gitgitgadget bot commented Dec 4, 2020

On the Git mailing list, Jeff King wrote (reply to this):

On Fri, Dec 04, 2020 at 07:33:56PM +0000, Johannes Schindelin via GitGitGadget wrote:

> In 0a21d0e08902 (Makefile: mark git-maintenance as a builtin,
> 2020-12-01), we marked git-maintenance as a builtin in the Makefile, but
> forgot to do the same in `CMakeLists.txt`.

Oof, right.

> Rather than always play catch-up and adjust `git_builtin_extra`
> manually, use the `BUILT_INS` definitions in the Makefile as
> authoritative source and generate `git_builtin_extra` dynamically.

Yay. This is exactly how I'd hoped things would work or the cmake file
in general. I don't mind following micro-formats within our Makefile to
keep things easier for the cmake parsing side.

>  contrib/buildsystems/CMakeLists.txt | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)

The implementation looks plausibly correct to me (bearing in mind that
I've never written cmake).

-Peff

@gitgitgadget
Copy link

gitgitgadget bot commented Dec 4, 2020

User Jeff King <peff@peff.net> has been added to the cc: list.

@gitgitgadget
Copy link

gitgitgadget bot commented Dec 4, 2020

On the Git mailing list, Johannes Schindelin wrote (reply to this):

Hi Junio,

On Fri, 4 Dec 2020, Junio C Hamano wrote:

> "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
> writes:
>
> > From: Johannes Schindelin <johannes.schindelin@gmx.de>
> >
> > In 0a21d0e08902 (Makefile: mark git-maintenance as a builtin,
> > 2020-12-01), we marked git-maintenance as a builtin in the Makefile, but
> > forgot to do the same in `CMakeLists.txt`.
> >
> > Rather than always play catch-up and adjust `git_builtin_extra`
> > manually, use the `BUILT_INS` definitions in the Makefile as
> > authoritative source and generate `git_builtin_extra` dynamically.
> >
> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> > ---
> >     ci: fix the vs-build job after adding git maintenance
> >
> >     Together with https://github.com/gitgitgadget/git/pull/805, this should
> >     fix the vs-build job in the CI build of seen.
>
> I suspect that the breakage 805 addresses affects even 'master'; is
> the breakage this patch fixes limited to 'seen', or affect everybody?

I haven't checked `master` yet, but `next` definitely was affected. I
_think_ the problem was introduced when Peff's patch added the
`git-maintenance` tool to the `BUILT_INS` list in the `Makefile` (and
hence we try to `tar` it up with all the other build artifacts in the
`vs-build` job) but wasn't added to `CMakeLists.txt` (and therefore
`vs-build` would not generate that hard-link).

Ciao,
Dscho

>
> > Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-807%2Fdscho%2Fcmake-and-extra-builtins-v1
> > Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-807/dscho/cmake-and-extra-builtins-v1
> > Pull-Request: https://github.com/gitgitgadget/git/pull/807
> >
> >  contrib/buildsystems/CMakeLists.txt | 15 +++++++++++----
> >  1 file changed, 11 insertions(+), 4 deletions(-)
> >
> > diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt
> > index df539a44fa..c151dd7257 100644
> > --- a/contrib/buildsystems/CMakeLists.txt
> > +++ b/contrib/buildsystems/CMakeLists.txt
> > @@ -114,6 +114,16 @@ macro(parse_makefile_for_scripts list_var regex lang)
> >  	endif()
> >  endmacro()
> >
> > +macro(parse_makefile_for_executables list_var regex)
> > +	file(STRINGS ${CMAKE_SOURCE_DIR}/Makefile ${list_var} REGEX "^${regex} \\+= git-(.*)")
> > +	string(REPLACE "${regex} +=" "" ${list_var} ${${list_var}})
> > +	string(STRIP ${${list_var}} ${list_var}) #remove trailing/leading whitespaces
> > +	string(REPLACE "git-" "" ${list_var} ${${list_var}}) #strip `git-` prefix
> > +	string(REPLACE "\$X" ";" ${list_var} ${${list_var}}) #strip $X, ; is for converting the string into a list
> > +	list(TRANSFORM ${list_var} STRIP) #remove trailing/leading whitespaces for each element in list
> > +	list(REMOVE_ITEM ${list_var} "") #remove empty list elements
> > +endmacro()
> > +
> >  include(CheckTypeSize)
> >  include(CheckCSourceRuns)
> >  include(CheckCSourceCompiles)
> > @@ -673,10 +683,7 @@ if(CURL_FOUND)
> >  	endif()
> >  endif()
> >
> > -set(git_builtin_extra
> > -	cherry cherry-pick format-patch fsck-objects
> > -	init merge-subtree restore show
> > -	stage status switch whatchanged)
> > +parse_makefile_for_executables(git_builtin_extra "BUILT_INS")
> >
> >  #Creating hardlinks
> >  foreach(s ${git_SOURCES} ${git_builtin_extra})
> >
> > base-commit: 898f80736c75878acc02dc55672317fcc0e0a5a6
>

@gitgitgadget
Copy link

gitgitgadget bot commented Dec 4, 2020

On the Git mailing list, Johannes Schindelin wrote (reply to this):

Hi Peff,

On Fri, 4 Dec 2020, Jeff King wrote:

> On Fri, Dec 04, 2020 at 07:33:56PM +0000, Johannes Schindelin via GitGitGadget wrote:
>
> > Rather than always play catch-up and adjust `git_builtin_extra`
> > manually, use the `BUILT_INS` definitions in the Makefile as
> > authoritative source and generate `git_builtin_extra` dynamically.
>
> Yay. This is exactly how I'd hoped things would work or the cmake file
> in general. I don't mind following micro-formats within our Makefile to
> keep things easier for the cmake parsing side.

Me, too. I am somewhat embarrassed that I missed the `git_builtin_extra`
list in my review of the CMake patch series...

> >  contrib/buildsystems/CMakeLists.txt | 15 +++++++++++----
> >  1 file changed, 11 insertions(+), 4 deletions(-)
>
> The implementation looks plausibly correct to me (bearing in mind that
> I've never written cmake).

It is a close copy of the two macros we already use to parse the
`Makefile` for lists of `.o` files and for scripts.

Together with the fact that this patch fixes the CI build of Git for
Windows' `shears/seen` branch (which is a continuously-rebased version of
Git for Windows' `main` branch onto `seen`, plus fixups), I am fairly
confident that it is correct.

Ciao,
Dscho

@gitgitgadget
Copy link

gitgitgadget bot commented Dec 4, 2020

This branch is now known as js/cmake-extra-built-ins-fix.

@gitgitgadget
Copy link

gitgitgadget bot commented Dec 4, 2020

This patch series was integrated into seen via git@4adbb6c.

@gitgitgadget gitgitgadget bot added the seen label Dec 4, 2020
@gitgitgadget
Copy link

gitgitgadget bot commented Dec 9, 2020

This patch series was integrated into seen via git@13ea9b0.

@gitgitgadget
Copy link

gitgitgadget bot commented Dec 9, 2020

This patch series was integrated into next via git@f29945c.

@gitgitgadget gitgitgadget bot added the next label Dec 9, 2020
@gitgitgadget
Copy link

gitgitgadget bot commented Dec 14, 2020

This patch series was integrated into seen via git@75010fa.

@gitgitgadget
Copy link

gitgitgadget bot commented Dec 14, 2020

This patch series was integrated into seen via git@043bfc6.

@gitgitgadget
Copy link

gitgitgadget bot commented Dec 14, 2020

This patch series was integrated into next via git@043bfc6.

@gitgitgadget
Copy link

gitgitgadget bot commented Dec 14, 2020

This patch series was integrated into master via git@043bfc6.

@gitgitgadget gitgitgadget bot added the master label Dec 14, 2020
@gitgitgadget
Copy link

gitgitgadget bot commented Dec 14, 2020

Closed via 043bfc6.

@gitgitgadget gitgitgadget bot closed this Dec 14, 2020
@dscho dscho deleted the cmake-and-extra-builtins branch December 15, 2020 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant