Skip to content

ARM64 Build #2985

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

Open
wants to merge 17 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
- dev
- master
pull_request:
branches:
- dev
- master

jobs:
build:
Expand All @@ -28,6 +31,22 @@ jobs:
file: |
"**/SolutionAssemblyInfo.cs"
version: ${{ env.FlowVersion }}.${{ env.BUILD_NUMBER }}
- uses: actions/cache@v4
name: Restore Nuget Cache
with:
path: |
~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget
- uses: actions/cache@v4
name: Restore dotnet tool Cache
with:
path: |
~/.dotnet/tools
key: ${{ runner.os }}-dotnet-tools-${{ hashFiles('~/.dotnet/tools/**') }}
restore-keys: |
${{ runner.os }}-dotnet-tools
Comment on lines +34 to +49
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Cache keys need better invalidation

Two small issues reduce the usefulness of the new cache steps:

  1. hashFiles('~/.dotnet/tools/**') always returns an empty string because the path is outside the workspace. The key ends up as windows-latest-dotnet-tools-, so the cache never busts when tool versions change.
  2. The NuGet key hashes only *.csproj; it misses other restore-affecting files such as Directory.Packages.props, packages.lock.json, and global.json.

Suggested adjustments:

-          key: ${{ runner.os }}-dotnet-tools-${{ hashFiles('~/.dotnet/tools/**') }}
+          key: ${{ runner.os }}-dotnet-tools-${{ runner.os }}-${{ env.FlowVersion }}

-          key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
+          key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/packages.lock.json', 'global.json', 'Directory.Packages.props') }}

(The dotnet-tools key can also hash a repo file like .github/workflows/dotnet.yml if you prefer a content-based key.)

These tweaks keep caches both reusable and correctly invalidated.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In .github/workflows/dotnet.yml between lines 34 and 49, the cache keys for
NuGet and dotnet tools are not properly invalidated. Fix the dotnet tools cache
key by hashing a file inside the repository, such as
.github/workflows/dotnet.yml, instead of the external ~/.dotnet/tools directory.
For the NuGet cache key, expand the hashFiles function to include other
important files like Directory.Packages.props, packages.lock.json, and
global.json along with *.csproj files to ensure the cache updates correctly when
these files change.

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
Expand Down Expand Up @@ -89,3 +108,4 @@ jobs:
path: |
Output\Packages\RELEASES
compression-level: 0

1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project>
<PropertyGroup>
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
<RuntimeIdentifier>$(FlowRuntimeIdentifier)</RuntimeIdentifier>
</PropertyGroup>
</Project>
7 changes: 7 additions & 0 deletions Flow.Launcher/Flow.Launcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|ARM64' ">
<DefineConstants>ARM64;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|ARM64' ">
<DefineConstants>ARM64;$(DefineConstants)</DefineConstants>
</PropertyGroup>

<ItemGroup>
<ApplicationDefinition Remove="App.xaml" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<Platform>ARM64</Platform>
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
<PublishDir>..\Output\Release\</PublishDir>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<RuntimeIdentifier>win-arm64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun>False</PublishReadyToRun>
Expand Down
Binary file not shown.
1 change: 1 addition & 0 deletions Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<system:String x:Key="plugin_explorer_Directory_Recursive_Search_Engine">Directory Recursive Search Engine</system:String>
<system:String x:Key="plugin_explorer_Index_Search_Engine">Index Search Engine</system:String>
<system:String x:Key="plugin_explorer_Open_Window_Index_Option">Open Windows Index Option</system:String>
<system:String x:Key="plugin_explorer_Excluded_File_Types">Excluded File Types (comma seperated)</system:String>

Check warning on line 74 in Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml

View workflow job for this annotation

GitHub Actions / Check Spelling

`seperated` is not a recognized word. (unrecognized-spelling)
<system:String x:Key="plugin_explorer_Excluded_File_Types_Tooltip">For example: exe,jpg,png</system:String>
<system:String x:Key="plugin_explorer_Maximum_Results">Maximum results</system:String>
<system:String x:Key="plugin_explorer_Maximum_Results_Tooltip">The maximum number of results requested from active search engine</system:String>
Expand Down Expand Up @@ -141,6 +141,7 @@
<!-- Everything -->
<system:String x:Key="flowlauncher_plugin_everything_sdk_issue">Failed to load Everything SDK</system:String>
<system:String x:Key="flowlauncher_plugin_everything_is_not_running">Warning: Everything service is not running</system:String>
<system:String x:Key="flowlauncher_plugin_everything_arm64_not_supported">ARM64 is not supported for everything.</system:String>
<system:String x:Key="flowlauncher_plugin_everything_query_error">Error while querying Everything</system:String>
<system:String x:Key="flowlauncher_plugin_everything_sort_by">Sort By</system:String>
<system:String x:Key="flowlauncher_plugin_everything_sort_by_name">Name</system:String>
Expand Down
6 changes: 4 additions & 2 deletions Plugins/Flow.Launcher.Plugin.Explorer/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ public Task InitAsync(PluginInitContext context)
contextMenu = new ContextMenu(Context, Settings, viewModel);
searchManager = new SearchManager(Settings, Context);
ResultManager.Init(Context, Settings);

