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

Cross-platform support #518

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

vedantmgoyal9
Copy link
Contributor

@vedantmgoyal9 vedantmgoyal9 commented Feb 22, 2024


  • Added support for win-arm64,osx-arm64,linux-arm64,linux-x64.
  • Directories on Linux/macOS:
    • Settings: ~/.config/wingetcreate/settings.json,~/.config/wingetcreate/settings.json.backup
    • Logs: ~/.config/wingetcreate/DiagOutputDir/<file>.txt
    • Installer downloads: /tmp/wingetcreate/
Microsoft Reviewers: Open in CodeFlow

@microsoft-github-policy-service microsoft-github-policy-service bot added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Feb 22, 2024
@vedantmgoyal9 vedantmgoyal9 marked this pull request as ready for review March 28, 2024 17:53
@vedantmgoyal9 vedantmgoyal9 requested a review from a team as a code owner March 28, 2024 17:53
@vedantmgoyal9 vedantmgoyal9 requested review from yao-msft and ryfu-msft and removed request for a team March 28, 2024 17:53
Copy link
Contributor

@sitiom sitiom left a comment

Choose a reason for hiding this comment

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

Directories on Linux/macOS:

  • Settings: ~/.wingetcreate/settings.json,~/.wingetcreate/settings.json.backup
  • Logs: ~/.wingetcreate/DiagOutputDir/<file>.txt
  • Installer downloads: /tmp/wingetcreate/

It would be nice to follow the XDG Base Directory spec like most apps already do to avoid clutter in the home directory (Example: ~/.config/winget-create)

@ryfu-msft
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vedantmgoyal9
Copy link
Contributor Author

@florelis can you please review this?

Copy link
Member

@florelis florelis left a comment

Choose a reason for hiding this comment

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

(Haven't finished reading through the whole PR yet)

@ryfu-msft could you also review this since you have more context? At least the sections for package parsing

Main comments so far:

  • Writing the token in plain text is risky
  • We need to verify the internal protocols we have for using new OSS projects
  • For computing the PFN I'd like an official source of the algorithm or the ok from MSIX team. I don't want this repo to become the official MS source for how these are computed

README.md Show resolved Hide resolved
.gitmodules Outdated
path = src/WingetCreateCore/Common/Msi/rust-msi\
# TODO: Switch to mdsteele/rust-msi once the PR is merged
# https://github.com/mdsteele/rust-msi/pull/18
url = https://github.com/vedantmgoyal9/rust-msi
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we can just include an external repository as a submodule and then build it blindly; that seems like a security risk. At the very least, it should point to a specific commit so that we cannot get unknown, unexpected changes.

We have internal policies/procedures for evaluating new OSS we use, but I'm not that familiar with them. I need review them or ask someone else on the team..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pinned to a specific commit.

Copy link
Member

Choose a reason for hiding this comment

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

I think that is still pointing to a branch, which can get newer commits at any time

Copy link
Contributor Author

Choose a reason for hiding this comment

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

src/WingetCreateCLI/Commands/SettingsCommand.cs Outdated Show resolved Hide resolved
src/WingetCreateCLI/Common.cs Outdated Show resolved Hide resolved
src/WingetCreateCLI/Common.cs Outdated Show resolved Hide resolved
src/WingetCreateCore/Common/PackageParser.cs Outdated Show resolved Hide resolved
src/WingetCreateCore/Common/PackageParser.cs Outdated Show resolved Hide resolved
src/WingetCreateCore/Common/MsixAndAppx.cs Outdated Show resolved Hide resolved
src/WingetCreateCore/Common/MsixAndAppx.cs Outdated Show resolved Hide resolved
Comment on lines 67 to 70
// Generate the hash part of the package family name
var publisherSha256 = SHA256.HashData(Encoding.Unicode.GetBytes(identityNode.Attributes["Publisher"].Value));
var binaryString = string.Concat(publisherSha256.Take(8).Select(c => Convert.ToString(c, 2).PadLeft(8, '0'))) + '0'; // representing 65-bits = 13 * 5
var encodedPublisherId = string.Concat(Enumerable.Range(0, binaryString.Length / 5).Select(i => "0123456789ABCDEFGHJKMNPQRSTVWXYZ".Substring(Convert.ToInt32(binaryString.Substring(i * 5, 5), 2), 1)));
Copy link
Member

Choose a reason for hiding this comment

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

Where did this come from? If there is an official source we should link it in a comment for future reference. If not, we'll need to ask the MSIX team internally to confirm this is right and that it is appropriate for us to write publicly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added a comment referencing the source. By the way, the same algorithm is also used in YamlCreate.ps1 - https://github.com/microsoft/winget-pkgs/blob/master/Tools/YamlCreate.ps1#L853-L870.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Port to Linux and macOS Remove x86 package from msixbundle
5 participants