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

ARM64 detection #43

Closed
wants to merge 5 commits into from
Closed

ARM64 detection #43

wants to merge 5 commits into from

Conversation

tommyvct
Copy link

No description provided.

Signed-off-by: Tommy Vercetti <7903172+tommyvct@users.noreply.github.com>
Signed-off-by: Tommy Vercetti <7903172+tommyvct@users.noreply.github.com>
3 to 4

Signed-off-by: Tommy Vercetti <7903172+tommyvct@users.noreply.github.com>
@tommyvct tommyvct changed the title Pr/42 ARM64 detection Dec 21, 2020
@dennisameling
Copy link

dennisameling commented Dec 27, 2020

@tommyvct I tried building with this PR, but am running into some issues.

Building

Here are the steps I took for building with PKGBUILD:

  • Open Git SDK Bash (C:\git-sdk-32\git-bash.exe)
  • sdk init MINGW-packages
  • Checkout this PR
  • Open MSYS2 from the Git SDK (C:\git-sdk-32\msys2.exe)
  • cd /usr/src/mingw-packages/mingw-w64-git
  • MINGW_INSTALLS=mingw32 makepkg-mingw -sLf

This results in the following .zst files (I also took the folders from the pkg/ folder):

image

Signed-off-by: Tommy Vercetti <7903172+tommyvct@users.noreply.github.com>
@tommyvct
Copy link
Author

Thanks! I've updated the checksum.
Since you already started on the toolchain side I'll leave that part to you.

Let me know if you need help, thanks!

Signed-off-by: Tommy Vercetti <7903172+tommyvct@users.noreply.github.com>
@dennisameling
Copy link

