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
9c73e91f
Unverified
Commit
9c73e91f
authored
Dec 09, 2021
by
Ian Hickson
Committed by
GitHub
Dec 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more detail to error messages (#94820)
parent
be0e3886
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
os.dart
packages/flutter_tools/lib/src/base/os.dart
+14
-10
No files found.
packages/flutter_tools/lib/src/base/os.dart
View file @
9c73e91f
...
@@ -184,20 +184,22 @@ class _PosixUtils extends OperatingSystemUtils {
...
@@ -184,20 +184,22 @@ class _PosixUtils extends OperatingSystemUtils {
@override
@override
void
chmod
(
FileSystemEntity
entity
,
String
mode
)
{
void
chmod
(
FileSystemEntity
entity
,
String
mode
)
{
// Errors here are silently ignored (except when tracing).
try
{
try
{
final
ProcessResult
result
=
_processManager
.
runSync
(
final
ProcessResult
result
=
_processManager
.
runSync
(
<
String
>[
'chmod'
,
mode
,
entity
.
path
],
<
String
>[
'chmod'
,
mode
,
entity
.
path
],
);
);
if
(
result
.
exitCode
!=
0
)
{
if
(
result
.
exitCode
!=
0
)
{
_logger
.
printTrace
(
_logger
.
printTrace
(
'Error trying to run chmod on
${entity.absolute.path}
'
'Error trying to run "chmod
$mode
${entity.path}
":
\n
'
'
\n
stdout:
${result.stdout}
'
' exit code:
${result.exitCode}
\n
'
'
\n
stderr:
${result.stderr}
'
,
' stdout:
${result.stdout.toString().trimRight()}
\n
'
' stderr:
${result.stderr.toString().trimRight()}
'
);
);
}
}
}
on
ProcessException
catch
(
error
)
{
}
on
ProcessException
catch
(
error
)
{
_logger
.
printTrace
(
_logger
.
printTrace
(
'Error trying to run
chmod on
${entity.absolute.path}
:
$error
'
,
'Error trying to run
"chmod
$mode
${entity.path}
"
:
$error
'
,
);
);
}
}
}
}
...
@@ -268,20 +270,22 @@ class _PosixUtils extends OperatingSystemUtils {
...
@@ -268,20 +270,22 @@ class _PosixUtils extends OperatingSystemUtils {
@override
@override
HostPlatform
get
hostPlatform
{
HostPlatform
get
hostPlatform
{
if
(
_hostPlatform
==
null
)
{
if
(
_hostPlatform
==
null
)
{
final
RunResult
hostPlatformCheck
=
final
RunResult
hostPlatformCheck
=
_processUtils
.
runSync
(<
String
>[
'uname'
,
'-m'
]);
_processUtils
.
runSync
(<
String
>[
'uname'
,
'-m'
]);
// On x64 stdout is "uname -m: x86_64"
// On x64 stdout is "uname -m: x86_64"
// On arm64 stdout is "uname -m: aarch64, arm64_v8a"
// On arm64 stdout is "uname -m: aarch64, arm64_v8a"
if
(
hostPlatformCheck
.
exitCode
!=
0
)
{
if
(
hostPlatformCheck
.
exitCode
!=
0
)
{
_hostPlatform
=
HostPlatform
.
linux_x64
;
_logger
.
printError
(
_logger
.
printError
(
'Error trying to run uname -m'
'Encountered an error trying to run "uname -m":
\n
'
'
\n
stdout:
${hostPlatformCheck.stdout}
'
' exit code:
${hostPlatformCheck.exitCode}
\n
'
'
\n
stderr:
${hostPlatformCheck.stderr}
'
,
' stdout:
${hostPlatformCheck.stdout.trimRight()}
\n
'
' stderr:
${hostPlatformCheck.stderr.trimRight()}
\n
'
'Assuming host platform is
${getNameForHostPlatform(_hostPlatform!)}
.'
,
);
);
_hostPlatform
=
HostPlatform
.
linux_x64
;
}
else
if
(
hostPlatformCheck
.
stdout
.
trim
().
endsWith
(
'x86_64'
))
{
}
else
if
(
hostPlatformCheck
.
stdout
.
trim
().
endsWith
(
'x86_64'
))
{
_hostPlatform
=
HostPlatform
.
linux_x64
;
_hostPlatform
=
HostPlatform
.
linux_x64
;
}
else
{
}
else
{
// We default to ARM if it's not x86_64 and we did not get an error.
_hostPlatform
=
HostPlatform
.
linux_arm64
;
_hostPlatform
=
HostPlatform
.
linux_arm64
;
}
}
}
}
...
...
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