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
343577af
Unverified
Commit
343577af
authored
Nov 16, 2020
by
Marcus Tomlinson
Committed by
GitHub
Nov 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add liblzma as an explicit dependancy on Linux (#70617)
parent
b84fb904
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
1 deletion
+48
-1
user_messages.dart
packages/flutter_tools/lib/src/base/user_messages.dart
+2
-0
linux_doctor.dart
packages/flutter_tools/lib/src/linux/linux_doctor.dart
+4
-0
CMakeLists.txt
...ter_tools/templates/app/linux.tmpl/flutter/CMakeLists.txt
+2
-0
linux_doctor_test.dart
...ter_tools/test/general.shard/linux/linux_doctor_test.dart
+40
-1
No files found.
packages/flutter_tools/lib/src/base/user_messages.dart
View file @
343577af
...
...
@@ -237,6 +237,8 @@ class UserMessages {
'They are likely available from your distribution (e.g.: apt install libgtk-3-dev)'
;
String
get
blkidLibraryMissing
=>
'The blkid development library is required for Linux development.
\n
'
'It is likely available from your distribution (e.g.: apt install libblkid-dev)'
;
String
get
lzmaLibraryMissing
=>
'The lzma development library is required for Linux development.
\n
'
'It is likely available from your distribution (e.g.: apt install liblzma-dev)'
;
// Messages used in FlutterCommand
String
flutterElapsedTime
(
String
name
,
String
elapsedTime
)
=>
'"flutter
$name
" took
$elapsedTime
.'
;
...
...
packages/flutter_tools/lib/src/linux/linux_doctor.dart
View file @
343577af
...
...
@@ -153,6 +153,10 @@ class LinuxDoctorValidator extends DoctorValidator {
validationType
=
ValidationType
.
missing
;
messages
.
add
(
ValidationMessage
.
error
(
_userMessages
.
blkidLibraryMissing
));
}
if
(!
await
_libraryIsPresent
(
'liblzma'
))
{
validationType
=
ValidationType
.
missing
;
messages
.
add
(
ValidationMessage
.
error
(
_userMessages
.
lzmaLibraryMissing
));
}
return
ValidationResult
(
validationType
,
messages
);
}
...
...
packages/flutter_tools/templates/app/linux.tmpl/flutter/CMakeLists.txt
View file @
343577af
...
...
@@ -25,6 +25,7 @@ pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
pkg_check_modules
(
GLIB REQUIRED IMPORTED_TARGET glib-2.0
)
pkg_check_modules
(
GIO REQUIRED IMPORTED_TARGET gio-2.0
)
pkg_check_modules
(
BLKID REQUIRED IMPORTED_TARGET blkid
)
pkg_check_modules
(
LZMA REQUIRED IMPORTED_TARGET liblzma
)
set
(
FLUTTER_LIBRARY
"
${
EPHEMERAL_DIR
}
/libflutter_linux_gtk.so"
)
...
...
@@ -67,6 +68,7 @@ target_link_libraries(flutter INTERFACE
PkgConfig::GLIB
PkgConfig::GIO
PkgConfig::BLKID
PkgConfig::LZMA
)
add_dependencies
(
flutter flutter_assemble
)
...
...
packages/flutter_tools/test/general.shard/linux/linux_doctor_test.dart
View file @
343577af
...
...
@@ -100,6 +100,7 @@ void main() {
_pkgConfigPresentCommand
(
'0.29'
),
...
_gtkLibrariesPresentCommands
(),
_libraryCheckCommand
(
'blkid'
),
_libraryCheckCommand
(
'liblzma'
),
]);
final
DoctorValidator
linuxDoctorValidator
=
LinuxDoctorValidator
(
processManager:
processManager
,
...
...
@@ -124,6 +125,7 @@ void main() {
_pkgConfigPresentCommand
(
'0.29'
),
...
_gtkLibrariesPresentCommands
(),
_libraryCheckCommand
(
'blkid'
),
_libraryCheckCommand
(
'liblzma'
),
]);
final
DoctorValidator
linuxDoctorValidator
=
LinuxDoctorValidator
(
processManager:
processManager
,
...
...
@@ -149,6 +151,7 @@ void main() {
_pkgConfigPresentCommand
(
'0.29'
),
...
_gtkLibrariesPresentCommands
(),
_libraryCheckCommand
(
'blkid'
),
_libraryCheckCommand
(
'liblzma'
),
]);
final
DoctorValidator
linuxDoctorValidator
=
LinuxDoctorValidator
(
processManager:
processManager
,
...
...
@@ -174,6 +177,7 @@ void main() {
_pkgConfigPresentCommand
(
'0.29'
),
...
_gtkLibrariesPresentCommands
(),
_libraryCheckCommand
(
'blkid'
),
_libraryCheckCommand
(
'liblzma'
),
]);
final
DoctorValidator
linuxDoctorValidator
=
LinuxDoctorValidator
(
processManager:
processManager
,
...
...
@@ -199,6 +203,7 @@ void main() {
_pkgConfigPresentCommand
(
'0.27.0'
),
...
_gtkLibrariesPresentCommands
(),
_libraryCheckCommand
(
'blkid'
),
_libraryCheckCommand
(
'liblzma'
),
]);
final
DoctorValidator
linuxDoctorValidator
=
LinuxDoctorValidator
(
processManager:
processManager
,
...
...
@@ -224,6 +229,7 @@ void main() {
_pkgConfigPresentCommand
(
'0.29'
),
...
_gtkLibrariesPresentCommands
(),
_libraryCheckCommand
(
'blkid'
),
_libraryCheckCommand
(
'liblzma'
),
]);
final
UserMessages
userMessages
=
UserMessages
();
final
DoctorValidator
linuxDoctorValidator
=
LinuxDoctorValidator
(
...
...
@@ -249,6 +255,7 @@ void main() {
_pkgConfigPresentCommand
(
'0.29'
),
...
_gtkLibrariesPresentCommands
(),
_libraryCheckCommand
(
'blkid'
),
_libraryCheckCommand
(
'liblzma'
),
]);
final
UserMessages
userMessages
=
UserMessages
();
final
DoctorValidator
linuxDoctorValidator
=
LinuxDoctorValidator
(
...
...
@@ -274,6 +281,7 @@ void main() {
_pkgConfigPresentCommand
(
'0.29'
),
...
_gtkLibrariesPresentCommands
(),
_libraryCheckCommand
(
'blkid'
),
_libraryCheckCommand
(
'liblzma'
),
]);
final
UserMessages
userMessages
=
UserMessages
();
final
DoctorValidator
linuxDoctorValidator
=
LinuxDoctorValidator
(
...
...
@@ -299,6 +307,7 @@ void main() {
_missingBinaryCommand
(
'pkg-config'
),
...
_gtkLibrariesPresentCommands
(),
_libraryCheckCommand
(
'blkid'
),
_libraryCheckCommand
(
'liblzma'
),
]);
final
UserMessages
userMessages
=
UserMessages
();
final
DoctorValidator
linuxDoctorValidator
=
LinuxDoctorValidator
(
...
...
@@ -324,6 +333,7 @@ void main() {
_pkgConfigPresentCommand
(
'0.29'
),
...
_gtkLibrariesMissingCommands
(),
_libraryCheckCommand
(
'blkid'
),
_libraryCheckCommand
(
'liblzma'
),
]);
final
UserMessages
userMessages
=
UserMessages
();
final
DoctorValidator
linuxDoctorValidator
=
LinuxDoctorValidator
(
...
...
@@ -342,7 +352,7 @@ void main() {
]);
});
testWithoutContext
(
'Missing validation when
libraries are
not available'
,
()
async
{
testWithoutContext
(
'Missing validation when
blkid is
not available'
,
()
async
{
final
ProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
_clangPresentCommand
(
'4.0.1'
),
_cmakePresentCommand
(
'3.16.3'
),
...
...
@@ -350,6 +360,7 @@ void main() {
_pkgConfigPresentCommand
(
'0.29'
),
...
_gtkLibrariesPresentCommands
(),
_libraryCheckCommand
(
'blkid'
,
exists:
false
),
_libraryCheckCommand
(
'liblzma'
),
]);
final
UserMessages
userMessages
=
UserMessages
();
final
DoctorValidator
linuxDoctorValidator
=
LinuxDoctorValidator
(
...
...
@@ -368,6 +379,33 @@ void main() {
]);
});
testWithoutContext
(
'Missing validation when liblzma is not available'
,
()
async
{
final
ProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
_clangPresentCommand
(
'4.0.1'
),
_cmakePresentCommand
(
'3.16.3'
),
_ninjaPresentCommand
(
'1.10.0'
),
_pkgConfigPresentCommand
(
'0.29'
),
...
_gtkLibrariesPresentCommands
(),
_libraryCheckCommand
(
'blkid'
),
_libraryCheckCommand
(
'liblzma'
,
exists:
false
),
]);
final
UserMessages
userMessages
=
UserMessages
();
final
DoctorValidator
linuxDoctorValidator
=
LinuxDoctorValidator
(
processManager:
processManager
,
userMessages:
userMessages
,
);
final
ValidationResult
result
=
await
linuxDoctorValidator
.
validate
();
expect
(
result
.
type
,
ValidationType
.
missing
);
expect
(
result
.
messages
,
<
ValidationMessage
>[
const
ValidationMessage
(
'clang version 4.0.1-6+build1'
),
const
ValidationMessage
(
'cmake version 3.16.3'
),
const
ValidationMessage
(
'ninja version 1.10.0'
),
const
ValidationMessage
(
'pkg-config version 0.29'
),
ValidationMessage
.
error
(
userMessages
.
lzmaLibraryMissing
),
]);
});
testWithoutContext
(
'Missing validation when multiple dependencies are not available'
,
()
async
{
final
ProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
_missingBinaryCommand
(
'clang++'
),
...
...
@@ -376,6 +414,7 @@ void main() {
_pkgConfigPresentCommand
(
'0.29'
),
...
_gtkLibrariesPresentCommands
(),
_libraryCheckCommand
(
'blkid'
),
_libraryCheckCommand
(
'liblzma'
),
]);
final
DoctorValidator
linuxDoctorValidator
=
LinuxDoctorValidator
(
processManager:
processManager
,
...
...
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