Okay so I was able to at least allow for a cross-compilation scenario (PR: msys2/MSYS2-packages#2283), but of course mingw-w64-git depends on a bunch of other packages that would also need to be compiled for native arm64:

Dennis@DESKTOP-0RP8NC0 MINGW64 /usr/src/mingw-packages/mingw-w64-git (pr/42)
$ MINGW_INSTALLS=arm64 /c/msys64/usr/src/msys2-packages/pacman/makepkg-mingw -sLf
==> Making package: mingw-w64-git 2.29.2.3.d054eb1fc4-1 (Sun Dec 27 23:30:15 2020)
==> Checking runtime dependencies...
==> Installing missing dependencies...
error: target not found: mingw-w64-arm64-curl
error: target not found: mingw-w64-arm64-ca-certificates
error: target not found: mingw-w64-arm64-expat>=2.0
error: target not found: mingw-w64-arm64-openssl
error: target not found: mingw-w64-arm64-pcre2
error: target not found: mingw-w64-arm64-tcl
error: target not found: mingw-w64-arm64-tk
==> ERROR: 'pacman' failed to install missing dependencies.
==> Missing dependencies:
  -> mingw-w64-arm64-curl
  -> mingw-w64-arm64-ca-certificates
  -> mingw-w64-arm64-expat>=2.0
  -> mingw-w64-arm64-openssl
  -> mingw-w64-arm64-pcre2
  -> mingw-w64-arm64-tcl
  -> mingw-w64-arm64-tk
==> Checking buildtime dependencies...
==> Installing missing dependencies...
error: target not found: mingw-w64-arm64-asciidoctor-extensions
error: target not found: mingw-w64-arm64-cv2pdb
==> ERROR: 'pacman' failed to install missing dependencies.
==> Missing dependencies:
  -> mingw-w64-arm64-asciidoctor-extensions
  -> mingw-w64-arm64-cv2pdb
==> ERROR: Could not resolve all dependencies.

I guess for now our best bet is to come up with a separate variable, so that the build command becomes something like MINGW_INSTALLS=mingw32 IS_ARM64=true makepkg-mingw -sLf - that'd allow us to use the mingw32 packages while allowing us to e.g. override the CARCH in PKGBUILD. Any thoughs on this @dscho?

@tommyvct
Copy link
Author

I reckoned that we will need to fork the whole MSYS thing out for arm64, or at least the dependencies mentioned above.

Introducing another variable does not help, to me this only introduce more confusion.

As a temporary workaround, we can just left the forked MSYS thing completely unchanged, let it compile x86 binaries and call it arm64. It doesn't really matter in the short run since Windows on arm can run x86 binaries just fine, but we do need to move everything to arm64 eventually. For example, we can have mingw-w64-arm64-curl on the surface, but the gut inside is indeed i686.

With my wildest prejudice, these packages are portable enough that they can be compiled for Windows on arm with a simple swap of compiler backend.

@dennisameling
Copy link

dennisameling commented Dec 28, 2020

Agree with using the x86 binaries; that should significantly speed up our progress for now. Apparently cross-compilation to arm64 with GCC doesn't work (msys2/MSYS2-packages#2283 (comment)), but the msys2 team has work underway to add clang support if I understand correctly.

For now, looking at your PR, it won't just work if we compile for mingw32 with MINGW_INSTALLS=mingw32 makepkg-mingw -sLf; it will trigger CARCH=i686 and completely skip your logic #if defined(_M_ARM64) because that'll only be triggered if CARCH=arm64. I tried some things with cross-compilation but that led to a plethora of other issues that I don't want to burn my hands on for now 😅

I just created a separate PR that will allow us to run MINGW_INSTALLS=mingw32 IS_ARM64=true makepkg-mingw -sLf - that way, the mingw32 package is created as usual, with the only exception that git-wrapper will look for the native arm64 Git binaries and set MSYSTEM to ARM64. All other binaries will just run their 32-bit versions. I mostly have that working now; more details in the PR. Curious to hear your thoughts on this!

@tommyvct
Copy link
Author

because that'll only be triggered if CARCH=arm64

Why don't we do MINGW_INSTALLS=mingw32 CARCH=arm64 makepkg-mingw -sLf?
We are building 386 binaries, so MINGW_INSTALLS=mingw32. we are running this binary on ARM64 system, so CARCH=arm64; it also triggers either one of the arm64 detection macros.

@tommyvct
Copy link
Author

tommyvct commented Dec 28, 2020

For some reason, the MINGW_INSTALLS=mingw32 CARCH=arm64 makepkg-mingw -sLf compilation failed.
@dennisameling any ideas?
I used 32 bit SDK, will that be the problem?

==> Making package: mingw-w64-git 2.29.2.3.d054eb1fc4-1 (Mon Dec 28 15:59:02 2020)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Updating git git repo...
Fetching origin
  -> Found git-for-windows.ico
  -> Found start-ssh-agent.cmd
  -> Found start-ssh-pageant.cmd
  -> Found git-wrapper.c
  -> Found git-bash.rc
  -> Found git-bash.txt
  -> Found git-cmd.rc
  -> Found git-wrapper.rc
  -> Found gitk.rc
  -> Found compat-bash.rc
  -> Found mingw-w64-git.mak
  -> Found cv2pdb-strip
  -> Found edit-git-bash.c
==> Validating source files with sha256sums...
    git ... Skipped
    git-for-windows.ico ... Passed
    start-ssh-agent.cmd ... Skipped
    start-ssh-pageant.cmd ... Skipped
    git-wrapper.c ... Skipped
    git-bash.rc ... Passed
    git-bash.txt ... Passed
    git-cmd.rc ... Passed
    git-wrapper.rc ... Passed
    gitk.rc ... Passed
    compat-bash.rc ... Passed
    mingw-w64-git.mak ... Passed
    cv2pdb-strip ... Passed
    edit-git-bash.c ... Passed
==> Extracting sources...
  -> Creating working copy of git git repo...
Reset branch 'makepkg'
==> Starting prepare()...
==> Starting pkgver()...
==> Removing existing $pkgdir/ directory...
==> Starting build()...
    RC git-bash.res
    RC git-cmd.res
    RC compat-bash.res
    RC gitk.res
make: 'edit-git-bash.exe' is up to date.
    RC git.res
    LINK git-wrapper.exe
    LINK git-bash.exe
    LINK git-cmd.exe
    LINK compat-bash.exe
    LINK cmd/git.exe
    LINK cmd/gitk.exe
    LINK cmd/git-gui.exe
make: Entering directory '/usr/src/MINGW-packages/mingw-w64-git/src/git/contrib/credential/wincred'
rm -f git-credential-wincred.exe
make: Nothing to be done for 'all'.
make: Leaving directory '/usr/src/MINGW-packages/mingw-w64-git/src/git/contrib/credential/wincred'
make: Entering directory '/usr/src/MINGW-packages/mingw-w64-git/src/git/contrib/credential/wincred'
gcc -march=i686 -mtune=generic -O2 -pipe  -pipe -Wl,--dynamicbase,--nxcompat,--no-seh  git-credential-wincred.c   -o git-credential-wincred.exe
make: Leaving directory '/usr/src/MINGW-packages/mingw-w64-git/src/git/contrib/credential/wincred'
make -C Documentation html
make -C Documentation man
make[1]: Entering directory '/usr/src/MINGW-packages/mingw-w64-git/src/git/Documentation'
make[1]: Entering directory '/usr/src/MINGW-packages/mingw-w64-git/src/git/Documentation'
    GEN cmd-list.made
    GEN cmd-list.made
    GEN command-list.h
make[2]: Entering directory '/usr/src/MINGW-packages/mingw-w64-git/src/git'
make[2]: Entering directory '/usr/src/MINGW-packages/mingw-w64-git/src/git'
    GEN doc.dep
    GEN doc.dep
    RC git.res
mv: cannot stat 'doc.dep+': No such file or directory
make[2]: 'GIT-VERSION-FILE' is up to date.
make[2]: Leaving directory '/usr/src/MINGW-packages/mingw-w64-git/src/git'
make[2]: 'GIT-VERSION-FILE' is up to date.
make[2]: Leaving directory '/usr/src/MINGW-packages/mingw-w64-git/src/git'
    ASCIIDOC howto-index.html
    ASCIIDOC git-tools.html
    ASCIIDOC git-bisect-lk2009.html
/bin/sh: asciidoctor: command not found
make[1]: *** [Makefile:428: howto-index.html] Error 127
make[1]: *** Waiting for unfinished jobs....
/bin/sh: asciidoctor: command not found
make[1]: *** [Makefile:428: git-tools.html] Error 127
/bin/sh: asciidoctor: command not found
make[1]: *** [Makefile:428: git-bisect-lk2009.html] Error 127
    ASCIIDOC git-add.html
    ASCIIDOC git-am.html
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:344: git-add.html] Error 127
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:344: git-am.html] Error 127
make[1]: Leaving directory '/usr/src/MINGW-packages/mingw-w64-git/src/git/Documentation'
make: *** [Makefile:2561: html] Error 2
make: *** Waiting for unfinished jobs....
make[2]: Entering directory '/usr/src/MINGW-packages/mingw-w64-git/src/git'
make[2]: 'GIT-VERSION-FILE' is up to date.
make[2]: Leaving directory '/usr/src/MINGW-packages/mingw-w64-git/src/git'
    ASCIIDOC git-add.xml
    ASCIIDOC git-am.xml
    ASCIIDOC git-annotate.xml
    ASCIIDOC git-apply.xml
    ASCIIDOC git-archimport.xml
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:361: git-add.xml] Error 127
make[1]: *** Waiting for unfinished jobs....
    ASCIIDOC git-archive.xml
