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 Build #2985

Open
wants to merge 16 commits into
base: dev
Choose a base branch
from
Open

ARM64 Build #2985

wants to merge 16 commits into from

Conversation

taooceros
Copy link
Member

No description provided.

Copy link
Contributor

coderabbitai bot commented Sep 21, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The changes involve updates to multiple files to support the ARM64 architecture. The Net7.0-SelfContained.pubxml and appveyor.yml files have been modified to target ARM64, reflecting this shift in their respective properties. A new GitHub Actions workflow has been introduced for automated builds and testing, while modifications in the Flow.Launcher.csproj file add ARM64-specific property groups. Additionally, the Explorer plugin has been updated with new error messages and conditional checks for ARM64 support.

Changes

File Change Summary
Flow.Launcher/Properties/PublishProfiles/... Updated <Platform> from Any CPU to ARM64 and <RuntimeIdentifier> from win-x64 to win-arm64.
appveyor.yml Changed target platform from Any CPU to ARM64 and added a test_script for running tests.
.github/workflows/dotnet.yml Introduced a new workflow for automated builds and testing, with environment setup and artifact uploads.
Flow.Launcher/Flow.Launcher.csproj Added ARM64-specific property groups for Debug and Release configurations.
Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml Added a new string resource for ARM64 support warning.
Plugins/Flow.Launcher.Plugin.Explorer/Main.cs Introduced ARM64 conditional loading for EverythingApiDllImport and minor formatting changes.
Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingSearchManager.cs Added ARM64 check in ThrowIfEverythingNotAvailableAsync and improved method signatures for clarity.
Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs Removed a blank line in a switch statement without affecting logic.
Directory.Build.props Added a new RuntimeIdentifier property set to $(FlowRuntimeIdentifier).
Scripts/post_build.ps1 Commented out the call to Publish-Portable, disabling its execution.

Poem

🐰 In fields of code, we hop with glee,
ARM64 awaits, as bright as can be!
With tests that run, our builds take flight,
A leap for the future, oh what a sight!
Through changes we bound, with joy in our hearts,
In the world of tech, a new journey starts! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added this to the 1.19.2 milestone Sep 21, 2024

This comment has been minimized.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range and nitpick comments (1)
appveyor.yml (1)

33-33: LGTM! Please remove the trailing spaces.

The addition of the test script is a good enhancement to the build process. It ensures that the tests are run against the Release build without unnecessary rebuilding.

Please remove the trailing spaces in this line to maintain clean code.

Apply this diff to remove the trailing spaces:

-  
+
Tools
yamllint

[error] 33-33: trailing spaces

(trailing-spaces)

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6f661ef and 2afebcb.

Files selected for processing (2)
  • Flow.Launcher/Properties/PublishProfiles/Net7.0-SelfContained.pubxml (1 hunks)
  • appveyor.yml (1 hunks)
Additional context used
yamllint
appveyor.yml

[error] 33-33: trailing spaces

(trailing-spaces)

Additional comments not posted (2)
Flow.Launcher/Properties/PublishProfiles/Net7.0-SelfContained.pubxml (1)

9-9: LGTM! The changes are consistent with the PR objective.

The modifications to the <Platform> and <RuntimeIdentifier> properties correctly target the ARM64 architecture for the build and runtime environment.

However, please ensure thorough testing of the application on ARM64 devices to validate compatibility and performance. Consider running the following manual tests:

  1. Install the application on an ARM64 Windows device and verify successful installation.
  2. Launch the application and perform basic functionality tests to ensure core features work as expected.
  3. Conduct performance tests to measure application responsiveness and resource utilization on the ARM64 device.
  4. Test edge cases and boundary conditions that may be impacted by the architecture change.

Documenting the results of these tests will help build confidence in the ARM64 support.

Also applies to: 12-12

appveyor.yml (1)

26-26: Verify compatibility with ARM64 architecture.

The platform change from "Any CPU" to "ARM64" aligns with the PR objective. Please ensure that the rest of the project is compatible with ARM64 architecture.

Run the following script to verify the project's compatibility with ARM64 architecture:

- Specify ARM64 target
- Everything Search will return an error
@taooceros taooceros changed the title try building for arm64 ARM64 Build Sep 21, 2024

This comment has been minimized.

@taooceros
Copy link
Member Author

huh I think the CI is problematic; we need to switch to github action for this https://help.appveyor.com/discussions/questions/62461-build-on-windows-arm64-possible

This comment has been minimized.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range and nitpick comments (3)
Flow.Launcher/Flow.Launcher.csproj (2)

41-43: Review of ARM64 Debug Configuration

The addition of the ARM64 Debug configuration is a crucial step for supporting ARM64 architecture. The use of $(DefineConstants) ensures that existing constants are not overwritten but extended, which is a good practice to maintain compatibility and extend functionality.

However, it's important to ensure that other necessary configurations specific to ARM64, such as PlatformTarget and potentially different optimization settings or output paths, are also considered. This would ensure that the ARM64 builds are correctly configured and optimized for that architecture.

