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 finalize bootstrapper #18500

Merged
merged 12 commits into from
May 30, 2022

Conversation

yuyoyuppe
Copy link
Contributor

@yuyoyuppe yuyoyuppe commented May 26, 2022

Summary of the Pull Request

What is this about:

  • install vcredist via bootstrapper
  • migrate to wix 3.14 (system-wide installer instead of nuget package)
  • update ci scripts to use wix 3.14 installer
  • fix arm updater

What is included in the PR:

How does someone test / validate:

Quality Checklist

  • Linked issue: Support ARM platform #490
  • Communication: I've discussed this with core contributors in the issue.
  • Tests: Added/updated and all pass
  • Installer: Added/updated and all pass
  • Localization: All end user facing strings can be localized
  • Docs: Added/ updated
  • Binaries: Any new files are added to WXS / YML

Contributor License Agreement (CLA)

A CLA must be signed. If not, go over here and sign the CLA.

@github-actions
Copy link

github-actions bot commented May 26, 2022

@check-spelling-bot Report

🔴 Please review

See the files view or the action log for details.

Unrecognized words (2)

Redistributable
XBinaries

Previously acknowledged words that are now absent BGSOUNDS BUILDARCH CLIENTPULL codecvt concrt dispid DISPIDAMBIENTDLCONTROL DLACTIVEXCTLS DLCONTROL DLIMAGES DOWNLOADONLY epo FANCYZONESWINDOWSTYLES FORCEOFFLINE FRAMEDOWNLOAD gsuberland HFONT Htmdid ICore IDCANCEL IDOK INITDIALOG IReflect IWindows IXaml lamotile METACHARSET mirophone mshtmdid msvcp NETFX netstandard Nvidia otating Postion preperty ruleset RUNACTIVEXCTLS serizalization settingsv Setttings sourceid testtrocess Toolchain vccorlib vcomp vcredist vcruntime VDId xbf XBind XInstance
To accept these unrecognized words as correct (and remove the previously acknowledged and now absent words), run the following commands

... in a clone of the git@github.com:yuyoyuppe/PowerToys.git repository
on the arm64_finalize_bootstrapper branch:

update_files() {
perl -e '
my @expect_files=qw('".github/actions/spell-check/expect.txt"');
@ARGV=@expect_files;
my @stale=qw('"$patch_remove"');
my $re=join "|", @stale;
my $suffix=".".time();
my $previous="";
sub maybe_unlink { unlink($_[0]) if $_[0]; }
while (<>) {
if ($ARGV ne $old_argv) { maybe_unlink($previous); $previous="$ARGV$suffix"; rename($ARGV, $previous); open(ARGV_OUT, ">$ARGV"); select(ARGV_OUT); $old_argv = $ARGV; }
next if /^(?:$re)(?:(?:\r|\n)*$| .*)/; print;
}; maybe_unlink($previous);'
perl -e '
my $new_expect_file=".github/actions/spell-check/expect.txt";
use File::Path qw(make_path);
use File::Basename qw(dirname);
make_path (dirname($new_expect_file));
open FILE, q{<}, $new_expect_file; chomp(my @words = <FILE>); close FILE;
my @add=qw('"$patch_add"');
my %items; @items{@words} = @words x (1); @items{@add} = @add x (1);
@words = sort {lc($a)."-".$a cmp lc($b)."-".$b} keys %items;
open FILE, q{>}, $new_expect_file; for my $word (@words) { print FILE "$word\n" if $word =~ /\w/; };
close FILE;
system("git", "add", $new_expect_file);
'
}

comment_json=$(mktemp)
curl -L -s -S \
-H "Content-Type: application/json" \
"https://api.github.com/repos/microsoft/PowerToys/issues/comments/1138721434" > "$comment_json"
comment_body=$(mktemp)
jq -r ".body // empty" "$comment_json" > $comment_body
rm $comment_json

patch_remove=$(perl -ne 'next unless s{^</summary>(.*)</details>$}{$1}; print' < "$comment_body")

patch_add=$(perl -e '$/=undef; $_=<>; if (m{Unrecognized words[^<]*</summary>\n*```\n*([^<]*)```\n*</details>$}m) { print "$1" } elsif (m{Unrecognized words[^<]*\n\n((?:\w.*\n)+)\n}m) { print "$1" };' < "$comment_body")

update_files
rm $comment_body
git add -u
If the flagged items do not appear to be text

If items relate to a ...

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

  • binary file.

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

