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
9d770c10
Unverified
Commit
9d770c10
authored
Apr 29, 2020
by
michaellee8
Committed by
GitHub
Apr 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] fix pm serve ipv6 linklocal addr issue (#55664)
parent
9d106bde
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
11 deletions
+18
-11
amber_ctl.dart
packages/flutter_tools/lib/src/fuchsia/amber_ctl.dart
+3
-3
fuchsia_pm.dart
packages/flutter_tools/lib/src/fuchsia/fuchsia_pm.dart
+9
-7
fuchsia_pm_test.dart
...ter_tools/test/general.shard/fuchsia/fuchsia_pm_test.dart
+6
-1
No files found.
packages/flutter_tools/lib/src/fuchsia/amber_ctl.dart
View file @
9d770c10
...
...
@@ -58,7 +58,7 @@ class FuchsiaAmberCtl {
/// Teaches the amber instance running on [device] about the Fuchsia package
/// server accessible via [configUrl].
Future
<
bool
>
addSrc
(
FuchsiaDevice
device
,
FuchsiaPackageServer
server
)
async
{
final
String
configUrl
=
'
${server.
u
rl}
/config.json'
;
final
String
configUrl
=
'
${server.
interfaceStrippedU
rl}
/config.json'
;
final
RunResult
result
=
await
device
.
shell
(
'amber_ctl add_src -x -f
$configUrl
'
);
return
result
.
exitCode
==
0
;
...
...
@@ -68,7 +68,7 @@ class FuchsiaAmberCtl {
/// Fuchsia package server that it was accessing via [serverUrl].
Future
<
bool
>
rmSrc
(
FuchsiaDevice
device
,
FuchsiaPackageServer
server
)
async
{
final
RunResult
result
=
await
device
.
shell
(
'amber_ctl rm_src -n
${server.
u
rl}
'
);
await
device
.
shell
(
'amber_ctl rm_src -n
${server.
interfaceStrippedU
rl}
'
);
return
result
.
exitCode
==
0
;
}
...
...
@@ -84,7 +84,7 @@ class FuchsiaAmberCtl {
/// pkg_resolver repo config, and teaches the pkg_resolver instance running
/// on [device] about the [FuchsiaPackageServer].
Future
<
bool
>
addRepoCfg
(
FuchsiaDevice
device
,
FuchsiaPackageServer
server
)
async
{
final
String
configUrl
=
'
${server.
u
rl}
/config.json'
;
final
String
configUrl
=
'
${server.
interfaceStrippedU
rl}
/config.json'
;
final
RunResult
result
=
await
device
.
shell
(
'amber_ctl add_repo_cfg -n
${server.name}
-f
$configUrl
'
);
return
result
.
exitCode
==
0
;
...
...
packages/flutter_tools/lib/src/fuchsia/fuchsia_pm.dart
View file @
9d770c10
...
...
@@ -111,7 +111,7 @@ class FuchsiaPM {
throwToolExit
(
'Fuchsia pm tool not found'
);
}
if
(
isIPv6Address
(
host
.
split
(
'%'
).
first
))
{
host
=
'[
$
{host.replaceAll('%', '%25')}
]'
;
host
=
'[
$
host
]'
;
}
final
List
<
String
>
command
=
<
String
>[
globals
.
fuchsiaArtifacts
.
pm
.
path
,
...
...
@@ -181,12 +181,6 @@ class FuchsiaPM {
/// }
class
FuchsiaPackageServer
{
factory
FuchsiaPackageServer
(
String
repo
,
String
name
,
String
host
,
int
port
)
{
// TODO(jonahwilliams): ensure we only receive valid ipv4 or ipv6 InternetAddresses.
// Temporary work around to receiving ipv6 addresses with trailing information:
// fe80::ec4:7aff:fecc:ea8f%eno2
if
(
host
.
contains
(
'%'
))
{
host
=
host
.
split
(
'%'
).
first
;
}
return
FuchsiaPackageServer
.
_
(
repo
,
name
,
host
,
port
);
}
...
...
@@ -204,6 +198,14 @@ class FuchsiaPackageServer {
/// The URL that can be used by the device to access this package server.
String
get
url
=>
Uri
(
scheme:
'http'
,
host:
_host
,
port:
_port
).
toString
();
/// The URL that is stripped of interface name if it is an ipv6 address,
/// which should be supplied to amber_ctl to configure access to host
String
get
interfaceStrippedUrl
=>
Uri
(
scheme:
'http'
,
host:
(
isIPv6Address
(
_host
.
split
(
'%'
).
first
))
?
'[
${_host.split('%').first}
]'
:
_host
,
port:
_port
,
).
toString
();
// The name used to reference the server by fuchsia-pkg:// urls.
final
String
name
;
...
...
packages/flutter_tools/test/general.shard/fuchsia/fuchsia_pm_test.dart
View file @
9d770c10
...
...
@@ -65,7 +65,7 @@ void main() {
'-repo'
,
'<repo>'
,
'-l'
,
'[fe80::ec4:7aff:fecc:ea8f%
25
eno2]:43819'
,
'[fe80::ec4:7aff:fecc:ea8f%eno2]:43819'
,
])).
called
(
1
);
},
overrides:
<
Type
,
Generator
>{
FuchsiaArtifacts:
()
=>
mockFuchsiaArtifacts
,
...
...
@@ -78,6 +78,11 @@ void main() {
expect
(
FuchsiaPackageServer
(
'a'
,
'b'
,
host
,
port
).
url
,
'http://[fe80::ec4:7aff:fecc:ea8f%25eno2]:23'
,
);
expect
(
FuchsiaPackageServer
(
'a'
,
'b'
,
host
,
port
).
interfaceStrippedUrl
,
'http://[fe80::ec4:7aff:fecc:ea8f]:23'
,
);
});
...
...
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