Skip to content

building an installer #1326

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

Closed
1 task done
albfan opened this issue Oct 19, 2017 · 9 comments
Closed
1 task done

building an installer #1326

albfan opened this issue Oct 19, 2017 · 9 comments
Labels

Comments

@albfan
Copy link

albfan commented Oct 19, 2017

  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit? 2.14.2.3 64 bits
$ git --version --build-options

git version 2.14.2.windows.3
built from commit: 924c19fc000d3759486b68bd73bc592fa02e367c
sizeof-long: 4
machine: x86_64

  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
    Windows 10 64 bits
$ cmd.exe /c ver

Microsoft Windows [Versión 10.0.14393]

  • What options did you set as part of the installation? Or did you choose the
    defaults?

    Yes

# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

I found this on C:\Program Files\Git\etc\install-options.txt

Path Option: Cmd
SSH Option: OpenSSH
CURL Option: OpenSSL
CRLF Option: CRLFCommitAsIs
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
Use Credential Manager: Enabled
Enable Symlinks: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

I'm building an installer

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

C:\Users\afanjul\Desktop\Git SDK 64-bit.lnk

cd /usr/git/build-extra
 ./installer/release.sh 2.14.2.3-with-open-document

  • What did you expect to occur after running these commands?

An installer is made

  • What actually happened instead?
Generating release notes to be included in the installer ...
markdown is /usr/bin/markdown
Compiling edit-git-bash.exe ...
make: se entra en el directorio '/usr/src/build-extra'
make: 'edit-git-bash.exe' está actualizado.
make: se sale del directorio '/usr/src/build-extra'
Generating file list to be included in the installer ...
Launching Inno Setup compiler ...
Error on line 1585 in C:\git-sdk-64\usr\src\build-extra\installer\file-list.iss: Source file "C:\git-sdk-64\mingw64\share\doc\git-doc\technical\api-builtin.html" does not exist.
Compile aborted.
Could not make installer
  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

This is not related to specific repository


