PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

Self-contained .NET

Open stefansjfw opened this issue 3 years ago • 4 comments

Summary of the Pull Request

  • Make all C# project self-contained
  • Add .NET libs to the installer and custom actions to create hard-links for these libs where needed
  • Rework preview handlers and thumbnail providers - add c++ preview handlers and thumbnail providers which spawn C# processes and do the same logic as original C# preview handlers and thumbnail providers

TODO:

  • ~cleanup files (only C# *Control files are needed, *Handler ones are not (like MonacoPreviewHandler.cs), delete them)~ DONE
  • ~prefix new dll names with PowerToys.~ DONE
  • ~add to signing list~ DONE
  • ~Add new processes to kill list~ DONE
  • ~add dll info (.rc files)~ DONE
  • ~Installer bug? Uninstall fails~ DONE
  • ~Publish everything for dotnet self-contained ?~ Not needed. As dotnet libs are picked up from settings build, only settings needs to be published and it already is.
  • ~Update src/module/previewpane/README.md~ DONE
  • ~Use MSBuild -t:restore -p:RestorePackagesConfig=true /p:Platform=<platform> for PowerToys.sln (only) in CI instead of nuget restore . With nuget <RuntimeIdentifier> property causes build faliures because nuget assumes AnyCPU as platform~ DONE
  • dotnet self-contained for arm64 - build is passing, testing needed
  • Improvement: How to initialize IThumbnailProvider with IInitializeWithFile

PR Checklist

  • [ ] Closes: #xxx
  • [ ] Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • [ ] Tests: Added/updated and all pass
  • [ ] Localization: All end user facing strings can be localized
  • [ ] Dev docs: Added/updated
  • [ ] New binaries: Added on the required places
  • [ ] Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

stefansjfw avatar Nov 21 '22 19:11 stefansjfw

I wonder if Monaco can load faster like this

noraa-junker avatar Nov 22 '22 10:11 noraa-junker

I wonder if Monaco can load faster like this

Doubt. It'll probably be a bit slower

stefansjfw avatar Nov 22 '22 12:11 stefansjfw

I wonder if Monaco can load faster like this

Doubt. It'll probably be a bit slower

😕. Well as far as I remember the standalone Application of Monaco was alot faster then in the preview pane, because it has some less restrictions. Maybe in the end the performance will stay the same.

noraa-junker avatar Nov 22 '22 13:11 noraa-junker

@check-spelling-bot Report

:red_circle: Please review

See the :open_file_folder: files view or the :scroll:action log for details.

Unrecognized words (40)
applicationconfiguration
asd
Asn
Brotli
cht
clrcompression
clretwrc
clrgc
clrjit
Cng
coreclr
dbgshim
DCompiler
deu
enu
esn
hostfxr
hostpolicy
Imc
Intrinsics
IPREVIEW
jpn
LOADFROMFILE
LOGFONTW
markdownpreviewhandler
MARKDOWNPREVIEWHANDLERCPP
mfcm
mscordaccore
mscordbi
mscorrc
msquic
netstandard
Pkcs
Quic
rus
Ssl
sss
thumbcache
Unk
wpfgfx
Previously acknowledged words that are now absent brucelindbloom chromaticities CHT comhost companding cxxopts cziplob DEU ENU Eqn ffaa iobjectwithsitesetsite iolewindowcontextsensitivehelp ipreview ipreviewhandlertranslateaccelerator JPN keystokes RUS Setrect unk windowsdesktop :arrow_right:
To accept :heavy_check_mark: these unrecognized words as correct and remove the previously acknowledged and now absent words, run the following commands

... in a clone of the [email protected]:microsoft/PowerToys.git repository on the stefa/test_sc branch (:information_source: how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/v0.0.21/apply.pl' |
perl - 'https://github.com/microsoft/PowerToys/actions/runs/3638539936/attempts/1'
Available :books: dictionaries could cover words not in the :blue_book: dictionary

This includes both expected items (2141) from .github/actions/spell-check/expect.txt and unrecognized words (40)

Dictionary Entries Covers
cspell:cpp/src/cpp.txt 30216 122
cspell:win32/src/win32.txt 53509 117
cspell:python/src/python/python-lib.txt 3873 31
cspell:php/php.txt 2597 16
cspell:node/node.txt 1768 14
cspell:typescript/typescript.txt 1211 12
cspell:python/src/python/python.txt 453 10
cspell:java/java.txt 7642 10
cspell:aws/aws.txt 218 8
cspell:r/src/r.txt 808 7

Consider adding them using (in .github/workflows/spelling2.yml):

      with:
        extra_dictionaries:
          cspell:cpp/src/cpp.txt
          cspell:win32/src/win32.txt
          cspell:python/src/python/python-lib.txt
          cspell:php/php.txt
          cspell:node/node.txt
          cspell:typescript/typescript.txt
          cspell:python/src/python/python.txt
          cspell:java/java.txt
          cspell:aws/aws.txt
          cspell:r/src/r.txt

To stop checking additional dictionaries, add:

      with:
        check_extra_dictionaries: ''
If the flagged items are :exploding_head: 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.

github-actions[bot] avatar Dec 07 '22 11:12 github-actions[bot]

I've just given this a test. Everything seems to be working well, except for SVG preview and Thumbnail providers

jaimecbernardo avatar Dec 12 '22 11:12 jaimecbernardo

Great work! Huge changes here!

jaimecbernardo avatar Dec 12 '22 11:12 jaimecbernardo

Any specific codeblock you might want me to look more closely at?

Most of the changes are pretty much generic so thorough testing should be enough

stefansjfw avatar Dec 12 '22 12:12 stefansjfw

/azp run

stefansjfw avatar Dec 14 '22 11:12 stefansjfw

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Dec 14 '22 11:12 azure-pipelines[bot]