/bin/sh: line 1: asciidoctor: command not found
    ASCIIDOC git-bash.xml
make[1]: *** [Makefile:361: git-am.xml] Error 127
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:361: git-annotate.xml] Error 127
    ASCIIDOC git-blame.xml
    ASCIIDOC git-bisect.xml
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:361: git-apply.xml] Error 127
    ASCIIDOC git-branch.xml
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:361: git-archimport.xml] Error 127
/bin/sh: line 1: asciidoctor: command not found
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:361: git-archive.xml] Error 127
make[1]: *** [Makefile:361: git-bash.xml] Error 127
/bin/sh: line 1: asciidoctor: command not found
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:361: git-blame.xml] Error 127
make[1]: *** [Makefile:361: git-bisect.xml] Error 127
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:361: git-branch.xml] Error 127
make[1]: Leaving directory '/usr/src/MINGW-packages/mingw-w64-git/src/git/Documentation'
make: *** [Makefile:2556: man] Error 2
make -C Documentation html
make -C Documentation man
make[1]: Entering directory '/usr/src/MINGW-packages/mingw-w64-git/src/git/Documentation'
make[1]: Entering directory '/usr/src/MINGW-packages/mingw-w64-git/src/git/Documentation'
    CC help.o
make[2]: Entering directory '/usr/src/MINGW-packages/mingw-w64-git/src/git'
make[2]: Entering directory '/usr/src/MINGW-packages/mingw-w64-git/src/git'
    AR libgit.a
    LINK git-daemon.exe
    LINK git-http-backend.exe
    LINK git-imap-send.exe
    LINK git-sh-i18n--envsubst.exe
    LINK git-shell.exe
    LINK git-http-push.exe
    LINK git-http-fetch.exe
    LINK git-remote-http.exe
    LINK git.exe