From lessons learned on git-for-windows/build-extra#148 I want to ask few questions

  • In wiki about create an installer it should be clearly point out you need to use Git SDK 64-bit.lnk (like in wiki page build git) it's not obvious. Can I do that?

  • I have updated /usr/src/build-extra and /usr/src/git. Why it is asking for an api-builtin.html? is something removed and should I propose a PR on build-extra

  • The option to install default git package (when you want to modify things only in build-extra

    $ pacman -S mingw-${ARCH}-git

should be added too to wiki, isn't it?

All this ideas try to ease contributions for others. Any other ideas (that just take time and is not done for that reason) please comment here to see how we can get it done

@dscho
Copy link
Member

dscho commented Oct 19, 2017

In wiki about create an installer it should be clearly point out you need to use Git SDK 64-bit.lnk (like in wiki page build git) it's not obvious. Can I do that?

Absolutely!

The option to install default git package (when you want to modify things only in build-extra

$ pacman -S mingw-${ARCH}-git

Somebody changes that to pacboy sync git:x recently IIRC.

Why it is asking for an api-builtin.html?

I think it tries to include the documentation wholesale. I am not sure why that file is missing for you...

For me, it is there, and it is owned by the mingw-w64-git-doc-html package:

$ pacman -Qo /mingw64/share/doc/git-doc/technical/api-builtin.html
/mingw64/share/doc/git-doc/technical/api-builtin.html is owned by mingw-w64-x86_64-git-doc-html 2.14.2.2.34c1a976dc-1

Is that package not installed for you?

@dscho dscho added the question label Oct 19, 2017
@albfan
Copy link
Author

albfan commented Oct 20, 2017

Didn't know about pacboy. Seems a useful wrapper

Wiki edited

After update git-doc-html a couple of times (I still see a warning about that api-builtin.html once) now installer is running again

I install with it but I still get an error running a git-bash.exe after that

mkdir: cannot create directory '/dev/shm': Read-only file system

Creating /dev/shm directory failed.
POSIX semaphores and POSIX shared memory will not work

mkdir: cannot create directory '/dev/mqueue': Read-only file system

Creating /dev/mqueue directory failed.
POSIX message queues will not work

ln: failed to create symbolic link '/dev/stdin': Read-only file system
ln: failed to create symbolic link '/dev/stdout': Read-only file system
ln: failed to create symbolic link '/dev/stderr': Read-only file system
ln: failed to create symbolic link '/dev/fd': Read-only file system
ln: failed to create symbolic link '/etc/mtab': Permission denied
'C:\WINDOWS\system32\drivers\etc\hosts' -> '/etc/hosts'
/usr/bin/cp: cannot create regular file '/etc/hosts': Permission denied
'C:\WINDOWS\system32\drivers\etc\protocol' -> '/etc/protocols'
/usr/bin/cp: cannot create regular file '/etc/protocols': Permission denied
'C:\WINDOWS\system32\drivers\etc\services' -> '/etc/services'
/usr/bin/cp: cannot create regular file '/etc/services': Permission denied
'C:\WINDOWS\system32\drivers\etc\networks' -> '/etc/networks'
/usr/bin/cp: cannot create regular file '/etc/networks': Permission denied
rm: cannot remove '/etc/post-install/01-devices.post': Permission denied
rm: cannot remove '/etc/post-install/03-mtab.post': Permission denied
rm: cannot remove '/etc/post-install/06-windows-files.post': Permission denied
rm: cannot remove '/etc/post-install/99-post-install-cleanup.post': Permission denied

I see that you have a fork of p7zip. I have standard installed on my system. Maybe PATH is forcing my system to use the standard one?. One thing I notice is that your installer can be opened with my 7zip GUI manager but I cannot open the installer generated by me "cannot open file as a compressed file", so I guess there's some problem at the end of installer package that do not execute that post-install commands too.

@dscho
Copy link
Member

dscho commented Oct 20, 2017

Wiki edited

Thank you!

I see that you have a fork of p7zip. I have standard installed on my system. Maybe PATH is forcing my system to use the standard one?

p7zip is only used for the portable Git. But that's not what you used for your test, correct?

mkdir: cannot create directory '/dev/shm': Read-only file system
[...]

As I said elsewhere (can't find it right now), this should be performed by the post-install.bat step: https://github.com/git-for-windows/build-extra/blob/f511d41d2bb827ce12936075a8924c893d9446de/installer/install.iss#L2100-L2110

Maybe that post-install.log file still exists for you? It should be in a subdirectory of %TEMP% which starts with is (for InnoSetup).

Otherwise, you could simply change the location of that log file in install.iss, rebuild your installer and then find out what the heck is going wrong... I am really curious why this happens.

For the record, all of those Permission denied happen because you run this as a regular user, and the first run of the Git Bash really needs to be as admin so those files can be written to or deleted, that's what that post-install.bat script is all about, to have that be done as a (silent) step of the installer.

@albfan
Copy link
Author

albfan commented Oct 20, 2017

I didn't found many answers looking at post-install.log.

I found an app able to extract contents of my installer (yours can be open with 7zip), InnoExtractor. I will compare installers and see what is different

@albfan
Copy link
Author

albfan commented Oct 21, 2017

First thing comparing both installers

- @IF 10 LEQ %ver @(
+ @IF 10 LEQ %ver% @(

That's why post-install crashes I guess

albfan referenced this issue in git-for-windows/build-extra Oct 21, 2017
To expand a variable Windows cmd interpreter
requires variable name to be enclosed in percent
characters (%), not prefixed with just one.

post-install.bat:
Version test had always been true, which resulted in
rebase being done on *all* 32-bit Windows versions,
not only version 10 and above (as was intended).

setup-git-sdk.bat:
The same side effects as for post-install.bat.

Signed-off-by: Jacob Becker <[email protected]>
@albfan
Copy link
Author

albfan commented Oct 21, 2017

I think this solves it git-for-windows/build-extra#160

No more sslbackend errors or commands at git-bash.exe initialization

@albfan
Copy link
Author

albfan commented Oct 22, 2017

I set finally

@IF 10 LEQ "%ver%" @(

Don't know what's the problem about %ver% being empty.

@albfan
Copy link
Author

albfan commented Oct 22, 2017

I have modified git-for-windows/build-extra#160 after talk with @plastikat. Still don't know the underlying problem, but this seems a correct fix on my system (as %ver% and if evaluates correctly)

@dscho
Copy link
Member

dscho commented Feb 19, 2018

I guess we just forgot to close this ticket ;-)

@dscho dscho closed this as completed Feb 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants
@dscho @albfan and others