Consider adding more ARM64-specific settings such as PlatformTarget and Optimize to fully support and optimize the ARM64 build process.


44-46: Review of ARM64 Release Configuration

Similar to the Debug configuration, the Release configuration for ARM64 correctly extends the existing constants. This inclusion is essential for ensuring that ARM64-specific code can be conditionally compiled.

As with the Debug configuration, it would be beneficial to review and possibly include additional ARM64-specific settings. Release builds often have different optimization and debugging settings that could be crucial for performance on ARM64 devices.

Recommend reviewing and adding ARM64-specific settings in the Release configuration, such as PlatformTarget and Optimize, to enhance performance and compatibility.

Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingSearchManager.cs (1)

23-30: Conditional ARM64 check is well-implemented.

The addition of the ARM64 check in ThrowIfEverythingNotAvailableAsync method is crucial for ensuring that the application does not attempt to use features that are not supported on ARM64 architectures. The use of EngineNotAvailableException is appropriate and aligns with the application's error handling strategy.

Consider adding a configuration or feature flag system in the future to manage such platform-specific checks more dynamically, which could enhance scalability and maintainability.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2afebcb and cea6560.

Files selected for processing (6)
  • .github/workflows/dotnet.yml (1 hunks)
  • Flow.Launcher/Flow.Launcher.csproj (1 hunks)
  • Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml (1 hunks)
  • Plugins/Flow.Launcher.Plugin.Explorer/Main.cs (2 hunks)
  • Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingSearchManager.cs (4 hunks)
  • Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs (1 hunks)
Files skipped from review due to trivial changes (1)
  • Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs
Additional comments not posted (15)
Plugins/Flow.Launcher.Plugin.Explorer/Main.cs (3)

45-45: Approved formatting change.

The addition of a blank line improves readability and does not impact functionality.


48-51: Approved conditional compilation for ARM64 compatibility.

The use of #if !ARM64 to conditionally load the EverythingApiDllImport is a smart approach to ensure compatibility with ARM64 architectures. This prevents potential runtime errors due to incompatibility of the DLL with ARM64.


80-80: Approved minor formatting change in error handling.

The minor change in formatting does not alter the functionality but helps in maintaining code consistency. The specific handling of EngineNotAvailableException ensures that users receive meaningful feedback in case of errors, which is crucial for user experience.

.github/workflows/dotnet.yml (8)

4-15: Workflow Triggers and Naming

The workflow is well-named and clearly triggers on appropriate events such as workflow_dispatch, push, and pull_request for dev and master branches. This setup ensures that the workflow runs on all important code changes and manual triggers, which is suitable for continuous integration practices.


20-24: Environment Variables Setup

The environment variables FlowVersion, NUGET_CERT_REVOCATION_MODE, and BUILD_NUMBER are correctly set up. These variables are crucial for versioning and ensuring that the NuGet operations work as expected in offline mode, which is particularly useful in CI environments where internet access might be restricted.


26-33: Project Versioning Step

The use of vers-one/dotnet-project-version-updater to update the version in SolutionAssemblyInfo.cs is a smart choice to automate version management. This step ensures that each build can be uniquely identified using the FlowVersion and BUILD_NUMBER, which is essential for traceability and release management.


34-49: Cache Restoration Steps

The configuration for restoring the NuGet and .NET tool caches is well-implemented. Using paths like ~/.nuget/packages and ~/.dotnet/tools along with keys based on the operating system and file hashes ensures efficient and reliable cache usage, which can significantly speed up the build process by reusing previously downloaded packages and tools.


55-60: Conditional Tool Installation

The step to conditionally install the vpk tool only if it is not already present is a good practice to avoid unnecessary reinstalls. This check minimizes the setup time and ensures that the latest tool version is used without affecting the existing setup.


67-68: Service Initialization for Testing

Initializing the Windows Search service is necessary for running tests that depend on this service. The commands to set the service to start automatically and to start it are correctly placed before the testing steps, ensuring that all prerequisites for the tests are met.


71-73: Post-Build Script Execution

Executing a PowerShell script for post-build tasks with parameters like flowversion and build number is a good practice. This allows for custom operations such as cleanup, notifications, or additional checks to be performed after the main build and test steps.


74-109: Artifact Upload Steps

The steps to upload various build artifacts like the plugin NuGet package, installer executable, portable version, full NuGet package, and release information are well-configured. Using actions/upload-artifact with specific paths and setting compression-level to 0 (for faster uploads at the cost of larger file size) is appropriate for these artifacts. This setup ensures that all relevant outputs from the build process are stored and available for further actions like deployment or manual downloads.

Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingSearchManager.cs (3)

54-56: Formatting improvements enhance readability.

The changes in formatting within the ClickToInstallEverythingAsync method improve readability and maintainability by breaking longer lines into more manageable segments. This aligns well with common coding standards.


71-82: Method signature reformatting in SearchAsync enhances clarity.

