flet icon indicating copy to clipboard operation
flet copied to clipboard

flet build fails since version 0.23.0

Open Houqua3D opened this issue 8 months ago • 1 comments

Duplicate Check

  • [X] I have searched the opened issues and there are no duplicates

Describe the bug

I have a CI/CD build pipeline (which automatically uses the newest flet version for dev builds) and since version 0.23.0 was released the pipeline stopped working. When the pipeline calls flet build windows the following error occurs:

2024-06-20T00:15:25.1011547Z [00:15:25] Flutter bootstrap directory:                                        
2024-06-20T00:15:25.1012321Z            C:\Users\VSSADM~1\AppData\Local\Temp\flet_flutter_build_inECDt8rB4  
2024-06-20T00:15:25.1036317Z            Additional Flutter dependencies:                                    
2024-06-20T00:15:25.1036814Z            {}                                                                  
2024-06-20T00:15:27.3498979Z [00:15:27] Created Flutter bootstrap project from                              
2024-06-20T00:15:27.3506365Z            gh:flet-dev/flet-build-template with ref 0.23.0[00:15:27] Created Flutter bootstrap project from                              
2024-06-20T00:15:27.3508356Z Traceback (most recent call last):
2024-06-20T00:15:27.3509164Z   File "C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\flet\cli\commands\build.py", line 462, in handle
2024-06-20T00:15:27.3517242Z     console.log(
2024-06-20T00:15:27.3519586Z   File "C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\rich\console.py", line 1941, in log
2024-06-20T00:15:27.3526006Z     with self:
2024-06-20T00:15:27.3526692Z   File "C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\rich\console.py", line 865, in __exit__
2024-06-20T00:15:27.3528840Z     self._exit_buffer()
2024-06-20T00:15:27.3529418Z   File "C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\rich\console.py", line 823, in _exit_buffer
2024-06-20T00:15:27.3532403Z     self._check_buffer()
2024-06-20T00:15:27.3532975Z   File "C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\rich\console.py", line 2027, in _check_buffer
2024-06-20T00:15:27.3538843Z     legacy_windows_render(buffer, LegacyWindowsTerm(self.file))
2024-06-20T00:15:27.3539543Z   File "C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\rich\_windows_renderer.py", line 17, in legacy_windows_render
2024-06-20T00:15:27.3540074Z     term.write_styled(text, style)
2024-06-20T00:15:27.3540742Z   File "C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\rich\_win32_console.py", line 442, in write_styled
2024-06-20T00:15:27.3543730Z     self.write_text(text)
2024-06-20T00:15:27.3544277Z   File "C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\rich\_win32_console.py", line 403, in write_text
2024-06-20T00:15:27.3546194Z     self.write(text)
2024-06-20T00:15:27.3546527Z   File "C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\encodings\cp1252.py", line 19, in encode
2024-06-20T00:15:27.3948005Z     return codecs.charmap_encode(input,self.errors,encoding_table)[0]
2024-06-20T00:15:27.3949612Z            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-06-20T00:15:27.3954099Z UnicodeEncodeError: 'charmap' codec can't encode character '\u2705' in position 1: character maps to <undefined>
2024-06-20T00:15:27.3954285Z 
2024-06-20T00:15:27.3954442Z During handling of the above exception, another exception occurred:
2024-06-20T00:15:27.3954565Z 
2024-06-20T00:15:27.3954679Z Traceback (most recent call last):
2024-06-20T00:15:27.3954835Z   File "<frozen runpy>", line 198, in _run_module_as_main
2024-06-20T00:15:27.3955011Z   File "<frozen runpy>", line 88, in _run_code
2024-06-20T00:15:27.3955326Z   File "C:\hostedtoolcache\windows\Python\3.11.9\x64\Scripts\flet.exe\__main__.py", line 7, in <module>
2024-06-20T00:15:27.3955834Z   File "C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\flet\cli\cli.py", line 88, in main
2024-06-20T00:15:27.3957998Z     args.handler(args)
2024-06-20T00:15:27.3958755Z   File "C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\flet\cli\commands\build.py", line 335, in handle
2024-06-20T00:15:27.3960986Z     with console.status(
2024-06-20T00:15:27.3963764Z   File "C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\rich\status.py", line 106, in __exit__
2024-06-20T00:15:27.3964567Z     self.stop()
2024-06-20T00:15:27.3965108Z   File "C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\rich\status.py", line 91, in stop
2024-06-20T00:15:27.3965470Z     self._live.stop()
2024-06-20T00:15:27.3967120Z   File "C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\rich\live.py", line 147, in stop
2024-06-20T00:15:27.3967951Z     with self.console:
2024-06-20T00:15:27.3968437Z   File "C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\rich\console.py", line 865, in __exit__
2024-06-20T00:15:27.3971578Z     self._exit_buffer()
2024-06-20T00:15:27.3972183Z   File "C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\rich\console.py", line 823, in _exit_buffer
2024-06-20T00:15:27.3974883Z     self._check_buffer()
2024-06-20T00:15:27.3975439Z   File "C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\rich\console.py", line 2027, in _check_buffer
2024-06-20T00:15:27.3981967Z     legacy_windows_render(buffer, LegacyWindowsTerm(self.file))
2024-06-20T00:15:27.3982698Z   File "C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\rich\_windows_renderer.py", line 17, in legacy_windows_render
2024-06-20T00:15:27.3983129Z     term.write_styled(text, style)
2024-06-20T00:15:27.3983684Z   File "C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\rich\_win32_console.py", line 442, in write_styled
2024-06-20T00:15:27.3986235Z     self.write_text(text)
2024-06-20T00:15:27.3986823Z   File "C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\rich\_win32_console.py", line 403, in write_text
2024-06-20T00:15:27.3989101Z     self.write(text)
2024-06-20T00:15:27.3989467Z   File "C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\encodings\cp1252.py", line 19, in encode
2024-06-20T00:15:27.3990770Z     return codecs.charmap_encode(input,self.errors,encoding_table)[0]
2024-06-20T00:15:27.3991408Z            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-06-20T00:15:27.3991898Z UnicodeEncodeError: 'charmap' codec can't encode character '\u2705' in position 1: character maps to <undefined>

The build finishes successfully with earlier flet versions. EDIT Info: also tested bugfix version 0.23.1. It does not resolve this error.

Code

No response

To reproduce

Azure agents pipeline with the following agent configuration:

Agent name: 'Hosted Agent'
Agent machine name: 'fv-az621-36'
Current agent version: '3.240.1'
Operating System
Microsoft Windows Server 2022
10.0.20348
Datacenter
Runner Image
Image: windows-2022
Version: 20240610.1.0
Included Software: https://github.com/actions/runner-images/blob/win22/20240610.1/images/windows/Windows2022-Readme.md
Image Release: https://github.com/actions/runner-images/releases/tag/win22%2F20240610.1

Pipeline:

stages:
- stage: Build_Stage
  displayName: 'Build'
  
  jobs:
  # Windows Build
  - job: 'Windows'
    displayName: 'Windows Application'
    pool:
      vmImage: windows-latest

    steps:
    - task: FlutterInstall@0
      inputs:
        mode: 'auto'
        channel: 'stable'
        version: 'latest'
      displayName: 'Install Flutter SDK'
    
    - task: UsePythonVersion@0
      inputs:
        versionSpec: '3.11'
        addToPath: true
        architecture: 'x64'
      displayName: 'Select Python 3.11'

    - script: |
        python -m pip install --upgrade pip
        python -m pip install flet
        flet build -v --org $(ORG_NAME) --company $(COMPANY_NAME) --build-number $(Build.BuildId) --build-version $(MAJOR).$(MINOR).$(BUGFIX) windows
      displayName: 'Build Application'

Flutter version == 3.22.2 Dart version == 3.4.3

While executing flet build windows the above-described error occurs.

When changing the line python -m pip install flet to python -m pip install flet==0.22.* it finishes the build successfully.

Expected behavior

No response

Screenshots

No response

Operating System

Windows

Operating system details

Microsoft Windows Server 2022 10.0.20348

Flet version

0.23.0

Regression

Yes, it used to work in a previous Flet version (please specify the version in additional details)

Suggestions

No response

Additional details

No response

Houqua3D avatar Jun 20 '24 06:06 Houqua3D