@yuyoyuppe yuyoyuppe force-pushed the arm64_finalize_bootstrapper branch from 6e1f415 to 8649911 Compare May 26, 2022 15:51
@davidegiacometti
Copy link
Collaborator

#3073 👀

@yuyoyuppe yuyoyuppe force-pushed the arm64_finalize_bootstrapper branch from 8649911 to dcfbd70 Compare May 26, 2022 16:08
@crutkas
Copy link
Member

crutkas commented May 26, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines failed to run 1 pipeline(s).

@yuyoyuppe yuyoyuppe force-pushed the arm64_finalize_bootstrapper branch from dcfbd70 to 5a17e32 Compare May 26, 2022 16:14
@github-actions
Copy link

github-actions bot commented May 27, 2022

@check-spelling-bot Report

🔴 Please review

See the files view or the action log for details.

Unrecognized words (2)

EDEF
FCBE

Previously acknowledged words that are now absent BGSOUNDS BUILDARCH CLIENTPULL codecvt concrt dispid DISPIDAMBIENTDLCONTROL DLACTIVEXCTLS DLCONTROL DLIMAGES DOWNLOADONLY epo FANCYZONESWINDOWSTYLES FORCEOFFLINE FRAMEDOWNLOAD gsuberland HFONT Htmdid ICore IDCANCEL IDOK INITDIALOG IReflect IWindows IXaml lamotile METACHARSET mirophone mshtmdid msvcp NETFX netstandard Nvidia otating Postion preperty ruleset RUNACTIVEXCTLS serizalization settingsv Setttings sourceid testtrocess Toolchain vccorlib vcomp vcredist vcruntime VDId xbf XBind XInstance
To accept these unrecognized words as correct (and remove the previously acknowledged and now absent words), run the following commands

... in a clone of the git@github.com:yuyoyuppe/PowerToys.git repository
on the arm64_finalize_bootstrapper branch:

update_files() {
perl -e '
my @expect_files=qw('".github/actions/spell-check/expect.txt"');
@ARGV=@expect_files;
my @stale=qw('"$patch_remove"');
my $re=join "|", @stale;
my $suffix=".".time();
my $previous="";
sub maybe_unlink { unlink($_[0]) if $_[0]; }
while (<>) {
if ($ARGV ne $old_argv) { maybe_unlink($previous); $previous="$ARGV$suffix"; rename($ARGV, $previous); open(ARGV_OUT, ">$ARGV"); select(ARGV_OUT); $old_argv = $ARGV; }
next if /^(?:$re)(?:(?:\r|\n)*$| .*)/; print;
}; maybe_unlink($previous);'
perl -e '
my $new_expect_file=".github/actions/spell-check/expect.txt";
use File::Path qw(make_path);
use File::Basename qw(dirname);
make_path (dirname($new_expect_file));
open FILE, q{<}, $new_expect_file; chomp(my @words = <FILE>); close FILE;
my @add=qw('"$patch_add"');
my %items; @items{@words} = @words x (1); @items{@add} = @add x (1);
@words = sort {lc($a)."-".$a cmp lc($b)."-".$b} keys %items;
open FILE, q{>}, $new_expect_file; for my $word (@words) { print FILE "$word\n" if $word =~ /\w/; };
close FILE;
system("git", "add", $new_expect_file);
'
}

comment_json=$(mktemp)
curl -L -s -S \
-H "Content-Type: application/json" \
"https://api.github.com/repos/microsoft/PowerToys/issues/comments/1139567751" > "$comment_json"
comment_body=$(mktemp)
jq -r ".body // empty" "$comment_json" > $comment_body
rm $comment_json

patch_remove=$(perl -ne 'next unless s{^</summary>(.*)</details>$}{$1}; print' < "$comment_body")

patch_add=$(perl -e '$/=undef; $_=<>; if (m{Unrecognized words[^<]*</summary>\n*```\n*([^<]*)```\n*</details>$}m) { print "$1" } elsif (m{Unrecognized words[^<]*\n\n((?:\w.*\n)+)\n}m) { print "$1" };' < "$comment_body")

update_files
rm $comment_body
git add -u
If the flagged items do not appear to be text

If items relate to a ...

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

  • binary file.

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

@github-actions
Copy link

github-actions bot commented May 27, 2022

@check-spelling-bot Report

🔴 Please review

See the files view or the action log for details.

Unrecognized words (2)

EDEF
FCBE