The changes to the method signature and parameter alignment in SearchAsync enhance clarity and readability. The use of the EnumeratorCancellation attribute is correctly applied, and the overall formatting aligns with best practices for long method signatures.


125-126: Method signature reformatting in EnumerateAsync enhances clarity.

The changes to the method signature and parameter alignment in EnumerateAsync enhance clarity and readability. The use of the EnumeratorCancellation attribute is correctly applied, and the overall formatting aligns with best practices for long method signatures.

Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml (1)

130-130: Approve the addition of the new string resource.

The new string resource flowlauncher_plugin_everything_arm64_not_supported is correctly added and clearly communicates the limitation of ARM64 support for the Everything plugin. This is a good practice in user communication, ensuring that users are aware of compatibility issues.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@jjw24
Copy link
Member

jjw24 commented Sep 29, 2024

ARM64 Everything SDK dll from #2996

This comment has been minimized.

@taooceros
Copy link
Member Author

TODO: add the code related to import arm64 everything dll

@taooceros taooceros linked an issue Oct 28, 2024 that may be closed by this pull request
@maxnabokow
Copy link

@taooceros Thanks for putting this together. Glad we're getting an arm64 build. When can we get this merged and released? What else does the team still need to do?

@taooceros
Copy link
Member Author

taooceros commented Dec 2, 2024

@taooceros Thanks for putting this together. Glad we're getting an arm64 build. When can we get this merged and released? What else does the team still need to do?

There are quite a few reason that it is not yet production ready.

  1. Our auto-update pipeline does not support multiple update sources (See Migrate to Velopack & Github Action #2616)
  2. Appveyor does not support ARM64, in which is the pipeline we are using. (See GitHub action #2986 for progress to migrate to github action, and is what is used in this pr).
  3. The ARM64 build may have problem interact with some plugins (like everything I haven't finished, and some plugin that published specifically for x64 instead of full platform). We need a good spec to illustrate the platform compatibility.

Those issues are non-trivial, and given that ARM64 users are still small, I would encourage people who wants ARM64 native to download the artifact from this pr.

Copy link

github-actions bot commented Dec 2, 2024

@check-spelling-bot Report

🔴 Please review

See the 📂 files view, the 📜action log, or 📝 job summary for details.

❌ Errors Count
❌ forbidden-pattern 22
❌ ignored-expect-variant 1
⚠️ non-alpha-in-dictionary 19

See ❌ Event descriptions for more information.

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    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).

  • 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (2)
appveyor.yml (2)

33-33: Remove trailing whitespace

There is trailing whitespace on line 33.

-  
+
🧰 Tools
🪛 yamllint (1.35.1)

[error] 33-33: trailing spaces

(trailing-spaces)


Line range hint 38-83: Consider platform-specific artifact handling

The current artifact configuration doesn't distinguish between x64 and ARM64 builds. This could lead to confusion when both architectures are supported.

Consider updating the artifact paths and names to include the platform:

-- path: 'Output\Packages\Flow-Launcher-*.exe'
-  name: Squirrel Installer
+- path: 'Output\Packages\Flow-Launcher-$(platform)-*.exe'
+  name: Squirrel Installer ($(platform))
🧰 Tools
🪛 yamllint (1.35.1)

[error] 33-33: trailing spaces

(trailing-spaces)


[warning] 35-35: wrong indentation: expected 0 but found 2

(indentation)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 20561ab and f8c49a6.

⛔ Files ignored due to path filters (1)
  • Plugins/Flow.Launcher.Plugin.Explorer/EverythingSDK/arm64/Everything.dll is excluded by !**/*.dll
📒 Files selected for processing (2)
  • Flow.Launcher/Flow.Launcher.csproj (1 hunks)
  • appveyor.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • Flow.Launcher/Flow.Launcher.csproj
🧰 Additional context used
🪛 yamllint (1.35.1)
appveyor.yml

[error] 33-33: trailing spaces

(trailing-spaces)

🔇 Additional comments (1)
appveyor.yml (1)

34-34: Consider platform-specific test configuration

While adding tests is good, ensure that the test command accounts for ARM64-specific scenarios. You might need to:

  1. Skip tests that are not compatible with ARM64
  2. Add platform-specific test configurations

Run this script to check for any ARM64-specific test configurations or platform checks in the test files:

@@ -23,13 +23,14 @@ assembly_info:
assembly_informational_version: $(flowVersion)

image: Visual Studio 2022
platform: Any CPU
platform: ARM64
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Critical: AppVeyor does not support ARM64 builds

Setting the platform to ARM64 in AppVeyor configuration is problematic as AppVeyor does not provide native ARM64 build support. This could lead to build failures or incorrect artifacts.

As mentioned in the PR discussion, consider migrating to GitHub Actions for proper ARM64 build support.

Consider:

  1. Creating a separate GitHub Actions workflow for ARM64 builds
  2. Using AppVeyor only for x64 builds until the migration is complete
  3. Adding platform-specific naming for artifacts to distinguish between x64 and ARM64 builds

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.

Native version for Windows on ARM64
4 participants