Bug 187133 - Switch OS(FUCHSIA) to using JSCOnly
Summary: Switch OS(FUCHSIA) to using JSCOnly
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-06-27 21:25 PDT by Adam Barth
Modified: 2018-06-28 01:03 PDT (History)
4 users (show)

See Also:


Attachments
Patch (10.06 KB, patch)
2018-06-27 21:34 PDT, Adam Barth
no flags Details | Formatted Diff | Diff
Patch (5.36 KB, patch)
2018-06-27 23:38 PDT, Adam Barth
no flags Details | Formatted Diff | Diff
Patch (5.19 KB, patch)
2018-06-27 23:58 PDT, Adam Barth
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Barth 2018-06-27 21:25:36 PDT
Switch OS(FUCHSIA) to using JSCOnly
Comment 1 Adam Barth 2018-06-27 21:34:00 PDT
Created attachment 343792 [details]
Patch
Comment 2 Yusuke Suzuki 2018-06-27 23:21:20 PDT
Comment on attachment 343792 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=343792&action=review

> ChangeLog:9
> +        Rather than creating a Fuchsia port, OS(FUCHSIA) now uses the JSCOnly
> +        port.

OK, then, I think we should remove Fuchsia related things in webkitdir.pm. We can pass cmakeargs by using `--cmakeargs`.
So basically, `Tools/Scripts/build-jsc --jsc-only --cmakeargs="-DCMAKE_TOOLCHAIN_FILE=XXX"` should work.

> Tools/Scripts/webkitdirs.pm:152
> +my $targetingFuchsia;

If we use JSCOnly port in Fuchsia OS, I think we do not need to check Fuchsia related things in webkitdirs.pm. We can just use `--jsc-only`, and we can remove Fuchsia related things in webkitdirs.pm.

> Tools/Scripts/webkitdirs.pm:2212
> +    my $toolchainFile = $ENV{'CMAKE_TOOLCHAIN_FILE'};
> +    if ($toolchainFile) {
> +        push @args, "-DCMAKE_TOOLCHAIN_FILE=$toolchainFile";
> +    }

Why not passing it with `cmakeargs`? `Tools/Scripts/build-jsc --cmakeargs="-DCMAKE_TOOLCHAIN_FILE=XXX"`
Comment 3 Daniel Bates 2018-06-27 23:34:29 PDT
Comment on attachment 343792 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=343792&action=review
> Tools/Scripts/webkitdirs.pm:2209
> +    my $toolchainFile = $ENV{'CMAKE_TOOLCHAIN_FILE'};

Minor: ‘ (single quote) => “ (double quote)

Although unwritten, we prefer double-quoted string literals over single quoted ones unless we explicitly do not want string interpolation or using single quotes reduces the need to escape characters in the string.

> Tools/Scripts/webkitdirs.pm:2211
> +        push @args, "-DCMAKE_TOOLCHAIN_FILE=$toolchainFile";

This will not work correctly if the path has spaces in its name. We should take a similar approach as done for -DCMAKE_INSTALL_PREFIX and surround $toolchainFile in quotes. Is there a better way to write this code to handle a path that has embedded space characters?
Comment 4 Adam Barth 2018-06-27 23:38:17 PDT
Created attachment 343797 [details]
Patch
Comment 5 Adam Barth 2018-06-27 23:40:33 PDT
> OK, then, I think we should remove Fuchsia related things in webkitdir.pm.
> We can pass cmakeargs by using `--cmakeargs`.
> So basically, `Tools/Scripts/build-jsc --jsc-only
> --cmakeargs="-DCMAKE_TOOLCHAIN_FILE=XXX"` should work.

Neat!

> If we use JSCOnly port in Fuchsia OS, I think we do not need to check
> Fuchsia related things in webkitdirs.pm. We can just use `--jsc-only`, and
> we can remove Fuchsia related things in webkitdirs.pm.

Yes, that seems to work.  Done.

> Why not passing it with `cmakeargs`? `Tools/Scripts/build-jsc
> --cmakeargs="-DCMAKE_TOOLCHAIN_FILE=XXX"`

Good idea.

> Minor: ‘ (single quote) => “ (double quote)

Removed.

> Although unwritten, we prefer double-quoted string literals over single
> quoted ones unless we explicitly do not want string interpolation or using
> single quotes reduces the need to escape characters in the string.

Got it.  I've removed this code, in any case.

> > Tools/Scripts/webkitdirs.pm:2211
> > +        push @args, "-DCMAKE_TOOLCHAIN_FILE=$toolchainFile";
> 
> This will not work correctly if the path has spaces in its name. We should
> take a similar approach as done for -DCMAKE_INSTALL_PREFIX and surround
> $toolchainFile in quotes. Is there a better way to write this code to handle
> a path that has embedded space characters?

Apparently the best way to write this code is to delete it.  :)
Comment 6 Yusuke Suzuki 2018-06-27 23:41:43 PDT
Comment on attachment 343797 [details]
Patch

r=me, nice!
Comment 7 Daniel Bates 2018-06-27 23:45:44 PDT
Comment on attachment 343797 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=343797&action=review

> Tools/ChangeLog:11
> +        * Scripts/webkitdirs.pm:

Please update this ChangeLog as this function listing is out of date. It would be good to explain that we are removing code from webkitdir.pm (and why) as well as explain how to build by passing --cmakeargs “...” to build-webkit.
Comment 8 Adam Barth 2018-06-27 23:57:17 PDT
> Please update this ChangeLog as this function listing is out of date.

Done.

> It would be good to explain that we are removing code from webkitdir.pm (and
> why) as well as explain how to build by passing --cmakeargs “...” to
> build-webkit.

I've been putting that information on the wiki:

https://trac.webkit.org/wiki/Fuchsia
Comment 9 Adam Barth 2018-06-27 23:58:09 PDT
Created attachment 343799 [details]
Patch
Comment 10 Yusuke Suzuki 2018-06-28 00:47:17 PDT
Comment on attachment 343799 [details]
Patch

r=me
Comment 11 WebKit Commit Bot 2018-06-28 01:02:37 PDT
Comment on attachment 343799 [details]
Patch

Clearing flags on attachment: 343799

Committed r233303: <https://trac.webkit.org/changeset/233303>
Comment 12 WebKit Commit Bot 2018-06-28 01:02:39 PDT
All reviewed patches have been landed.  Closing bug.
Comment 13 Radar WebKit Bug Importer 2018-06-28 01:03:18 PDT
<rdar://problem/41567155>