make[2]: 'GIT-VERSION-FILE' is up to date.
make[2]: Leaving directory '/usr/src/MINGW-packages/mingw-w64-git/src/git'
make[2]: 'GIT-VERSION-FILE' is up to date.
make[2]: Leaving directory '/usr/src/MINGW-packages/mingw-w64-git/src/git'
    ASCIIDOC howto-index.html
/bin/sh: asciidoctor: command not found
    ASCIIDOC git-tools.html
make[1]: *** [Makefile:428: howto-index.html] Error 127
make[1]: *** Waiting for unfinished jobs....
    ASCIIDOC git-add.xml
/bin/sh: asciidoctor: command not found
make[1]: *** [Makefile:428: git-tools.html] Error 127
    ASCIIDOC git-bisect-lk2009.html
/bin/sh: asciidoctor: command not found
make[1]: *** [Makefile:428: git-bisect-lk2009.html] Error 127
make[1]: Leaving directory '/usr/src/MINGW-packages/mingw-w64-git/src/git/Documentation'
make: *** [Makefile:2561: html] Error 2
make: *** Waiting for unfinished jobs....
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:361: git-add.xml] Error 127
make[1]: *** Waiting for unfinished jobs....
    ASCIIDOC git-am.xml
    ASCIIDOC git-annotate.xml
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:361: git-am.xml] Error 127
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:361: git-annotate.xml] Error 127
make[1]: Leaving directory '/usr/src/MINGW-packages/mingw-w64-git/src/git/Documentation'
make: *** [Makefile:2556: man] Error 2
make -C Documentation html
make -C Documentation man
make[1]: Entering directory '/usr/src/MINGW-packages/mingw-w64-git/src/git/Documentation'
make[1]: Entering directory '/usr/src/MINGW-packages/mingw-w64-git/src/git/Documentation'
make[2]: Entering directory '/usr/src/MINGW-packages/mingw-w64-git/src/git'
make[2]: Entering directory '/usr/src/MINGW-packages/mingw-w64-git/src/git'
    LN/CP git-remote-https.exe
    LN/CP git-remote-ftp.exe
    BUILTIN git-add.exe
    LN/CP git-remote-ftps.exe
    BUILTIN git-am.exe
    BUILTIN git-annotate.exe
    BUILTIN git-apply.exe
    BUILTIN git-archive.exe
    BUILTIN git-bisect--helper.exe
    BUILTIN git-blame.exe
    BUILTIN git-branch.exe
    BUILTIN git-bugreport.exe
    BUILTIN git-bundle.exe
    BUILTIN git-cat-file.exe
    BUILTIN git-check-attr.exe
    BUILTIN git-check-ignore.exe
    BUILTIN git-check-mailmap.exe
    BUILTIN git-check-ref-format.exe
    BUILTIN git-checkout-index.exe
    BUILTIN git-checkout.exe
    BUILTIN git-clean.exe
    BUILTIN git-clone.exe
    BUILTIN git-column.exe
    BUILTIN git-commit-tree.exe
    BUILTIN git-commit-graph.exe
    BUILTIN git-config.exe
    BUILTIN git-commit.exe
    BUILTIN git-count-objects.exe
    BUILTIN git-credential-cache.exe
    BUILTIN git-credential-cache--daemon.exe
    BUILTIN git-credential-store.exe
    BUILTIN git-credential.exe
    BUILTIN git-describe.exe
    BUILTIN git-diff-files.exe
    BUILTIN git-diff-index.exe
    BUILTIN git-diff-tree.exe
    BUILTIN git-diff.exe
    BUILTIN git-difftool.exe
    BUILTIN git-env--helper.exe
    BUILTIN git-fast-export.exe
    BUILTIN git-fetch-pack.exe
    BUILTIN git-fast-import.exe
    BUILTIN git-fmt-merge-msg.exe
    BUILTIN git-fetch.exe
    BUILTIN git-for-each-ref.exe
    BUILTIN git-fsck.exe
    BUILTIN git-gc.exe
    BUILTIN git-get-tar-commit-id.exe
    BUILTIN git-grep.exe
    BUILTIN git-hash-object.exe
    BUILTIN git-help.exe
    BUILTIN git-index-pack.exe
    BUILTIN git-init-db.exe
    BUILTIN git-interpret-trailers.exe
    BUILTIN git-log.exe
    BUILTIN git-ls-files.exe
    BUILTIN git-ls-tree.exe
    BUILTIN git-ls-remote.exe
    BUILTIN git-mailinfo.exe
    BUILTIN git-mailsplit.exe
    BUILTIN git-merge-base.exe
    BUILTIN git-merge-file.exe
    BUILTIN git-merge-index.exe
    BUILTIN git-merge-ours.exe
    BUILTIN git-merge-tree.exe
    BUILTIN git-merge-recursive.exe
    BUILTIN git-merge.exe
    BUILTIN git-mktag.exe
    BUILTIN git-mktree.exe
    BUILTIN git-multi-pack-index.exe
    BUILTIN git-mv.exe
    BUILTIN git-name-rev.exe
    BUILTIN git-notes.exe
    BUILTIN git-pack-objects.exe
    BUILTIN git-pack-redundant.exe
    BUILTIN git-pack-refs.exe
    BUILTIN git-patch-id.exe
    BUILTIN git-prune-packed.exe
    BUILTIN git-prune.exe
    BUILTIN git-push.exe
    BUILTIN git-range-diff.exe
    BUILTIN git-pull.exe
    BUILTIN git-read-tree.exe
    BUILTIN git-rebase.exe
    BUILTIN git-receive-pack.exe
    BUILTIN git-reflog.exe
    BUILTIN git-remote-ext.exe
    BUILTIN git-repack.exe
    BUILTIN git-remote.exe
    BUILTIN git-remote-fd.exe
    BUILTIN git-replace.exe
    BUILTIN git-rerere.exe
    BUILTIN git-rev-list.exe
    BUILTIN git-rev-parse.exe
    BUILTIN git-reset.exe
    BUILTIN git-revert.exe
    BUILTIN git-send-pack.exe
    BUILTIN git-rm.exe
    BUILTIN git-show-index.exe
    BUILTIN git-shortlog.exe
    BUILTIN git-show-branch.exe
    BUILTIN git-show-ref.exe
    BUILTIN git-sparse-checkout.exe
    BUILTIN git-stash.exe
    BUILTIN git-stripspace.exe
    BUILTIN git-submodule--helper.exe
    BUILTIN git-symbolic-ref.exe
    BUILTIN git-tag.exe
    BUILTIN git-unpack-file.exe
    BUILTIN git-unpack-objects.exe
    BUILTIN git-update-index.exe
    BUILTIN git-update-ref.exe
    BUILTIN git-update-server-info.exe
    BUILTIN git-upload-archive.exe
    BUILTIN git-upload-pack.exe
    BUILTIN git-verify-commit.exe
    BUILTIN git-var.exe
    BUILTIN git-verify-pack.exe
    BUILTIN git-verify-tag.exe
    BUILTIN git-worktree.exe
    BUILTIN git-write-tree.exe
    BUILTIN git-cherry-pick.exe
    BUILTIN git-cherry.exe
    BUILTIN git-format-patch.exe
    BUILTIN git-fsck-objects.exe
    BUILTIN git-init.exe
    BUILTIN git-merge-subtree.exe
    BUILTIN git-restore.exe
    BUILTIN git-show.exe
    BUILTIN git-stage.exe
    BUILTIN git-switch.exe
    BUILTIN git-status.exe
    BUILTIN git-whatchanged.exe
    BUILTIN all
