Desdaemon / homebrew-repo

Personal Homebrew taps, fresh from the keg!
0 stars 1 forks source link

Scoop & homebrew of flutter_rust_bridge #121

Open fzyzcjy opened 1 week ago

fzyzcjy commented 1 week ago

Hi, it seems that the scoop repo does not have updates, neither do homebrew (e.g. PR seems not merged). Since the two repos are not owned by me, maybe I cannot do much to fix it. I will temporarily hide these from doc to avoid confusion, but feel free to ping me!

Desdaemon commented 1 week ago

Congrats on releasing v2! I'll update my personal scoop and homebrew soon. Since FRB has also surpassed homebrew's criteria for inclusion in the official tap, you could also open a new PR on their side so that we can deprecate my tap.

fzyzcjy commented 1 week ago

Thanks and also thanks for your contributions! Take your time for the scoop, and ping me when ready (thus I can update doc)

Since FRB has also surpassed homebrew's criteria for inclusion in the official tap, you could also open a new PR on their side so that we can deprecate my tap.

That looks great, I will do it later.

Desdaemon commented 1 week ago

Scoop bucket has been updated to v2.

fzyzcjy commented 1 week ago

Great! I will handle it later

Desdaemon commented 1 week ago

Off-topic, but I really don't like how homebrew parsed v2.0.0-dev.3 as having major version 3 which messed up with everything...

fzyzcjy commented 1 week ago

What...? That's really weird behavior :(

Desdaemon commented 1 week ago

@fzyzcjy Homebrew tap has been updated to v2, and further updates on both here and the scoop bucket will resume.

fzyzcjy commented 1 week ago

@Desdaemon Great! So should I use it in that repo or in the official homebrew repo?

Desdaemon commented 1 week ago

For now it's still in this tap, in the future if you want to include FRB in the offical tap feel free to use the formula here.

fzyzcjy commented 1 week ago

It's quite weird:

brew install desdaemon/repo/flutter_rust_bridge_codegen
==> Fetching desdaemon/repo/flutter_rust_bridge_codegen
==> Downloading https://github.com/Desdaemon/homebrew-repo/releases/download/flutter_rust_bridge_codegen-1.81.0/flutter_rust_bridge_code
^C

It gives me 1.81.0 instead of 2.0.0... Does that command work for you? (Or maybe I get something wrong, some cache?) If it works for you then probably just cache issue, and I will reenable that (since I do not really need this on my device).

fzyzcjy commented 1 week ago

And could you please verify whether the scoop command works on your device? I do not have windows at hand, so I will trust your results :)

This one in quickstart:

scoop bucket add frb https://github.com/Desdaemon/scoop-repo
scoop install flutter_rust_bridge_codegen
Desdaemon commented 1 week ago

Probably a cache issue, users may have to run these steps to get it working again:

brew untap desdaemon/repo
brew update
brew tap desdaemon/repo
brew install flutter_rust_bridge_codegen

As for scoop, the steps mentioned in quickstart should still be working.

fzyzcjy commented 1 week ago

Looks great!

fzyzcjy commented 1 week ago

Hmm, the brew one seems to have some problem:

flutter_rust_bridge_codegen create hello
[2024-06-23T23:43:35.750Z INFO frb_codegen/src/library/commands/flutter.rs:13] Execute `flutter create hello` (this may take a while)
[2024-06-23T23:43:39.468Z INFO frb_codegen/src/library/integration/creator.rs:40] Step: Inject flutter_rust_bridge related code
Error: No such file or directory (os error 2)
fzyzcjy commented 1 week ago

Scoop also has some installation errors:

https://github.com/fzyzcjy/flutter_rust_bridge/actions/runs/9637303119/job/26576303255

Do you have some interest in debugging it? I guess it is related to scoop + github actions ci environment, or the commands I use.

