https://toitlang.org/ logo
Request for help:
# general
f
Request for help: I'm trying to add Toit to winget. However, I currently don't have access to a Windows machine (except through Windows GitHub builders, which makes things a bit cumbersome and non-standard). I already started the manifests, but there is one bullet that didn't work for me (on the builder):
winget install --manifest <path>
Could someone with Windows maybe help me get the PR ready? I think the following instructions would run the requested check:
Copy code
git clone --depth=1 --branch Toit.Toit-2.0.0-alpha.180-38F01918 https://github.com/LeonGungadinMogensen/winget-pkgs.git
winget install --manifest winget-pkgs/manifests/t/Toit/Toit/2.0.0-alpha.180
a
Cloning now
looks like a rather large repo 😄
f
It is. I tried to reduce it with
--depth=1
, but it's still huge.
every known winget package (and every version of it) is in there.
a
i had no idea that is how the winget packages are managed
f
makes me wonder how the Toit package repo should avoid a similar fate. Maybe two branches. One that only contains versions that are less than 1 year old (unless it's the latest), and one that has the rest.
For now we don't have any size issues, though 🙂
a
hmm, i could probably do a spare checkout
f
I could also just send you the files.
It really only needs the 4 files in the directory.
sparse checkout seems to be the way to go.
no... even that takes a huge amount of time.
a
Copy code
git clone --depth=1 --filter=blob:none --sparse --branch Toit.Toit-2.0.0-alpha.180-38F01918 https://github.com/LeonGungadinMogensen/winget-pkgs.git
cd winget-pkgs
git sparse-checkout set manifests/t/Toit
f
let me just download the files for you.
a
i have the files now 🙂
f
good 🙂
f
annoying, but the app is signed.
a
😄
winget output is this
Copy code
C:\Users\adam\dev\github\LeonGungadinMogensen>winget install --manifest winget-pkgs/manifests/t/Toit/Toit/2.0.0-alpha.180
Found Toit SDK [Toit.Toit] Version 2.0.0-alpha.180
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Successfully verified installer hash
Starting package install...
An unexpected error occurred while executing the command:
0x800704c7 : The operation was canceled by the user.
I should be able to get around it though
f
I wonder what MS thinks about this. In theory a winget-operation should be without interaction.
However, manifest files are frequently written for apps that aren't yet recognized.
> Applications that are signed with a standard code signing certificates need to have a positive reputation in order to pass the Smart Screen filter. Microsoft establishes the reputation of an executable based upon the number of installations world wide of the same application. Since you haven't published your application as yet (and therefore the reputation hasn't been established as yet), the Smart Screen will continue to flag the application.
(an answer to a stack-overflow question).
I will just check the box in the PR. If you disable the defender the manifest should work.
a
yeah, annyingly my normal go to of using this checkbox on the file doenst work, I think as it redownloads it every time... https://cdn.discordapp.com/attachments/1374000426482929757/1374005601927041124/image.png?ex=682c79ef&is=682b286f&hm=f3459be37f680786ef487f54f119d414b831cb81dcdea1fdb98699f38384ca90&
f
I'm not going to buy an EV (extended validation) code signing certificate.
yeah. Very likely.
Good question of how to get around that...
I wonder if we have the same issue with Jaguar.
Maybe that one has been installed often enough.
a
And on this device, unchecking this tickbox which turns it off on the whole is hard 😛 The option is deep deep deep in some other device management software https://cdn.discordapp.com/attachments/1374000426482929757/1374005900976717834/image.png?ex=682c7a36&is=682b28b6&hm=4e968bac83d378a56413b248e91f76698c98b0b48046854dfecd59a8781dd562&
f
I think there is not much I can do, but at least the manifest looks correct. So I will go ahead there.
Still pretty annoying.
so I imagine the whole process overall would work
f
@addshore The PR was merged. Could you see if it's now possible to install Toit with winget? Should be as simple as
winget install --id=Toit.Toit -e
Successfully installed
Copy code
C:\Users\adam>jag version
Version:         v1.47.0
SDK version:     v2.0.0-alpha.174
Build date:      2024-12-10T10:55:47Z
hehe, think my already installed jag got in the way
k
How about
toit version
?
a
oh, i installed
toit
, good job im looking at the commands Im running
Copy code
C:\Users\adam>toit version
v2.0.0-alpha.180
C:\Users\adam>where toit
C:\Users\adam\AppData\Local\Programs\toit\bin\toit.exe
looks good
k
Don't try
format c:
.
a
despite running windows, i mainly live in linux land via WSL, so all ths cmd.exe stuff always throws me off
k
How is WSL treating you?
I'm considering giving it a try to see how much it has improved over the years.
a
Good, its got much better through the years, with WSL2. Summary at https://addshore.com/2021/10/developing-on-windows-the-wsl-life/ from a little while back I should really write an update 😛
I make use of this https://gitlab.com/alelec/wsl-usb-gui for usb passthrough from windows to linux, so generally I run jag and toit in linux land
one pain point for that actually is that the ESP constantly restarting if it has no FW on it means that your unlikely to be able to flash it for the first time from linux land, so i do a first flash from windows before then doing passthrough
I potentially also experienced some odd hangs form
jag monitor
potentially due to this passthrough where
ctrl + c
doesnt quit out for multiple seconds or minuites, but not spent any time debugging that yet
k
Thanks!
a
if you every have any wsl quesiton just ask. One thing I would say is you want to run WSL2 on Windows 11, any other comobo sure seems to have some issues
at some point there were even mac containre images you could run in linux land, making use of the graphics part of WSL to give you a full mac desktop too 😛
and in other nice news, they just open sourced WSL in the past weeks or so
f
I saw that. Pretty nice.
a
this talk of WSL in a toit context reminds me that one of my most popular blog posts is actually about installing android studio on WSL2 for use with Flutter. oddly apt given you worked on dart 😛