[chromium-dev] Re: FreeBSD port and ifdefs
On Wed, Aug 19, 2009 at 10:56 PM, Brett Wilson bre...@chromium.org wrote: On Wed, Aug 19, 2009 at 9:49 PM, Brett Wilsonbre...@chromium.org wrote: On Wed, Aug 19, 2009 at 6:00 PM, Dean McNameede...@chromium.org wrote: I kinda feel like this is one of those things you can try hard to premeditate, but in the end you'll just have to deal with it being ugly for a while and hope it eventually converges to something better. The changes in the bulk of the Chrome code are pretty easy to tell in advance. Just search for OS_LINUX. It would be nice if the first pass didn't just tack on OS_FREEBSD to every OS_LINUX in chrome, especially since I think there's a good chance it won't be maintained longer-term. I definitely believe you that there will be a bunch of unknown build/third_party stuff. Sort of a non-answer, but I'd be happy to see this running on a BSD first, and then we can argue about the patch. Are you suggesting getting it running before checking anything in? I think BenL's was planning to do it piecemeal. Here's an idea I like: Do a pass of porting base and chrome/browser/renderer_host, which are some of the key infrastructure bits that have a bunch of platform-specific stuff in them. It doesn't have to be everything is working perfectly, but rather do a patch to modify the ifdefs as best as you can figure out. Then we can discuss in concrete terms how the ifdefs in the code look and whether they're OK or need rearchitecting. This wouldn't need to block the current build patch, but I think should be done before committing ifdefs to the code. Brett I like this idea too. -Darin --~--~-~--~~~---~--~~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~--~~~~--~~--~--~---
[chromium-dev] Re: FreeBSD port and ifdefs
On Thu, Aug 20, 2009 at 2:00 AM, Dean McNameede...@chromium.org wrote: I kinda feel like this is one of those things you can try hard to premeditate, but in the end you'll just have to deal with it being ugly for a while and hope it eventually converges to something better. Sort of a non-answer, but I'd be happy to see this running on a BSD first, and then we can argue about the patch. I just went through some work trying to build it on OpenBSD (promised a friend I'd try). There are a lot of little things we need to do before we even have this debated. Pretty much everything in third_party (icu, libevent), gmock, etc. Some of these will probably require changes upstream. Probably the right way to handle (most) of these in FreeBSD is to use the versions in their ports system - but I haven't got that far yet. On Wed, Aug 19, 2009 at 1:53 PM, Amanda Walker ama...@chromium.org wrote: On Wed, Aug 19, 2009 at 4:14 PM, Evan Martine...@chromium.org wrote: It seems the configurations we'll see most frequently in code are: 1) POSIX (basically, non-Windows -- we have this already) 2) POSIX minus Mac (since Mac has the most extensions, especially at the GUI layer) 3) POSIX minus Linux (aka everything BSD-derived, more or less) Dean proposes a define for #2, agl proposes a define for #3. I think it'd be nice to keep the defines down if possible. I strongly dislike a #define for #2. I think that having defines for particular combinations of platforms is the wrong way to denote the absence or presence of a particular API or feature. Rather, I would prefer to leave the platform flags as general as possible, and then have features for particular differences within a major platform (this also parallels how webkit's feature controls work, how we're denoting usage of GTK, etc.). So, for example, MacOS X might be OS_POSIX and USES_MACH_THREADS or something. OS_POSIX_BUT_NOT_MAC seems like the wrong direction. --Amanda --~--~-~--~~~---~--~~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~--~~~~--~~--~--~---
[chromium-dev] Re: FreeBSD port and ifdefs
On Thu, Aug 20, 2009 at 6:21 AM, Ben Goodger (Google)b...@chromium.org wrote: I don't know much about the technical details at play here, but a couple of high level notes: - I am sympathetic to concerns around codebase cleanliness. Many people (like Brett) have spent very many months maintaining and improving the hygiene of Chrome code. Sometimes it feels like an uphill battle. Some people (like myself) tend to be more forgiving of temporary clutter when you have an established track record of making these changes and then swiftly sweeping up afterwards. - We have a growing number of ifdefs. It's getting hard to understand when and why each is set. As someone proposing to add more, it'd be much appreciated if you'd put together a doc on our website (and link it up) noting when the common ones are set. If you start such a doc, people can continue to augment/update it with others. I'd be happy to do that. When I do, there's something that's already puzzling me, and that's OS_POSIX. I don't have a copy of the POSIX standard, at least not a recent one, so its hard to know what is or isn't POSIX, and I imagine I am not alone in that. However, various comments lead me to believe that OS_POSIX doesn't really mean POSIX in people's minds - it really means UNIXish or not Windows or something. How would I document this define? Is there an agreed meaning? So sorry if it seems like you're getting the third degree here, I just think it's a good idea for the team at large to know what's going on so we can all remember to follow up from time to time. I'm not complaining. -Ben On Wed, Aug 19, 2009 at 11:43 AM, Ben Laurieb...@chromium.org wrote: I've started working on a FreeBSD port. The first patch is here: http://codereview.chromium.org/172032. When looking at the patch, bear in mind a couple of things... 1. Added gyp lines for files like *_ar.pak are compensating for the fact that i18n targets are not currently being handled correctly, and this can break the build, particularly when -j is not used. There are TODOs to make them work properly. They aren't really part of the port, but because I have no build farm for FreeBSD, the problems show up. 2. There are now some directories that are called linux or mac but are used for FreeBSD, too. I'm hesitant to rename these at this point, because it may turn out later that actually FreeBSD-specific versions are needed. Views welcome, of course. Anyway, there's been some debate about how to proceed in terms of ifdefs. The observation is that many places that are currently: #if defined(OS_LINUX) are going to become: #if defined(OS_LINUX) || defined(OS_FREEBSD) and this is ugly. There's a temptation to instead say these are both POSIX, but not MACOSX, for example as here: http://codereview.chromium.org/172032/diff/3003/3013 but this may not always be true (to be honest, I'm not even sure if its true for that case). Does the list have a view on how this should be handled? --~--~-~--~~~---~--~~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~--~~~~--~~--~--~---
[chromium-dev] Re: FreeBSD port and ifdefs
On Wed, Aug 19, 2009 at 10:18 PM, Marc-Antoine Ruelmar...@google.com wrote: I don't mind as long it's documented on dev.chromium.org. Ben, ping me if you want to setup a freebsd slave on fyi. As long as you want to babysit it. :) Cool - I haven't got that far yet, but when it builds, I'll be in touch (may be some time!). M-A On Aug 19, 2009 4:51 PM, Brett Wilson bre...@chromium.org wrote: On Wed, Aug 19, 2009 at 1:23 PM, Darin Fisherda...@chromium.org wrote: On Wed, Aug 19, 2009 at ... Darin is right. There is actually a #4 on Evan's list: POSIX minus Mac minus Views. I did a search for every place we use OS_LINUX. They fall into a couple of cases: - Graphics stuff like X-windows fonts that are shared between TOOLKIT_GTK and TOOLKIT_VIEWS on Linux. - File path handling stuff. Here Linux/BSD are different from Mac, because there is no encoding, while Mac defines one. - Low level stuff like threads, where Mac has something fancy, but we want to use pthreads or whatever on Linux - A very few system info queries that are likely different between Mac, Linux, and *BSD. Maybe this also includes crash reporting? - Some that should be TOOLKIT_GTK instead of OS_LINUX It looks like the vast majority of them fall into the first two categories (graphics and file paths). It would be nice to optimize our ifdefs so these common ones don't get more complicated. Brett --~--~-~--~~~---~--~~ Chromium Developers mailing list: chromium-de... --~--~-~--~~~---~--~~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~--~~~~--~~--~--~---
[chromium-dev] Re: FreeBSD port and ifdefs
On Thu, Aug 20, 2009 at 6:56 AM, Brett Wilsonbre...@chromium.org wrote: On Wed, Aug 19, 2009 at 9:49 PM, Brett Wilsonbre...@chromium.org wrote: On Wed, Aug 19, 2009 at 6:00 PM, Dean McNameede...@chromium.org wrote: I kinda feel like this is one of those things you can try hard to premeditate, but in the end you'll just have to deal with it being ugly for a while and hope it eventually converges to something better. The changes in the bulk of the Chrome code are pretty easy to tell in advance. Just search for OS_LINUX. It would be nice if the first pass didn't just tack on OS_FREEBSD to every OS_LINUX in chrome, especially since I think there's a good chance it won't be maintained longer-term. I definitely believe you that there will be a bunch of unknown build/third_party stuff. Sort of a non-answer, but I'd be happy to see this running on a BSD first, and then we can argue about the patch. Are you suggesting getting it running before checking anything in? I think BenL's was planning to do it piecemeal. Here's an idea I like: Do a pass of porting base and chrome/browser/renderer_host, which are some of the key infrastructure bits that have a bunch of platform-specific stuff in them. It doesn't have to be everything is working perfectly, but rather do a patch to modify the ifdefs as best as you can figure out. Then we can discuss in concrete terms how the ifdefs in the code look and whether they're OK or need rearchitecting. Sounds good to me ... currently the build breaks when it hits sound support, because I know nothing about sound on FreeBSD. Could someone with more gyp-fu tell me how I could temporarily bypass that part of the build (bearing in mind the FreeBSD port uses make)? Or just build the two parts you are referring to? This wouldn't need to block the current build patch, but I think should be done before committing ifdefs to the code. By build patch do you mean I should break out the *.gyp changes into a separate patch? Brett --~--~-~--~~~---~--~~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~--~~~~--~~--~--~---
[chromium-dev] Re: FreeBSD port and ifdefs
On Thu, Aug 20, 2009 at 6:06 AM, Ben Laurieb...@chromium.org wrote: I'd be happy to do that. When I do, there's something that's already puzzling me, and that's OS_POSIX. I don't have a copy of the POSIX standard, at least not a recent one, so its hard to know what is or isn't POSIX, and I imagine I am not alone in that. However, various comments lead me to believe that OS_POSIX doesn't really mean POSIX in people's minds - it really means UNIXish or not Windows or something. In practice, it's used to mean UNIXish. That is, it means things the Mac and Linux ports have in common that Windows does not. OS_UNIXISH might have been a better name... --Amanda --~--~-~--~~~---~--~~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~--~~~~--~~--~--~---
[chromium-dev] Re: FreeBSD port and ifdefs
On Thu, Aug 20, 2009 at 2:26 PM, Evan Martine...@chromium.org wrote: On Thu, Aug 20, 2009 at 3:06 AM, Ben Laurieb...@chromium.org wrote: I'd be happy to do that. When I do, there's something that's already puzzling me, and that's OS_POSIX. I don't have a copy of the POSIX standard, at least not a recent one, so its hard to know what is or isn't POSIX, and I imagine I am not alone in that. However, various comments lead me to believe that OS_POSIX doesn't really mean POSIX in people's minds - it really means UNIXish or not Windows or something. How would I document this define? Is there an agreed meaning? I think it should just be POSIX. The places that Linux and the BSDs will disagree are exactly the bits that aren't POSIX. You don't need a POSIX spec for this; libc man pages have a CONFORMING TO section. I'm glad there's clear consensus on this issue :-) So am I right in thinking that your view is that if its in FreeBSD and Linux it will be POSIX, almost always? And so there is no need for a UNIXISH macro? --~--~-~--~~~---~--~~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~--~~~~--~~--~--~---
[chromium-dev] Re: FreeBSD port and ifdefs
On Thu, Aug 20, 2009 at 7:32 PM, Evan Martine...@chromium.org wrote: On Thu, Aug 20, 2009 at 11:15 AM, Ben Laurieb...@chromium.org wrote: On Thu, Aug 20, 2009 at 2:26 PM, Evan Martine...@chromium.org wrote: On Thu, Aug 20, 2009 at 3:06 AM, Ben Laurieb...@chromium.org wrote: I'd be happy to do that. When I do, there's something that's already puzzling me, and that's OS_POSIX. I don't have a copy of the POSIX standard, at least not a recent one, so its hard to know what is or isn't POSIX, and I imagine I am not alone in that. However, various comments lead me to believe that OS_POSIX doesn't really mean POSIX in people's minds - it really means UNIXish or not Windows or something. How would I document this define? Is there an agreed meaning? I think it should just be POSIX. The places that Linux and the BSDs will disagree are exactly the bits that aren't POSIX. You don't need a POSIX spec for this; libc man pages have a CONFORMING TO section. I'm glad there's clear consensus on this issue :-) So am I right in thinking that your view is that if its in FreeBSD and Linux it will be POSIX, almost always? And so there is no need for a UNIXISH macro? I think this problem is dangerously too easy for people to comment on, and that you should use your good judgement and see if a reviewer disagrees with you. I mostly agree with the original objection to tests like if linux or freebsd. :) In that case, I will follow brettw's suggestion and come back when I have a larger corpus of evidence. --~--~-~--~~~---~--~~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~--~~~~--~~--~--~---
[chromium-dev] Re: FreeBSD port and ifdefs
On Thu, Aug 20, 2009 at 11:15 AM, Ben Laurieb...@chromium.org wrote: On Thu, Aug 20, 2009 at 2:26 PM, Evan Martine...@chromium.org wrote: On Thu, Aug 20, 2009 at 3:06 AM, Ben Laurieb...@chromium.org wrote: I'd be happy to do that. When I do, there's something that's already puzzling me, and that's OS_POSIX. I don't have a copy of the POSIX standard, at least not a recent one, so its hard to know what is or isn't POSIX, and I imagine I am not alone in that. However, various comments lead me to believe that OS_POSIX doesn't really mean POSIX in people's minds - it really means UNIXish or not Windows or something. How would I document this define? Is there an agreed meaning? I think it should just be POSIX. The places that Linux and the BSDs will disagree are exactly the bits that aren't POSIX. You don't need a POSIX spec for this; libc man pages have a CONFORMING TO section. I'm glad there's clear consensus on this issue :-) So am I right in thinking that your view is that if its in FreeBSD and Linux it will be POSIX, almost always? And so there is no need for a UNIXISH macro? I think this problem is dangerously too easy for people to comment on, and that you should use your good judgement and see if a reviewer disagrees with you. I mostly agree with the original objection to tests like if linux or freebsd. :) --~--~-~--~~~---~--~~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~--~~~~--~~--~--~---
[chromium-dev] Re: FreeBSD port and ifdefs
On Wed, Aug 19, 2009 at 11:43 AM, Ben Laurieb...@chromium.org wrote: #if defined(OS_LINUX) || defined(OS_FREEBSD) and this is ugly. It doesn't deeply worry me, except when NetBSD, OpenBSD come along. Could you use OS_BSD instead? I know that some may assume that OS X would be included, but I don't have a better name. AGL --~--~-~--~~~---~--~~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~--~~~~--~~--~--~---
[chromium-dev] Re: FreeBSD port and ifdefs
we could go with like _nix or something, and consider OSX to not be unix (which is kinda isn't). Really, in theory, we should have more granular ifdefs ./configure style, but that is also really a pain in my opinion. On Wed, Aug 19, 2009 at 1:00 PM, Adam Langley a...@chromium.org wrote: On Wed, Aug 19, 2009 at 11:43 AM, Ben Laurieb...@chromium.org wrote: #if defined(OS_LINUX) || defined(OS_FREEBSD) and this is ugly. It doesn't deeply worry me, except when NetBSD, OpenBSD come along. Could you use OS_BSD instead? I know that some may assume that OS X would be included, but I don't have a better name. AGL --~--~-~--~~~---~--~~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~--~~~~--~~--~--~---
[chromium-dev] Re: FreeBSD port and ifdefs
Rad that you're doing this! I think that we shouldn't have any linux-specific directories except for one or two cases where it's *really* Linux-specific (like crash dumping or ). So the same should be true for you. It seems the configurations we'll see most frequently in code are: 1) POSIX (basically, non-Windows -- we have this already) 2) POSIX minus Mac (since Mac has the most extensions, especially at the GUI layer) 3) POSIX minus Linux (aka everything BSD-derived, more or less) Dean proposes a define for #2, agl proposes a define for #3. I think it'd be nice to keep the defines down if possible. I wonder if #2 could be covered by OS_POSIX TOOLKIT_GTK. Or, elsewhere in the code, we already do something like #ifdef OS_MAC #elif OS_POSIX // with an implied !OS_MAC due to the first branch So I think I'm agreeing with Adam that we want OS_BSD and from there if there's ever a situation where you're listing more than one platform in a preprocessor conditional, revisiting this issue. On Wed, Aug 19, 2009 at 11:43 AM, Ben Laurieb...@chromium.org wrote: I've started working on a FreeBSD port. The first patch is here: http://codereview.chromium.org/172032. When looking at the patch, bear in mind a couple of things... 1. Added gyp lines for files like *_ar.pak are compensating for the fact that i18n targets are not currently being handled correctly, and this can break the build, particularly when -j is not used. There are TODOs to make them work properly. They aren't really part of the port, but because I have no build farm for FreeBSD, the problems show up. 2. There are now some directories that are called linux or mac but are used for FreeBSD, too. I'm hesitant to rename these at this point, because it may turn out later that actually FreeBSD-specific versions are needed. Views welcome, of course. Anyway, there's been some debate about how to proceed in terms of ifdefs. The observation is that many places that are currently: #if defined(OS_LINUX) are going to become: #if defined(OS_LINUX) || defined(OS_FREEBSD) and this is ugly. There's a temptation to instead say these are both POSIX, but not MACOSX, for example as here: http://codereview.chromium.org/172032/diff/3003/3013 but this may not always be true (to be honest, I'm not even sure if its true for that case). Does the list have a view on how this should be handled? --~--~-~--~~~---~--~~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~--~~~~--~~--~--~---
[chromium-dev] Re: FreeBSD port and ifdefs
On Wed, Aug 19, 2009 at 1:14 PM, Evan Martin e...@chromium.org wrote: Rad that you're doing this! I think that we shouldn't have any linux-specific directories except for one or two cases where it's *really* Linux-specific (like crash dumping or ). So the same should be true for you. It seems the configurations we'll see most frequently in code are: 1) POSIX (basically, non-Windows -- we have this already) 2) POSIX minus Mac (since Mac has the most extensions, especially at the GUI layer) 3) POSIX minus Linux (aka everything BSD-derived, more or less) Dean proposes a define for #2, agl proposes a define for #3. I think it'd be nice to keep the defines down if possible. I wonder if #2 could be covered by OS_POSIX TOOLKIT_GTK. Or, What about TOOLKIT_VIEWS? elsewhere in the code, we already do something like #ifdef OS_MAC #elif OS_POSIX // with an implied !OS_MAC due to the first branch So I think I'm agreeing with Adam that we want OS_BSD and from there if there's ever a situation where you're listing more than one platform in a preprocessor conditional, revisiting this issue. On Wed, Aug 19, 2009 at 11:43 AM, Ben Laurieb...@chromium.org wrote: I've started working on a FreeBSD port. The first patch is here: http://codereview.chromium.org/172032. When looking at the patch, bear in mind a couple of things... 1. Added gyp lines for files like *_ar.pak are compensating for the fact that i18n targets are not currently being handled correctly, and this can break the build, particularly when -j is not used. There are TODOs to make them work properly. They aren't really part of the port, but because I have no build farm for FreeBSD, the problems show up. 2. There are now some directories that are called linux or mac but are used for FreeBSD, too. I'm hesitant to rename these at this point, because it may turn out later that actually FreeBSD-specific versions are needed. Views welcome, of course. Anyway, there's been some debate about how to proceed in terms of ifdefs. The observation is that many places that are currently: #if defined(OS_LINUX) are going to become: #if defined(OS_LINUX) || defined(OS_FREEBSD) and this is ugly. There's a temptation to instead say these are both POSIX, but not MACOSX, for example as here: http://codereview.chromium.org/172032/diff/3003/3013 but this may not always be true (to be honest, I'm not even sure if its true for that case). Does the list have a view on how this should be handled? --~--~-~--~~~---~--~~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~--~~~~--~~--~--~---
[chromium-dev] Re: FreeBSD port and ifdefs
On Wed, Aug 19, 2009 at 1:23 PM, Darin Fisherda...@chromium.org wrote: On Wed, Aug 19, 2009 at 1:14 PM, Evan Martin e...@chromium.org wrote: Rad that you're doing this! I think that we shouldn't have any linux-specific directories except for one or two cases where it's *really* Linux-specific (like crash dumping or ). So the same should be true for you. It seems the configurations we'll see most frequently in code are: 1) POSIX (basically, non-Windows -- we have this already) 2) POSIX minus Mac (since Mac has the most extensions, especially at the GUI layer) 3) POSIX minus Linux (aka everything BSD-derived, more or less) Dean proposes a define for #2, agl proposes a define for #3. I think it'd be nice to keep the defines down if possible. I wonder if #2 could be covered by OS_POSIX TOOLKIT_GTK. Or, What about TOOLKIT_VIEWS? Darin is right. There is actually a #4 on Evan's list: POSIX minus Mac minus Views. I did a search for every place we use OS_LINUX. They fall into a couple of cases: - Graphics stuff like X-windows fonts that are shared between TOOLKIT_GTK and TOOLKIT_VIEWS on Linux. - File path handling stuff. Here Linux/BSD are different from Mac, because there is no encoding, while Mac defines one. - Low level stuff like threads, where Mac has something fancy, but we want to use pthreads or whatever on Linux - A very few system info queries that are likely different between Mac, Linux, and *BSD. Maybe this also includes crash reporting? - Some that should be TOOLKIT_GTK instead of OS_LINUX It looks like the vast majority of them fall into the first two categories (graphics and file paths). It would be nice to optimize our ifdefs so these common ones don't get more complicated. Brett --~--~-~--~~~---~--~~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~--~~~~--~~--~--~---
[chromium-dev] Re: FreeBSD port and ifdefs
Ben Laurie wrote: The observation is that many places that are currently: #if defined(OS_LINUX) are going to become: #if defined(OS_LINUX) || defined(OS_FREEBSD) and this is ugly. I think that these would generally be proper as defined(OS_POSIX) !defined(OS_MACOSX). If people think that's ugly, maybe we need a new macro that means the same thing. Maybe OS_UNIXISH. OS_MACOSX should not come out of OS_POSIX. Mac OS X is of course Unixish but I'm having a hard time coming up with a better macro name for what's being proposed here other than OS_POSIX_NOT_MACOSX. Mark --~--~-~--~~~---~--~~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~--~~~~--~~--~--~---
[chromium-dev] Re: FreeBSD port and ifdefs
I kinda feel like this is one of those things you can try hard to premeditate, but in the end you'll just have to deal with it being ugly for a while and hope it eventually converges to something better. Sort of a non-answer, but I'd be happy to see this running on a BSD first, and then we can argue about the patch. I just went through some work trying to build it on OpenBSD (promised a friend I'd try). There are a lot of little things we need to do before we even have this debated. Pretty much everything in third_party (icu, libevent), gmock, etc. Some of these will probably require changes upstream. On Wed, Aug 19, 2009 at 1:53 PM, Amanda Walker ama...@chromium.org wrote: On Wed, Aug 19, 2009 at 4:14 PM, Evan Martine...@chromium.org wrote: It seems the configurations we'll see most frequently in code are: 1) POSIX (basically, non-Windows -- we have this already) 2) POSIX minus Mac (since Mac has the most extensions, especially at the GUI layer) 3) POSIX minus Linux (aka everything BSD-derived, more or less) Dean proposes a define for #2, agl proposes a define for #3. I think it'd be nice to keep the defines down if possible. I strongly dislike a #define for #2. I think that having defines for particular combinations of platforms is the wrong way to denote the absence or presence of a particular API or feature. Rather, I would prefer to leave the platform flags as general as possible, and then have features for particular differences within a major platform (this also parallels how webkit's feature controls work, how we're denoting usage of GTK, etc.). So, for example, MacOS X might be OS_POSIX and USES_MACH_THREADS or something. OS_POSIX_BUT_NOT_MAC seems like the wrong direction. --Amanda --~--~-~--~~~---~--~~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~--~~~~--~~--~--~---
[chromium-dev] Re: FreeBSD port and ifdefs
On Wed, Aug 19, 2009 at 6:00 PM, Dean McNameede...@chromium.org wrote: I kinda feel like this is one of those things you can try hard to premeditate, but in the end you'll just have to deal with it being ugly for a while and hope it eventually converges to something better. The changes in the bulk of the Chrome code are pretty easy to tell in advance. Just search for OS_LINUX. It would be nice if the first pass didn't just tack on OS_FREEBSD to every OS_LINUX in chrome, especially since I think there's a good chance it won't be maintained longer-term. I definitely believe you that there will be a bunch of unknown build/third_party stuff. Sort of a non-answer, but I'd be happy to see this running on a BSD first, and then we can argue about the patch. Are you suggesting getting it running before checking anything in? I think BenL's was planning to do it piecemeal. I just went through some work trying to build it on OpenBSD (promised a friend I'd try). There are a lot of little things we need to do before we even have this debated. Pretty much everything in third_party (icu, libevent), gmock, etc. Some of these will probably require changes upstream. Interesting, thanks for the information. Brett --~--~-~--~~~---~--~~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~--~~~~--~~--~--~---
[chromium-dev] Re: FreeBSD port and ifdefs
I don't know much about the technical details at play here, but a couple of high level notes: - I am sympathetic to concerns around codebase cleanliness. Many people (like Brett) have spent very many months maintaining and improving the hygiene of Chrome code. Sometimes it feels like an uphill battle. Some people (like myself) tend to be more forgiving of temporary clutter when you have an established track record of making these changes and then swiftly sweeping up afterwards. - We have a growing number of ifdefs. It's getting hard to understand when and why each is set. As someone proposing to add more, it'd be much appreciated if you'd put together a doc on our website (and link it up) noting when the common ones are set. If you start such a doc, people can continue to augment/update it with others. So sorry if it seems like you're getting the third degree here, I just think it's a good idea for the team at large to know what's going on so we can all remember to follow up from time to time. -Ben On Wed, Aug 19, 2009 at 11:43 AM, Ben Laurieb...@chromium.org wrote: I've started working on a FreeBSD port. The first patch is here: http://codereview.chromium.org/172032. When looking at the patch, bear in mind a couple of things... 1. Added gyp lines for files like *_ar.pak are compensating for the fact that i18n targets are not currently being handled correctly, and this can break the build, particularly when -j is not used. There are TODOs to make them work properly. They aren't really part of the port, but because I have no build farm for FreeBSD, the problems show up. 2. There are now some directories that are called linux or mac but are used for FreeBSD, too. I'm hesitant to rename these at this point, because it may turn out later that actually FreeBSD-specific versions are needed. Views welcome, of course. Anyway, there's been some debate about how to proceed in terms of ifdefs. The observation is that many places that are currently: #if defined(OS_LINUX) are going to become: #if defined(OS_LINUX) || defined(OS_FREEBSD) and this is ugly. There's a temptation to instead say these are both POSIX, but not MACOSX, for example as here: http://codereview.chromium.org/172032/diff/3003/3013 but this may not always be true (to be honest, I'm not even sure if its true for that case). Does the list have a view on how this should be handled? --~--~-~--~~~---~--~~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~--~~~~--~~--~--~---
[chromium-dev] Re: FreeBSD port and ifdefs
On Wed, Aug 19, 2009 at 9:49 PM, Brett Wilsonbre...@chromium.org wrote: On Wed, Aug 19, 2009 at 6:00 PM, Dean McNameede...@chromium.org wrote: I kinda feel like this is one of those things you can try hard to premeditate, but in the end you'll just have to deal with it being ugly for a while and hope it eventually converges to something better. The changes in the bulk of the Chrome code are pretty easy to tell in advance. Just search for OS_LINUX. It would be nice if the first pass didn't just tack on OS_FREEBSD to every OS_LINUX in chrome, especially since I think there's a good chance it won't be maintained longer-term. I definitely believe you that there will be a bunch of unknown build/third_party stuff. Sort of a non-answer, but I'd be happy to see this running on a BSD first, and then we can argue about the patch. Are you suggesting getting it running before checking anything in? I think BenL's was planning to do it piecemeal. Here's an idea I like: Do a pass of porting base and chrome/browser/renderer_host, which are some of the key infrastructure bits that have a bunch of platform-specific stuff in them. It doesn't have to be everything is working perfectly, but rather do a patch to modify the ifdefs as best as you can figure out. Then we can discuss in concrete terms how the ifdefs in the code look and whether they're OK or need rearchitecting. This wouldn't need to block the current build patch, but I think should be done before committing ifdefs to the code. Brett --~--~-~--~~~---~--~~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~--~~~~--~~--~--~---