> powershell -noprofile -command & scoop bucket add frb https://github.com/Desdaemon/scoop-repo (pwd: D:\a\flutter_rust_bridge\flutter_rust_bridge\, env: {CARGO_TERM_COLOR: always})
Checking repo... OK
The frb bucket was added successfully.
> powershell -noprofile -command & scoop install flutter_rust_bridge_codegen (pwd: D:\a\flutter_rust_bridge\flutter_rust_bridge\, env: {CARGO_TERM_COLOR: always})
Installing 'flutter_rust_bridge_codegen' (2.0.0) [64bit] from 'frb' bucket
Downloading https://github.com/fzyzcjy/flutter_rust_bridge/releases/download/v2.0.0/flutter_rust_bridge_codegen-x86_64-pc-windows-msvc-v2.0.0.zip (4.9 MB)...
Get-FileHash : The term 'Get-FileHash' is not recognized as the name of a cmdlet, function, script file, or operable 
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\runneradmin\scoop\apps\scoop\current\lib\install.ps1:679 char:16
+     $actual = (Get-FileHash -Path $file -Algorithm $algorithm).Hash.T ...
+                ~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-FileHash:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Checking hash of flutter_rust_bridge_codegen-x86_64-pc-windows-msvc-v2.0.0.zip ... ERROR Hash check failed!
App:         frb/flutter_rust_bridge_codegen
URL:         https://github.com/fzyzcjy/flutter_rust_bridge/releases/download/v2.0.0/flutter_rust_bridge_codegen-x86_64-pc-windows-msvc-v2.0.0.zip
First bytes: 50 4B 03 04 [14](https://github.com/fzyzcjy/flutter_rust_bridge/actions/runs/9637303119/job/26576303255#step:10:15) 00 00 00
Expected:    d0b28f8e69ff0f601a[15](https://github.com/fzyzcjy/flutter_rust_bridge/actions/runs/9637303119/job/26576303255#step:10:16)fe4b0136d2b4452dba8b63406e26042595683f9a13e8
Actual:      

Please try again or create a new issue by using the following link and paste your console output:
https://github.com/Desdaemon/scoop-repo/issues/new?title=flutter_rust_bridge_codegen%402.0.0%3a+hash+check+failed
Unhandled exception:
ProcessException: Bad exit code (1). If you want to see extra information, set FRB_DART_RUN_COMMAND_STDERR=1
  Command: powershell -noprofile -command & scoop install flutter_rust_bridge_codegen
#0      runCommand (package:flutter_rust_bridge/src/cli/run_command.dart:67:5)
<asynchronous suspension>
#1      SimpleExecutor.call (package:flutter_rust_bridge_internal/src/utils/makefile_dart_infra.dart:32:12)
<asynchronous suspension>
#2      quickstartStepInstall (package:flutter_rust_bridge_internal/src/makefile_dart/post_release.dart:53:7)
<asynchronous suspension>
#3      postReleaseMimicQuickstart (package:flutter_rust_bridge_internal/src/makefile_dart/post_release.dart:29:3)
<asynchronous suspension>
#4      SimpleConfigCommand.run (package:flutter_rust_bridge_internal/src/utils/makefile_dart_infra.dart:88:31)
<asynchronous suspension>
#5      CommandRunner.runCommand (package:args/command_runner.dart:[21](https://github.com/fzyzcjy/flutter_rust_bridge/actions/runs/9637303119/job/26576303255#step:10:22)2:13)
<asynchronous suspension>
#6      main (file:///D:/a/flutter_rust_bridge/flutter_rust_bridge/tools/frb_internal/bin/flutter_rust_bridge_internal.dart:30:3)
<asynchronous suspension>
Error: Process completed with exit code 1.
Desdaemon commented 1 week ago

The relevant error lines:

Get-FileHash : The term 'Get-FileHash' is not recognized as the name of a cmdlet, function, script file, or operable 
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\runneradmin\scoop\apps\scoop\current\lib\install.ps1:679 char:16
+     $actual = (Get-FileHash -Path $file -Algorithm $algorithm).Hash.T ...
+                ~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-FileHash:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

This could be either a configuration issue from Github Action's Powershell, or an issue from Scoop's side. Preliminary research points to -Path being the wrong option to use since it interprets arguments as regex patterns, and -LiteralPath should be used instead.

Regardless, this doesn't seem like a FRB issue so I'll try to test from my end as well, see if this affects end-users and if there is a resolution available.

Desdaemon commented 1 week ago

This comment seems particularly relevant to this issue:

If you invoke powershell.exe from PowerShell Core, the problem is the presence of the Core standard module path in $env:PSModulePath before the Windows PowerShell standard module path, which causes Windows Powershell not to find Get-FileHash.

Why this is the case on Github Actions runners is unclear, but a normal scoop install does indeed work on my local Windows machine.

fzyzcjy commented 1 week ago

Totally agree, this looks like related to github actions runner or scoop (and maybe a portion of users who are using the same env as runner)

Desdaemon commented 1 week ago

Scoop GH Actions testing blocked on https://github.com/PowerShell/PowerShell/issues/18108, workaround available in that issue as well.

Desdaemon commented 1 week ago

Hmm, the brew one seems to have some problem:

flutter_rust_bridge_codegen create hello
[2024-06-23T23:43:35.750Z INFO frb_codegen/src/library/commands/flutter.rs:13] Execute `flutter create hello` (this may take a while)
[2024-06-23T23:43:39.468Z INFO frb_codegen/src/library/integration/creator.rs:40] Step: Inject flutter_rust_bridge related code
Error: No such file or directory (os error 2)

If need be, we could modify the formula's test script to actually take into account functionality OOTB. My first thoughts would be whether FRB's dependencies are properly installed, and if not that could be added to the formula.

fzyzcjy commented 1 week ago

If need be, we could modify the formula's test script to actually take into account functionality OOTB.

That looks great!

My first thoughts would be whether FRB's dependencies are properly installed, and if not that could be added to the formula.

Looks reasonable, maybe check debug log and backtraces may help

Desdaemon commented 1 week ago

Off-topic but FRB does have a penchant of digging up bugs/deficiencies in codebases totally external to itself, and it's surprising that it's continuing to do so after so long.