Bug 81467 - webkitpy: Make FreeBSD be recognized as a valid platform.
Summary: webkitpy: Make FreeBSD be recognized as a valid platform.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Raphael Kubo da Costa (:rakuco)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-17 22:53 PDT by Raphael Kubo da Costa (:rakuco)
Modified: 2012-05-03 19:21 PDT (History)
5 users (show)

See Also:


Attachments
Patch (11.46 KB, patch)
2012-03-17 22:56 PDT, Raphael Kubo da Costa (:rakuco)
no flags Details | Formatted Diff | Diff
Second attempt with a smaller patch (9.38 KB, patch)
2012-05-03 18:26 PDT, Raphael Kubo da Costa (:rakuco)
abarth: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Raphael Kubo da Costa (:rakuco) 2012-03-17 22:53:16 PDT
webkitpy: Make FreeBSD be recognized as a valid platform.
Comment 1 Raphael Kubo da Costa (:rakuco) 2012-03-17 22:56:11 PDT
Created attachment 132484 [details]
Patch
Comment 2 Eric Seidel (no email) 2012-03-17 23:02:17 PDT
Comment on attachment 132484 [details]
Patch

Oh boy.  I think you just want to pretend to be linux...  Maybe not... but this just seems like signing up for a world of pain.
Comment 3 Raphael Kubo da Costa (:rakuco) 2012-03-17 23:12:08 PDT
I'm all ears to suggestions. If just pretending to be Linux in platforminfo.py is better, I'm fine with that. Can't think of a better solution for the other files, though.
Comment 4 Eric Seidel (no email) 2012-03-17 23:32:01 PDT
Theoretically more of webkitpy should depend on PlatformInfo, instead of grabbing at sys.platform directly.  But I'll look at this tomorrow when I'm more awake. :)  Your patch is probably fine...
Comment 5 Adam Barth 2012-03-18 19:09:18 PDT
Which WebKit ports run on FreeBSD?
Comment 6 Raphael Kubo da Costa (:rakuco) 2012-03-18 19:19:12 PDT
(In reply to comment #5)
> Which WebKit ports run on FreeBSD?

The EFL one, and probably the GTK+ and Qt ones as well (I haven't built them in a while, but stable versions of these ports are regularly packaged). Chrome is also packaged, so I guess the chromium port also runs on FreeBSD, and, if it doesn't have any exotic dependencies, so does the wx port.
Comment 7 Adam Barth 2012-03-18 21:38:03 PDT
Comment on attachment 132484 [details]
Patch

I'm inclined to mark this patch R- unless/until you plan to run FreeBSD-based bots on build.webkit.org.  As far as I know, there are no such bots and I haven't heard that anyone plans to add one.
Comment 8 Raphael Kubo da Costa (:rakuco) 2012-05-03 18:26:29 PDT
Created attachment 140141 [details]
Second attempt with a smaller patch
Comment 9 Raphael Kubo da Costa (:rakuco) 2012-05-03 18:29:12 PDT
With dpranke's help, I've been committing some changes which have helped make this patch smaller. The current sys.platform and PlatformInfo.is_foo() checks in webkitpy are for Windows-only code, so supporting FreeBSD is mostly a matter of adding is_freebsd() to PlatformInfo.

As for a build bot, dpranke and I talked about it on IRC today, and it's mostly a matter of having some spare CPU cycles for that (as an individual developer I don't have a machine for that) and we'll try to get one.
Comment 10 Dirk Pranke 2012-05-03 18:29:19 PDT
Comment on attachment 140141 [details]
Second attempt with a smaller patch

The patch looks fine to me. Adam, I think it's reasonable to land this given that it's basically one if-statement and a bunch of unit tests. The maintenance needs for bsd should be pretty low. On a related note, I think I will ping a few people to see if they want to pony up to support at least a minimal BSD bot. I know we had a chromium port to BSD at some point (e.g., for the capsicum work) and so someone might be interested in keeping it going.
Comment 11 Adam Barth 2012-05-03 18:32:43 PDT
Comment on attachment 140141 [details]
Second attempt with a smaller patch

Yep, agreed.
Comment 12 Raphael Kubo da Costa (:rakuco) 2012-05-03 18:52:27 PDT
Committed r116061: <http://trac.webkit.org/changeset/116061>
Comment 13 Eric Seidel (no email) 2012-05-03 19:02:57 PDT
Comment on attachment 140141 [details]
Second attempt with a smaller patch

OK.  I guess we'll end up using this check more places? I'm still surprised that freebsd wants to be different from linux (I understand that they can be quite different, having worked on Apple's BSD team, but I'm surprised that webkitpy would need to know much about those differences.)
Comment 14 Raphael Kubo da Costa (:rakuco) 2012-05-03 19:17:33 PDT
In practice, right now there is no difference between linux and freebsd for webkitpy. abarth, dprank and I talked about just lying that freebsd is linux in PlatformInfo.is_linux() in March, and at the time Dirk felt "a little leery" about that. We then discussed adding is_unix() (or some thing like that) to PlatformInfo, but that has not been done yet (99% percent of the calls are for is_mac() and is_win() anyway).
Comment 15 Dirk Pranke 2012-05-03 19:21:52 PDT
(In reply to comment #13)
> (From update of attachment 140141 [details])
> OK.  I guess we'll end up using this check more places? I'm still surprised that freebsd wants to be different from linux (I understand that they can be quite different, having worked on Apple's BSD team, but I'm surprised that webkitpy would need to know much about those differences.)

At the moment, is_linux() and is_freebsd() are both only used in one place (and it's the same place, to determine the default port to use in PortFactory() if not win/mac.