make[2]: 'GIT-VERSION-FILE' is up to date.
make[2]: Leaving directory '/usr/src/MINGW-packages/mingw-w64-git/src/git'
make[2]: 'GIT-VERSION-FILE' is up to date.
make[2]: Leaving directory '/usr/src/MINGW-packages/mingw-w64-git/src/git'
    SUBDIR git-gui
    ASCIIDOC howto-index.html
    ASCIIDOC git-tools.html
/bin/sh: asciidoctor: command not found
    ASCIIDOC git-bisect-lk2009.html
make[1]: *** [Makefile:428: howto-index.html] Error 127
make[1]: *** Waiting for unfinished jobs....
/bin/sh: asciidoctor: command not found
make[1]: *** [Makefile:428: git-tools.html] Error 127
/bin/sh: asciidoctor: command not found
make[1]: *** [Makefile:428: git-bisect-lk2009.html] Error 127
    ASCIIDOC git-add.xml
    ASCIIDOC git-add.html
    ASCIIDOC git-am.xml
    ASCIIDOC git-am.html
    ASCIIDOC git-annotate.xml
    ASCIIDOC git-apply.xml
    ASCIIDOC git-archimport.xml
/bin/sh: line 1: asciidoctor: command not found
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:361: git-add.xml] Error 127
make[1]: *** Waiting for unfinished jobs....
/bin/sh: line 1: asciidoctor: command not found
    ASCIIDOC git-archive.xml
