Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
9c588f32
Unverified
Commit
9c588f32
authored
Sep 20, 2022
by
jensjoha
Committed by
GitHub
Sep 20, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix flutter tool crash on upgrade caused by app-jit (#111879)
Fix flutter tool crash on upgrade caused by app-jit
parent
4bc714fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
shared.bat
bin/internal/shared.bat
+19
-0
shared.sh
bin/internal/shared.sh
+13
-0
No files found.
bin/internal/shared.bat
View file @
9c588f32
...
...
@@ -16,6 +16,7 @@ SETLOCAL
SET flutter_tools_dir=%FLUTTER_ROOT%\packages\flutter_tools
SET cache_dir=%FLUTTER_ROOT%\bin\cache
SET snapshot_path=%cache_dir%\flutter_tools.snapshot
SET snapshot_path_old=%cache_dir%\flutter_tools.snapshot.old
SET stamp_path=%cache_dir%\flutter_tools.stamp
SET script_path=%flutter_tools_dir%\bin\flutter_tools.dart
SET dart_sdk_path=%cache_dir%\dart-sdk
...
...
@@ -170,6 +171,21 @@ GOTO :after_subroutine
POPD
REM Move the old snapshot - we can't just overwrite it as the VM might currently have it
REM memory mapped (e.g. on flutter upgrade), and deleting it might not work if the file
REM is in use. For downloading a new dart sdk the folder is moved, so we take the same
REM approach of moving the file here.
SET /A snapshot_path_suffix=1
:move_old_snapshot
IF EXIST "%snapshot_path_old%%snapshot_path_suffix%" (
SET /A snapshot_path_suffix+=1
GOTO move_old_snapshot
) ELSE (
IF EXIST "%snapshot_path%" (
MOVE "%snapshot_path%" "%snapshot_path_old%%snapshot_path_suffix%" 2> NUL > NUL
)
)
IF "%FLUTTER_TOOL_ARGS%" == "" (
"%dart%" --verbosity=error --snapshot="%snapshot_path%" --snapshot-kind="app-jit" --packages="%flutter_tools_dir%\.dart_tool\package_config.json" --no-enable-mirrors "%script_path%" > NUL
) else (
...
...
@@ -182,6 +198,9 @@ GOTO :after_subroutine
)
>"%stamp_path%" ECHO %compilekey%
REM Try to delete any old snapshots now. Swallow any errors though.
DEL "%snapshot_path%.old*" 2> NUL > NUL
REM Exit Subroutine
EXIT /B
...
...
bin/internal/shared.sh
View file @
9c588f32
...
...
@@ -154,9 +154,22 @@ function upgrade_flutter () (
fi
pub_upgrade_with_retry
# Move the old snapshot - we can't just overwrite it as the VM might currently have it
# memory mapped (e.g. on flutter upgrade). For downloading a new dart sdk the folder is moved,
# so we take the same approach of moving the file here.
SNAPSHOT_PATH_OLD
=
"
$SNAPSHOT_PATH
.old"
if
[
-f
"
$SNAPSHOT_PATH
"
]
;
then
mv
"
$SNAPSHOT_PATH
"
"
$SNAPSHOT_PATH_OLD
"
fi
# Compile...
"
$DART
"
--verbosity
=
error
--disable-dart-dev
$FLUTTER_TOOL_ARGS
--snapshot
=
"
$SNAPSHOT_PATH
"
--snapshot-kind
=
"app-jit"
--packages
=
"
$FLUTTER_TOOLS_DIR
/.dart_tool/package_config.json"
--no-enable-mirrors
"
$SCRIPT_PATH
"
>
/dev/null
echo
"
$compilekey
"
>
"
$STAMP_PATH
"
# Delete any temporary snapshot path.
if
[
-f
"
$SNAPSHOT_PATH_OLD
"
]
;
then
rm
-f
"
$SNAPSHOT_PATH_OLD
"
fi
fi
# The exit here is extraneous since the function is run in a subshell, but
# this serves as documentation that running the function in a subshell is
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment