git-for-windows / git

A fork of Git containing Windows-specific patches.
http://gitforwindows.org/
Other
8.38k stars 2.54k forks source link

Comments on Updating the SDK docs #2128

Closed SteveALee closed 3 years ago

SteveALee commented 5 years ago

These comments are observations on reading the SDK docs as I try to figure out how to build a new installer that includes pacman

https://github.com/git-for-windows/git/wiki/Updating-your-SDK

Hope this help further improve the execellent docs.

SteveALee commented 5 years ago

OK, So i see the SDK release is a bootstrap 'cloner' to clone the SDK repo with the included git and by autoexecing the cmd file.

Thus the clone instructions at the top are a manual alternative using the installed git..

I'm still unsure what the 'net installer' currently is.

I don't think pull requests are possible for wiki pages?

SteveALee commented 5 years ago

An alternative method is to start git-cmd.exe

run it from Windows on within MSYS shell?

Actually, pacman is not found from git-cmd.exe either way

PhilipOakley commented 5 years ago

The wiki pages can be edited by you to give other readers the benefit of your learning (What I Know Is ...)

Just go for it, add a note to this issue to prompt a review/check. The more contributors the better, please.

Also browse #1765 #1357 etc. I used https://github.com/git-for-windows/git/issues?utf8=%E2%9C%93&q=updating+SDK+ for the search.

SteveALee commented 5 years ago

pacman -Sy --needed msys2-runtime

:: msys2-runtime is in IgnorePkg/IgnoreGroup. Install anyway? [Y/n]

I guess I respond 'Y' as it's specified on the command line

Then I get

looking for conflicting packages...
error: failed to prepare transaction (could not satisfy dependencies)
:: installing msys2-runtime (3.0.3-1) breaks dependency 'msys2-runtime=2.11.2' required by msys2-runtime-devel
SteveALee commented 5 years ago

@PhilipOakley I updated the wiki page, can someone please check? Thanks

jearld commented 5 years ago

---------- Forwarded message ---------- From: Steve Lee notifications@github.com Date: Mar 16, 2019 4:45 PM Subject: Re: [git-for-windows/git] Comments on Updating the SDK docs (#2128) To: git-for-windows/git git@noreply.github.com Cc: Subscribed subscribed@noreply.github.com

@PhilipOakleyhttps://github.com/PhilipOakley I updated the wiki page, can someone please check? Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/git-for-windows/git/issues/2128#issuecomment-473595230, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AL3cvgGRBa__-KB9fsosDUeGlE3IX68Gks5vXWXzgaJpZM4b39bu.

Ook....

jearld commented 5 years ago

On Mar 16, 2019 4:45 PM, Steve Lee notifications@github.com wrote:

@PhilipOakleyhttps://github.com/PhilipOakley I updated the wiki page, can someone please check? Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/git-for-windows/git/issues/2128#issuecomment-473595230, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AL3cvgGRBa__-KB9fsosDUeGlE3IX68Gks5vXWXzgaJpZM4b39bu.

PhilipOakley commented 5 years ago

I've been out all day. It maybe tomorrow before I get a proper look.

PhilipOakley commented 5 years ago

I was out all day. I have just had a look at the changes https://github.com/git-for-windows/git/wiki/Updating-your-SDK/_compare/34a8ab03b0157669c82c9d92b6d742314a076fba...2f12cff04839f3de5523e23ba19097b0b9314ca3#diff-6cb7d656ed45644685fd98dc584d9058L20. which look fine by me. Thanks

SteveALee commented 5 years ago

@PhilipOakley Thanks - not hurry as This asynchronous open dev :)

You realise I made more substantial changes and 2 commits?

https://github.com/git-for-windows/git/wiki/Updating-your-SDK/_compare/7210fb71cd4f7a6b88767c2fbe2432ea5ac953fc...2f12cff04839f3de5523e23ba19097b0b9314ca3

dscho commented 5 years ago
* It then talks about the `Net Installer`

Oh my, this is a really old left-over from the Git for Windows v1.x days. Back then, I did bundle up a "full SDK" (including a snapshot of all the packages used to build Git, which would not be feasible these days, it is just too large to pack frequently), and a "net installer" that looked pretty much like today's installer: a small, self-extracting 7-Zip, with the bare minimum to pull down the rest of the SDK. (Back then, we did not have Pacman, and abused Git for a package management system.)

pacman -Sy --needed msys2-runtime

:: msys2-runtime is in IgnorePkg/IgnoreGroup. Install anyway? [Y/n]

I guess I respond 'Y' as it's specified on the command line

Yes, this is a little bit of a problem. You see, the MSYS2 runtime is a "friendly fork" of the Cygwin runtime, i.e. it is rebased frequently on top of the Cygwin runtime, and we do try to exchange/upstream fixes insofar possible.

Recently, the Cygwin runtime v3.0.0 was released, and while I waited for v3.0.1, it was still not stable enough, and my rebase was faulty (but I only realized it too late, when the fresh msys2-runtime package was already uploaded to the Pacman repository). The problem was that uname -r was truncated, and that broke the Git build itself rather badly (it relies on the output of uname -r to determine whether a 32-bit or 64-bit Git should be built).

To put a band-aid on this, I added msys2-runtime to the IgnorePkg line of https://github.com/git-for-windows/git-sdk-64 (and -32), and forced a downgrade to the latest v2.x version.

Now, as there may be a Git v2.21.1 soon, I do not want to put Git for Windows' users at risk by taking that upgrade, so I'll keep that IgnorePkg as-is until v2.21.1 is out (unless that version keeps me waiting for even longer, I had the impression that it was supposed to happen soon).

Needless to say: you do not want those IgnorePkg entries in your thingie (any idea how to call it? "Git for Windows-flavored MSYS2"?)

SteveALee commented 5 years ago

@dscho ah, OK, Isn't life fun when there's an upstream? :)

So I found that 2nd update method to be pretty broken - I used the 1st.

I left a reference to the net install in my rework of the wiki page - you might like to check I didn't get anything seriously wrong there.

I was thinking of calling it 'bash for Windows' but that was as I was working on the user installer, not SDK (still thinking about this).

dscho commented 5 years ago

I was thinking of calling it 'bash for Windows'

Isn't that too close to "Bash on Windows", also known as Windows Subsystem for Linux (WSL) or Bash on Ubuntu on Windows?

It's okay as a working title, of course, but in the end we'll want the name to say something about MSYS2. And maybe about Pacman. Maybe.

SteveALee commented 5 years ago

Isn't that too close to "Bash on Windows",

Oh good spot, I'd quite forgotten that old name. To me it's just WSL

we'll want the name to say something about MSYS2.

and MinGW. Maybe :)

dscho commented 5 years ago

How about "MSYS2 with Git for Windows"? It could ship with a real minimal set of files, update via update-via-pacman.bat and then install Git via pacman -S mingw-w64-x86_64-git (or *-i686-* on 32-bit).

SteveALee commented 5 years ago

Oooh, I like the idea of using update-via-pacman! Assume will not install too much?

I was just stripping out unwanted packages from those in the base group.

I though of letting the use install git but I see a mess of packages "mingw-w64-$ARCH-git mingw-w64-$ARCH-git-credential-manager git-extra openssh"

SteveALee commented 5 years ago

i guess a new git package could be created that just has the required deps.

dscho commented 5 years ago

Oooh, I like the idea of using update-via-pacman! Assume will not install too much?

I think you will need to patch it a little, so that it does not only run pacman -u but also lists the packages you want in addition.

I was just stripping out unwanted packages from those in the base group.

I am actually not sure that that is wise to do, as there is kind of the promise in base that these packages will be installed for use by the post-install scripts.

Remember, those post-install scripts are shell scripts, meaning that they typically require other programs to do the real work, e.g. sed.exe and grep.exe. And since the post-install scripts are not actually considered part of the actual installed files (they are implementation details, like), the things that the post-install scripts use are not listed as package dependencies.

Therefore, if you do not install all of base in the first run, you might very well end up with incorrectly-installed Pacman packages by mere virtue of their post-install scripts failing due to expected programs to be present, but missing.

dscho commented 5 years ago

i guess a new git package could be created that just has the required deps.

I would not. I would just hard-code the list of packages (and I would move git-extra to the end, to make sure that it is installed last).

SteveALee commented 5 years ago

To summerise this and the other thread

i guess a new git package could be created that just has the required deps.

would not. I would just hard-code the list of packages (and I would move git-extra to the end, to make sure that it is installed last).

Yes, that works if it's not the user manually doing and done in post-install, which is perfect (ive if one or twio folks wouldn't want git)

So more one question for pacman: when should the /var/lib/pacman/local/* files be included? Must they be bundled or can they be installedvia postinstall, including possibly update-via-pacman.bat

1: I was excluding: curl dash filesystem flex git-for-windows-keyring info pactoys-git pax-git rebase tftp-hpa ttyrec tzcode util-linux Some of these the original script excluded (but even if they are deps of other packages)

dscho commented 5 years ago
* Use a modified post-install script to run a modified `update-via-pacman.bat` to also install extra packages like git if required.

Yes. To be clear: this kind of post-install script is not a Pacman package post-install script, but the 7-Zip self-extracting archive post-install script.

when should the /var/lib/pacman/local/* files be included?

Always, but of course only the subdirectories that correspond to packages whose files you want to include

* Include ALL of base package group and deps - even though at some 6K files that's hardly minimal (see [1] below )

There are two levels of "include" here:

  1. the files that are to be bundled in the self-extracting 7-Zip archive
  2. the packages that should be pulled down via pacman in the initial run, via the post-install script run after that self-extracting archive unpacked the files.

I would really try to include only the minimal set of files in 1), just enough to get pacman to run and to be able to install base. But all of the rest I would let pacman install in 2).

PhilipOakley commented 5 years ago

@SteveALee Are we getting there in clarifying the wiki pages (I was just looking through the issues to see if there were any I could take the initiative on, and maybe even close one or two ;-)

SteveALee commented 5 years ago

@PhilipOakley Thanks the main problems were with the update the SDK page which I made conciderable pachanges to and I think you checked. There is a ref to the network installer that jusdging by @dscho comment above is obsolete.

Otherwise, I think it's OK and this can be closed (it seems we went off on a tangent)

dscho commented 3 years ago

Closing this as stale.