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

portable: add arm64 artifact option #323

Merged
merged 2 commits into from
Feb 4, 2021

Conversation

dennisameling
Copy link
Contributor

@dennisameling dennisameling commented Jan 22, 2021

Builds further on #321. Very much a proof of concept, just sharing here for inspiration.

Example release based on this PR: https://github.com/dennisameling/git/releases/tag/2.30.0-beta2

Results in an actual working portable installer for ARM64 when taking the following steps:

  • sdk build mingw-w64-git
  • pacman -U mingw-w64-i686-git-2.30.0.2.f8cbc844b8-1-any.pkg.tar.xz (replace the filename with the actual filename that's generated)
  • sdk build git-extra (so that /etc/profile gets overwritten to include ARM64)
  • pacman -U git-extra-1.1.513.20ab9a5-1-i686.pkg.tar.xz (replace the filename with the actual filename that's generated)
  • (create the arm64 binaries now and output to C:\git-sdk-32\arm64)
  • Go into /usr/src/build-extra/portable and run mkdir -p arm64 && ./release.sh --include-arm64-artifacts=/arm64 --output=./arm64 2.30.0

It then looks like this on an ARM64 device:

image

# ARM64 Windows handling
if test -n "$cross_compiling_arm64"
then
cp -ar /arm64 "$SCRIPT_PATH/root"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we allow specifying an argument (like --output <directory>), we do not have to hard-code /arm64 here.

I think I like that idea.

And if we go that route, the option should probably be renamed to --include-arm64-artifacts=<directory> or some such.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in 6e5a2e7. Can now run ./release.sh --include-arm64-artifacts=/arm64 --output=./arm64 2.30.0 (the --output option was already there and I simply use it to easily find back the generated .7z.exe file 😊)

Output:

$ ./release.sh --include-arm64-artifacts=/arm64 --output=./arm64 2.30.0
Including ARM64 artifacts from /arm64
7za is /usr/bin/7za
Creating archive

7-Zip (a) [32] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=nl_NL.UTF-8,Utf16=on,HugeFiles=on,32 bits,8 CPUs Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz (906ED),ASM,AES-NI)

Scanning the drive:
92 folders, 6209 files, 708249591 bytes (676 MiB)

Creating archive: /tmp.7z

Items to compress: 6301


Files read from disk: 6203
Archive size: 48514387 bytes (47 MiB)
Everything is Ok
Success! You will find the new installer at "./arm64/PortableGit-2.30.0-arm64.7z.exe".
It is a self-extracting .7z archive.

@dennisameling dennisameling changed the title portable: add cross-compilation option for arm64 portable: add arm64 artifact option Jan 23, 2021
@dennisameling
Copy link
Contributor Author

dennisameling commented Jan 30, 2021

Just updated please.sh to add an --extra-args argument, which is then passed to the appropriate release.sh script - details in dc69222

Example invocation in https://github.com/dennisameling/git/runs/1799017569?check_suite_focus=true:

/usr/src/build-extra/please.sh make_installers_from_mingw_w64_git --extra-args=\"--include-arm64-artifacts=`$PWD/arm64\" --version=`$(cat pkg-i686/ver) -o artifacts --${{matrix.artifact.name}} --pkg=pkg-i686/mingw-w64-i686-git-[0-9]*.tar.xz --pkg=pkg-i686/mingw-w64-i686-git-doc-html-[0-9]*.tar.xz

... which correctly results in a PortableGit executable that includes the /arm64 binaries 🎉

please.sh Outdated Show resolved Hide resolved
Adds an --include-arm64-artifacts option to portable/release.sh.
This can be used to inlcude ARM64 artifacts in, for example, an i686
build. This is necessary until MSYS2 packages can be built natively
for ARM64.

Signed-off-by: Dennis Ameling <dennis@dennisameling.com>
@dennisameling dennisameling force-pushed the git-portable-arm64 branch 2 times, most recently from 456b408 to f85eb55 Compare February 3, 2021 16:56
@dennisameling
Copy link
Contributor Author

dennisameling commented Feb 3, 2021

@dscho just applied your suggestion and squashed the commits 👍🏼 should be good to go now!

image

Affects the make_installers_from_mingw_w64_git function. Adds a new
option --include-arm64-artifacts, which allows the user to include
ARM64 artifacts in the generated build. This is necessary until native
ARM64 packages can be built on MSYS2.

Can be invoked as follows, for example:
./please.sh make_installers_from_mingw_w64_git \
    --include-arm64-artifacts=$PWD/arm64 --version=2.30.0 -o artifacts \
    --portable

Signed-off-by: Dennis Ameling <dennis@dennisameling.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho force-pushed the git-portable-arm64 branch from f85eb55 to 50f9a18 Compare February 4, 2021 13:04
@dscho dscho merged commit 3e9f5d8 into git-for-windows:main Feb 4, 2021
@dscho
Copy link
Member

dscho commented Feb 4, 2021

I adjusted this only slightly before merging. Thank you!

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.

2 participants