make[1]: *** [Makefile:344: git-add.html] Error 127
make[1]: *** [Makefile:361: git-am.xml] Error 127
/bin/sh: line 1: asciidoctor: command not found
    ASCIIDOC git-bisect.xml
make[1]: *** [Makefile:361: git-apply.xml] Error 127
/bin/sh: line 1: asciidoctor: command not found
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:344: git-am.html] Error 127
make[1]: Leaving directory '/usr/src/MINGW-packages/mingw-w64-git/src/git/Documentation'
    ASCIIDOC git-bash.xml
make: *** [Makefile:2561: html] Error 2
make: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:361: git-annotate.xml] Error 127
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:361: git-archimport.xml] Error 127
    ASCIIDOC git-blame.xml
    ASCIIDOC git-branch.xml
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:361: git-archive.xml] Error 127
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:361: git-bisect.xml] Error 127
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:361: git-bash.xml] Error 127
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:361: git-blame.xml] Error 127
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:361: git-branch.xml] Error 127
make[1]: Leaving directory '/usr/src/MINGW-packages/mingw-w64-git/src/git/Documentation'
make: *** [Makefile:2556: man] Error 2
    SUBDIR gitk-git
    SUBDIR templates
make -C Documentation html
make -C Documentation man
make[1]: Entering directory '/usr/src/MINGW-packages/mingw-w64-git/src/git/Documentation'
make[1]: Entering directory '/usr/src/MINGW-packages/mingw-w64-git/src/git/Documentation'
make[2]: Entering directory '/usr/src/MINGW-packages/mingw-w64-git/src/git'
make[2]: Entering directory '/usr/src/MINGW-packages/mingw-w64-git/src/git'
    BUILTIN all
    SUBDIR git-gui
make[2]: 'GIT-VERSION-FILE' is up to date.
make[2]: Leaving directory '/usr/src/MINGW-packages/mingw-w64-git/src/git'
make[2]: 'GIT-VERSION-FILE' is up to date.
make[2]: Leaving directory '/usr/src/MINGW-packages/mingw-w64-git/src/git'
    ASCIIDOC howto-index.html
    ASCIIDOC git-tools.html
    ASCIIDOC git-bisect-lk2009.html
/bin/sh: asciidoctor: command not found
/bin/sh: asciidoctor: command not found
make[1]: *** [Makefile:428: howto-index.html] Error 127
make[1]: *** Waiting for unfinished jobs....
/bin/sh: asciidoctor: command not found
make[1]: *** [Makefile:428: git-tools.html] Error 127
make[1]: *** [Makefile:428: git-bisect-lk2009.html] Error 127
    ASCIIDOC git-add.xml
    ASCIIDOC git-am.html
    ASCIIDOC git-add.html
    ASCIIDOC git-am.xml
    ASCIIDOC git-annotate.html
    ASCIIDOC git-annotate.xml
    ASCIIDOC git-apply.xml
/bin/sh: line 1: asciidoctor: command not found
/bin/sh: line 1: asciidoctor: command not found
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:344: git-am.html] Error 127
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:361: git-add.xml] Error 127
make[1]: *** Waiting for unfinished jobs....
    ASCIIDOC git-archimport.xml
    ASCIIDOC git-archive.xml