SortOptionTranslationHelper.API = context.API;

#if !ARM64
EverythingApiDllImport.Load(Path.Combine(Context.CurrentPluginMetadata.PluginDirectory, "EverythingSDK",
Environment.Is64BitProcess ? "x64" : "x86"));
#endif
return Task.CompletedTask;
}

Expand Down Expand Up @@ -75,7 +77,7 @@ public async Task<List<Result>> QueryAsync(Query query, CancellationToken token)
IcoPath = e is EngineNotAvailableException { ErrorIcon: { } iconPath }
? iconPath
: Constants.GeneralSearchErrorImagePath,
AsyncAction = e is EngineNotAvailableException {Action: { } action}
AsyncAction = e is EngineNotAvailableException { Action: { } action }
? action
: _ =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ public EverythingSearchManager(Settings settings)

private async ValueTask ThrowIfEverythingNotAvailableAsync(CancellationToken token = default)
{
#if ARM64
throw new EngineNotAvailableException(
Enum.GetName(Settings.IndexSearchEngineOption.Everything)!,
"ARM64 is not supported",
Main.Context.API.GetTranslation("flowlauncher_plugin_everything_not_support_arm64"),
Constants.EverythingErrorImagePath,
_ => ValueTask.FromResult(false));
#endif

try
{
if (!await EverythingApi.IsEverythingRunningAsync(token))
Expand All @@ -46,7 +55,9 @@ private async ValueTask<bool> ClickToInstallEverythingAsync(ActionContext _)
{
try
{
var installedPath = await EverythingDownloadHelper.PromptDownloadIfNotInstallAsync(Settings.EverythingInstalledPath, Main.Context.API);
var installedPath =
await EverythingDownloadHelper.PromptDownloadIfNotInstallAsync(Settings.EverythingInstalledPath,
Main.Context.API);

if (installedPath == null)
{
Expand All @@ -72,17 +83,18 @@ private async ValueTask<bool> ClickToInstallEverythingAsync(ActionContext _)
}
}

public async IAsyncEnumerable<SearchResult> SearchAsync(string search, [EnumeratorCancellation] CancellationToken token)
public async IAsyncEnumerable<SearchResult> SearchAsync(string search,
[EnumeratorCancellation] CancellationToken token)
{
await ThrowIfEverythingNotAvailableAsync(token);

if (token.IsCancellationRequested)
yield break;

var option = new EverythingSearchOption(search,
Settings.SortOption,
MaxCount: Settings.MaxResult,
IsFullPathSearch: Settings.EverythingSearchFullPath,
var option = new EverythingSearchOption(search,
Settings.SortOption,
MaxCount: Settings.MaxResult,
IsFullPathSearch: Settings.EverythingSearchFullPath,
IsRunCounterEnabled: Settings.EverythingEnableRunCount);

await foreach (var result in EverythingApi.SearchAsync(option, token))
Expand Down Expand Up @@ -125,7 +137,8 @@ public async IAsyncEnumerable<SearchResult> ContentSearchAsync(string plainSearc
}
}

public async IAsyncEnumerable<SearchResult> EnumerateAsync(string path, string search, bool recursive, [EnumeratorCancellation] CancellationToken token)
public async IAsyncEnumerable<SearchResult> EnumerateAsync(string path, string search, bool recursive,
[EnumeratorCancellation] CancellationToken token)
{
await ThrowIfEverythingNotAvailableAsync(token);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
case false
when ActionKeywordMatch(query, Settings.ActionKeyword.IndexSearchActionKeyword)
|| ActionKeywordMatch(query, Settings.ActionKeyword.SearchActionKeyword):

searchResults = Settings.IndexProvider.SearchAsync(query.Search, token);
engineName = Enum.GetName(Settings.IndexSearchEngine);
break;
Expand Down Expand Up @@ -183,7 +183,7 @@
if (EnvironmentVariables.IsEnvironmentVariableSearch(querySearch))
return EnvironmentVariables.GetEnvironmentStringPathSuggestions(querySearch, query, Context);

// Query is a location path with a full environment variable, eg. %appdata%\somefolder\, c:\users\%USERNAME%\downloads

Check warning on line 186 in Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`somefolder` is not a recognized word. (unrecognized-spelling)
var needToExpand = EnvironmentVariables.HasEnvironmentVar(querySearch);
var path = needToExpand ? Environment.ExpandEnvironmentVariables(querySearch) : querySearch;

Expand Down
2 changes: 1 addition & 1 deletion Scripts/post_build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ function Main {
Validate-Directory $o
Pack-Squirrel-Installer $p $v $o

Publish-Portable $o $v
# Publish-Portable $o $v
}
}

Expand Down
3 changes: 2 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ 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

configuration: Release
before_build:
- ps: |
Expand All @@ -41,6 +41,7 @@ before_build:
build:
project: Flow.Launcher.sln
verbosity: minimal

test_script:
- dotnet test --no-build -c Release
after_test:
Expand Down
Loading