Previously acknowledged words that are now absent BGSOUNDS BUILDARCH CLIENTPULL codecvt concrt dispid DISPIDAMBIENTDLCONTROL DLACTIVEXCTLS DLCONTROL DLIMAGES DOWNLOADONLY epo FANCYZONESWINDOWSTYLES FORCEOFFLINE FRAMEDOWNLOAD gsuberland HFONT Htmdid ICore IDCANCEL IDOK INITDIALOG IReflect IWindows IXaml lamotile METACHARSET mirophone mshtmdid msvcp NETFX netstandard Nvidia otating Postion preperty ruleset RUNACTIVEXCTLS serizalization settingsv Setttings sourceid testtrocess Toolchain vccorlib vcomp vcredist vcruntime VDId xbf XBind XInstance
To accept these unrecognized words as correct (and remove the previously acknowledged and now absent words), run the following commands

... in a clone of the git@github.com:yuyoyuppe/PowerToys.git repository
on the arm64_finalize_bootstrapper branch:

update_files() {
perl -e '
my @expect_files=qw('".github/actions/spell-check/expect.txt"');
@ARGV=@expect_files;
my @stale=qw('"$patch_remove"');
my $re=join "|", @stale;
my $suffix=".".time();
my $previous="";
sub maybe_unlink { unlink($_[0]) if $_[0]; }
while (<>) {
if ($ARGV ne $old_argv) { maybe_unlink($previous); $previous="$ARGV$suffix"; rename($ARGV, $previous); open(ARGV_OUT, ">$ARGV"); select(ARGV_OUT); $old_argv = $ARGV; }
next if /^(?:$re)(?:(?:\r|\n)*$| .*)/; print;
}; maybe_unlink($previous);'
perl -e '
my $new_expect_file=".github/actions/spell-check/expect.txt";
use File::Path qw(make_path);
use File::Basename qw(dirname);
make_path (dirname($new_expect_file));
open FILE, q{<}, $new_expect_file; chomp(my @words = <FILE>); close FILE;
my @add=qw('"$patch_add"');
my %items; @items{@words} = @words x (1); @items{@add} = @add x (1);
@words = sort {lc($a)."-".$a cmp lc($b)."-".$b} keys %items;
open FILE, q{>}, $new_expect_file; for my $word (@words) { print FILE "$word\n" if $word =~ /\w/; };
close FILE;
system("git", "add", $new_expect_file);
'
}

comment_json=$(mktemp)
curl -L -s -S \
-H "Content-Type: application/json" \
"https://api.github.com/repos/microsoft/PowerToys/issues/comments/1139575205" > "$comment_json"
comment_body=$(mktemp)
jq -r ".body // empty" "$comment_json" > $comment_body
rm $comment_json

patch_remove=$(perl -ne 'next unless s{^</summary>(.*)</details>$}{$1}; print' < "$comment_body")

patch_add=$(perl -e '$/=undef; $_=<>; if (m{Unrecognized words[^<]*</summary>\n*```\n*([^<]*)```\n*</details>$}m) { print "$1" } elsif (m{Unrecognized words[^<]*\n\n((?:\w.*\n)+)\n}m) { print "$1" };' < "$comment_body")

update_files
rm $comment_body
git add -u
If the flagged items do not appear to be text

If items relate to a ...

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

  • binary file.

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

@yuyoyuppe yuyoyuppe requested a review from jaimecbernardo May 27, 2022 12:38
@@ -113,6 +123,22 @@
Size="$(var.WinAppSDKPayloadSize)"
Version="1.0.3.0"
Hash="$(var.WinAppSDKPayloadHash)" />
</ExePackage>
<ExePackage
Name="VCRedist.exe"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we use other name here, like VCRedist-14.32.31326.exe? The main reason for this is that if there's a VCRedist.exe in the same path as the installer, this will try to use that one and fail.
Also is there some code we can use to detect if we get the "more recent version is installed" error and still continue?

Copy link
Contributor Author

@yuyoyuppe yuyoyuppe May 27, 2022

Choose a reason for hiding this comment

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

Done. Yes, we already do that for a minor version, see DetectCondition="DetectedVCRedistVersion >= 32". And we shouldn't be checking for a greater major version, since it'll probably be ABI-incompatible.

@yuyoyuppe
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 18500 in repo microsoft/PowerToys

Copy link
Collaborator

@jaimecbernardo jaimecbernardo left a comment

Choose a reason for hiding this comment

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

LGTM!
It works very well. Great work!

@jaimecbernardo jaimecbernardo merged commit ba4b9cf into microsoft:main May 30, 2022
@yuyoyuppe yuyoyuppe deleted the arm64_finalize_bootstrapper branch May 30, 2022 10:37
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.

4 participants