make[1]: *** [Makefile:361: git-am.xml] Error 127
make[1]: *** [Makefile:344: git-add.html] Error 127
    ASCIIDOC git-bash.xml
/bin/sh: line 1: asciidoctor: command not found
    ASCIIDOC git-bisect.xml
/bin/sh: line 1: asciidoctor: command not found
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:344: git-annotate.html] Error 127
make[1]: Leaving directory '/usr/src/MINGW-packages/mingw-w64-git/src/git/Documentation'
make: *** [Makefile:2561: html] Error 2
make: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:361: git-apply.xml] Error 127
make[1]: *** [Makefile:361: git-annotate.xml] Error 127
    ASCIIDOC git-blame.xml
/bin/sh: line 1: asciidoctor: command not found
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:361: git-archive.xml] Error 127
make[1]: *** [Makefile:361: git-archimport.xml] Error 127
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:361: git-bash.xml] Error 127
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:361: git-bisect.xml] Error 127
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:361: git-blame.xml] Error 127
make[1]: Leaving directory '/usr/src/MINGW-packages/mingw-w64-git/src/git/Documentation'
make: *** [Makefile:2556: man] Error 2
    SUBDIR gitk-git
    SUBDIR templates
make -C Documentation html
make -C Documentation man
make[1]: Entering directory '/usr/src/MINGW-packages/mingw-w64-git/src/git/Documentation'
make[1]: Entering directory '/usr/src/MINGW-packages/mingw-w64-git/src/git/Documentation'
make[2]: Entering directory '/usr/src/MINGW-packages/mingw-w64-git/src/git'
make[2]: Entering directory '/usr/src/MINGW-packages/mingw-w64-git/src/git'
    BUILTIN all
    SUBDIR git-gui
make[2]: 'GIT-VERSION-FILE' is up to date.
make[2]: Leaving directory '/usr/src/MINGW-packages/mingw-w64-git/src/git'
make[2]: 'GIT-VERSION-FILE' is up to date.
make[2]: Leaving directory '/usr/src/MINGW-packages/mingw-w64-git/src/git'
    ASCIIDOC howto-index.html
    ASCIIDOC git-tools.html
    ASCIIDOC git-bisect-lk2009.html
/bin/sh: asciidoctor: command not found
make[1]: *** [Makefile:428: howto-index.html] Error 127
make[1]: *** Waiting for unfinished jobs....
/bin/sh: asciidoctor: command not found
make[1]: *** [Makefile:428: git-tools.html] Error 127
/bin/sh: asciidoctor: command not found
make[1]: *** [Makefile:428: git-bisect-lk2009.html] Error 127
    ASCIIDOC git-add.html
    ASCIIDOC git-add.xml
    ASCIIDOC git-am.html
    ASCIIDOC git-am.xml
    ASCIIDOC git-annotate.xml
    ASCIIDOC git-apply.xml
/bin/sh: line 1: asciidoctor: command not found
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:344: git-add.html] Error 127
/bin/sh: line 1: asciidoctor: command not found
    ASCIIDOC git-archimport.xml
make[1]: *** [Makefile:361: git-am.xml] Error 127
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:361: git-add.xml] Error 127
    ASCIIDOC git-archive.xml
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:344: git-am.html] Error 127
make[1]: Leaving directory '/usr/src/MINGW-packages/mingw-w64-git/src/git/Documentation'
make: *** [Makefile:2561: html] Error 2
make: *** Waiting for unfinished jobs....
/bin/sh: line 1: asciidoctor: command not found
    ASCIIDOC git-bash.xml
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:361: git-annotate.xml] Error 127
make[1]: *** [Makefile:361: git-apply.xml] Error 127
    ASCIIDOC git-bisect.xml
    ASCIIDOC git-blame.xml
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:361: git-archimport.xml] Error 127
    ASCIIDOC git-branch.xml
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:361: git-archive.xml] Error 127
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:361: git-bash.xml] Error 127
/bin/sh: line 1: asciidoctor: command not found
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:361: git-blame.xml] Error 127
make[1]: *** [Makefile:361: git-bisect.xml] Error 127
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:361: git-branch.xml] Error 127
make[1]: Leaving directory '/usr/src/MINGW-packages/mingw-w64-git/src/git/Documentation'
make: *** [Makefile:2556: man] Error 2
    SUBDIR gitk-git
    SUBDIR templates
Could not build (tried 5 times)

@dennisameling
Copy link

Had that error as well yesterday. It's a missing dependency. Try pacman -sS asciidoc to show the available packages. I think it was something like pacman -S mingw-w64-i686-asciidoc that fixed it for me. You might also run into similar errors for docbook, then run pacman -sS docbook to see the available packages. Quite weird that those aren't mentioned as hard dependencies 🤷🏼‍♂️

@dennisameling
Copy link

So I tried with your PR (MINGW_INSTALLS=mingw32 CARCH=arm64 makepkg-mingw -sLf), but was getting the segfault again that I also ran into when trying to compile a native arm64 binary:

/usr/src/mingw-packages/mingw-w64-git/src/git/../cv2pdb-strip  git-daemon.exe git-http-backend.exe git-imap-send.exe git-sh-i18n--envsubst.exe git-shell.exe git-http-fetch.exe git-http-push.exe git-remote-http.exe git-remote-https.exe git-remote-ftp.exe git-remote-ftps.exe git.exe
/usr/src/mingw-packages/mingw-w64-git/src/git/../cv2pdb-strip  \
        contrib/credential/wincred/git-credential-wincred.exe \
        cmd/git{,-gui,k}.exe compat-bash.exe git-{bash,cmd,wrapper}.exe
/usr/src/mingw-packages/mingw-w64-git/src/git/../cv2pdb-strip: line 3:  3079 Segmentation fault      cv2pdb "$arg"
make: *** [../mingw-w64-git.mak:39: strip-all] Error 139
==> ERROR: A failure occurred in build().
    Aborting...

As a quick fix I removed line 41 from mingw-w64-git.mak:

cmd/git{,-gui,k}.exe compat-bash.exe git-{bash,cmd,wrapper}.exe

But the generated binary is still i386 instead of arm64:

image

Any ideas? I really think #44 can be our fastest option for now, but let's explore this PR as well to see what's possible. @dscho will be back in the office on Monday, curious to hear his thoughts on this as well 👍🏼

@tommyvct
Copy link
Author

I'm confused as well, I never got mine to work.
It is ok that git-wrapper being i386, since it's not performance critical.

@dscho
Copy link
Member

dscho commented Jan 5, 2021

Hmm. I don't know that we can realistically build a native ARM64 mingw-w64-git package.

For now, I would suggest to pursue the approach instead where we completely side-step the MINGW package targeting ARM64. That is, build the ARM64 executables using the CMake approach, bundled as a .zip (or as a .tar.gz if you prefer), then swap them them for the Git executables in the 32-bit portable Git version.

This should be relatively easy given that the PortableGit-*.7z.exe really are self-extracting 7-Zip archives.

It will be a bit harder to modify the (InnoSetup-based) installer, as the entire tooling assumes that you are running in a Git for Windows SDK compiled for the architecture you're targeting.

So for now, I'd try to focus getting the vs-build[amd64] part to build an artifact that can be unpacked over an installed PortableGit.

@tommyvct
Copy link
Author

tommyvct commented Jan 5, 2021

I'll see what I can do on the installer side. Shouldn't be too hard to add ARM64 detection there.
We still target ARM64 Windows users with i686 installer, but we can give the user option to choose which gut would they use.

@dscho
Copy link
Member

dscho commented Jan 6, 2021

I'll see what I can do on the installer side. Shouldn't be too hard to add ARM64 detection there.
We still target ARM64 Windows users with i686 installer, but we can give the user option to choose which gut would they use.

The challenge will be to work off of a Git for Windows SDK that has the ARM64 binaries in the correct place, and to teach make-file-list.sh to include them when being called from installer/release.sh (both scripts live in build-extra).

@dennisameling
Copy link

This PR can be closed now that #44 has been merged 🚀

@dscho
Copy link
Member

dscho commented Jan 22, 2021

Indeed. Thank you, @tommyvct and @dennisameling!

@dscho dscho closed this Jan 22, 2021
@tommyvct tommyvct deleted the pr/42 branch January 22, 2021 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants