25 votes

On building your favourite web browser from source

31 comments

  1. unknown user
    Link
    Disclaimer: my own content.

    Disclaimer: my own content.

    11 votes
  2. [2]
    Comment deleted by author
    Link
    1. UntouchedWagons
      Link Parent
      Good lord how many weeks does it take to compile android?

      Good lord how many weeks does it take to compile android?

  3. [4]
    unknown user
    Link
    Slightly off-topic, but: you say that you can't use Ungoogled Chromium because nobody's built it for Ubuntu 17.10 yet; is there any particular reason you're using Ubuntu 17.10, which stopped...

    Slightly off-topic, but: you say that you can't use Ungoogled Chromium because nobody's built it for Ubuntu 17.10 yet; is there any particular reason you're using Ubuntu 17.10, which stopped getting security updates nearly six months ago?

    7 votes
    1. [3]
      unknown user
      Link Parent
      The article is from Jan 2018.

      The article is from Jan 2018.

      7 votes
      1. [2]
        unknown user
        Link Parent
        Aaaaaah, that makes sense, sorry!

        Aaaaaah, that makes sense, sorry!

        4 votes
        1. unknown user
          Link Parent
          No problem!

          No problem!

          2 votes
  4. [8]
    meghan
    Link
    It's wild there aren't more minimal builds

    It's wild there aren't more minimal builds

    5 votes
    1. [6]
      pipsy
      Link Parent
      I often dream of having a minimal browser. Then I remember all the shit I use to improve QOL. Ad blocker, privacy enhancers, web developer tools, etc. It'd be great to have something lightweight...

      I often dream of having a minimal browser. Then I remember all the shit I use to improve QOL. Ad blocker, privacy enhancers, web developer tools, etc. It'd be great to have something lightweight that also somehow managed to include the features I enjoy, but it's not really feasible.

      10 votes
      1. Akir
        Link Parent
        At this point it might be amusing to learn that Firefox exists because the developers wanted a simpler browsing experience. (For historical context, the Mozilla browser used to also include a mail...

        At this point it might be amusing to learn that Firefox exists because the developers wanted a simpler browsing experience.

        (For historical context, the Mozilla browser used to also include a mail and news client, an address book, and an HTML editor. Even so, modern Firefox is probably still a bigger program than the Mozilla Application Suite used to be)

        8 votes
      2. [3]
        meghan
        Link Parent
        I think they exist, just are not open source. A slightly extended version of game console browsers comes to mind as a potential option. Or maybe an entirely new project outright.

        I think they exist, just are not open source. A slightly extended version of game console browsers comes to mind as a potential option. Or maybe an entirely new project outright.

        3 votes
        1. Luna
          Link Parent
          These are usually terrible. Slim browsers sound cool until you realize all the work that goes into making the web usable. If we could throw out JS, browser development would be a lot simpler, but...

          game console browsers

          These are usually terrible. Slim browsers sound cool until you realize all the work that goes into making the web usable. If we could throw out JS, browser development would be a lot simpler, but if we did that we'd need Flash again...

          4 votes
        2. Octofox
          (edited )
          Link Parent
          Game console browsers are almost universally a light skin over webkit or embedded chromium. They are not lightweight, just next to no UI to the same software that powers regular browsers.

          Game console browsers are almost universally a light skin over webkit or embedded chromium. They are not lightweight, just next to no UI to the same software that powers regular browsers.

          1 vote
      3. JustABanana
        Link Parent
        One man's treasure is another man's bloat?

        One man's treasure is another man's bloat?

    2. Crestwave
      (edited )
      Link Parent
      There's a suckless browser: surf. If you want something a bit... less suckless, there's also qutebrowser (keyboard-focused), and NetSurf (incomplete JavaScript support). And of course, there's...

      There's a suckless browser: surf. If you want something a bit... less suckless, there's also qutebrowser (keyboard-focused), and NetSurf (incomplete JavaScript support). And of course, there's lynx, links, elinks, w3m, etc. for terminal use.

  5. [4]
    Greg
    Link
    You mentioned it very briefly, but I wouldn't dismiss the idea of just spinning up a remote VM for the job. It's not the most user friendly advice, but when we're already in the territory of...

    You mentioned it very briefly, but I wouldn't dismiss the idea of just spinning up a remote VM for the job. It's not the most user friendly advice, but when we're already in the territory of compiling browsers from scratch I'd say the conversation is well into the realms of "niche" already!

    You're realistically looking at a couple of dollars in cost, and it's something you'll only need to do on rare occasions. Maybe I've missed something key, but that doesn't seem too onerous (either in cost or difficulty) to me? Certainly not in comparison to actually getting a fiddly and unfamiliar C++ build running on a new machine in the first place...

    4 votes
    1. [3]
      unknown user
      Link Parent
      Would you mind pointing me to a place I can rent VMs like that? I haven't really used cloud services much, also I just looked at Azure, and a VM that can build Firefox once or twice a month w/...

      Would you mind pointing me to a place I can rent VMs like that? I haven't really used cloud services much, also I just looked at Azure, and a VM that can build Firefox once or twice a month w/ bare minimum ended up costing upwards of $400/year. On Digital Ocean it costs $10 a month.

      Also my currency, Turkish lira, devaluated significantly. A build every now and then for a few $ isn't much, but regular builds would be costly, especially for a uni student like me (just grad., but will do postgrad). And there are countries worse off.

      And all of that aside maybe this is a bit pedantic, but these requirements are simply a waste of resources, and I am a bit averse to it. I wonder, if Chrome was written in a proper language that understands modules and has proper generics (maybe D?), what would those requirementa look like. I can compile FreeBSD, kernel & world, on a crappy old laptop, in an hour or two, and using nothing near these obscene space requirements. Similar with Linux kernel.

      2 votes
      1. Greg
        (edited )
        Link Parent
        That's the key - you don't need to pay for a full year, just a handful of hours over the course of the year. You can also get deep discounts (generally 50-80%) on capacity that's unused at any...

        a VM that can build Firefox once or twice a month

        upwards of $400/year

        That's the key - you don't need to pay for a full year, just a handful of hours over the course of the year. You can also get deep discounts (generally 50-80%) on capacity that's unused at any given time, so realistic pricing even for a machine that's significant overkill should be less than $0.30/hour. I seem to remember that GCP even bills by the minute nowadays if you're using partial hours.

        [Edit: I realise I didn't actually answer the direct question here! AWS or Google Cloud will certainly work; I assume Azure as well, although I have less direct experience there]

        You'd need to spend some time fiddling with launch scripts to make it seamless, but you could very plausibly have a local command that spins up a VM at the lowest spot price, executes whatever build, sends the output back to you, and then shuts it all off again automatically.

        I do genuinely sympathise on the currency/economy situation, and there's definitely a tipping point where it could become costly, but I think the Venn diagram of people with ability and interest to contribute, but without access to the resources (either personal, through a university, or through a company) has to be pretty small. Potentially so small that just messaging one of the companies that hosts a ton of free build/CI servers for OSS projects and asking them to hook you up would probably also work!

        And all of that aside maybe this is a bit pedantic, but these requirements are simply a waste of resources, and I am a bit averse to it.

        That's fair. For what it's worth, my limiting resource in 99% of cases is dev time. If it's slower to build but faster to write or faster to learn, then even a few days of a team's time can end up paying for the extra hardware. Of course, once clunky and complex builds start hurting the team's workflow, the pendulum swings back the other way again.

        6 votes
      2. aphoenix
        Link Parent
        We actually did this yesterday on Amazon! I was excited to read your article. What we did was spin up an on-demand beast (we used a c518xlarge instance). We spun it up for about 90 minutes. It...

        We actually did this yesterday on Amazon! I was excited to read your article.

        What we did was spin up an on-demand beast (we used a c518xlarge instance). We spun it up for about 90 minutes. It cost $1.76. On demand cloud usage is really what you want for something like this, because you can go as big as you want.

        Getting started with EC2 isn't a bad resource for getting up to speed.

        1 vote
  6. [4]
    dblohm7
    Link
    As I have mentioned elsewhere, the UI of Firefox is written using privileged HTML, XUL (a pre-HTML5 XML-based layout engine for GUIs), and JavaScript. If you just want to hack on those parts (ie,...

    As I have mentioned elsewhere, the UI of Firefox is written using privileged HTML, XUL (a pre-HTML5 XML-based layout engine for GUIs), and JavaScript. If you just want to hack on those parts (ie, you don't need to touch any C++ or Rust code), you can run an "artifact build." I don't run it myself (since I work on Gecko), but I think that all you should need to do is choose the right option when running mach bootstrap and you should be good to go.

    4 votes
    1. [3]
      unknown user
      Link Parent
      Thanks! That's a godsend feature, and helps a lot with the practicality of building Firefox. I also thought you moved away from XUL with WebExts (or that the reason to kill the old API was in...

      Thanks! That's a godsend feature, and helps a lot with the practicality of building Firefox. I also thought you moved away from XUL with WebExts (or that the reason to kill the old API was in order to remove XUL). I'm mistaken about that, apparently.

      If my memory doesn't fail me, this post (made last year) was written after frustration with the fact that I wasn't able to try out Ungoogled Chromium. It is not available in any official distro repos, and the only available options are to build it yourself or to use an untrusted, contributed community build (i.e. a binary some guy built for themselves) which can not be verified at all because not reproducible. Frankly, being able to build Firefox is not totally out of reach for me (I have 4G ram and enough disk space), but building Chromium is. And being able to make your own builds, modified or not, is an important part of OSS, IMO.

      3 votes
      1. [2]
        dblohm7
        Link Parent
        You're right, but it just takes a lot of time and effort! As of version 57, XUL is now completely blocked from usage by add-ons. This was required in order to kick off our XUL removal project....

        I also thought you moved away from XUL with WebExts (or that the reason to kill the old API was in order to remove XUL). I'm mistaken about that, apparently.

        You're right, but it just takes a lot of time and effort! As of version 57, XUL is now completely blocked from usage by add-ons. This was required in order to kick off our XUL removal project. Removing it from the Firefox front-end itself is a lot of work and is happening gradually over time. New code uses HTML, not XUL, but we will still be shipping with some presence of XUL for a while yet.

        4 votes
        1. unknown user
          Link Parent
          Thanks for the clarification!

          Thanks for the clarification!

          1 vote
  7. [3]
    meghan
    Link
    I wonder if sr.ht can handle it

    I wonder if sr.ht can handle it

    1 vote
    1. [3]
      Comment deleted by author
      Link Parent
      1. unknown user
        Link Parent
        It does have CI. IDK the specifics, tho.

        It does have CI. IDK the specifics, tho.

        2 votes
      2. meghan
        Link Parent
        builds.sr.ht E: it’s a full development pipeline for every part of the process, not just git hosting

        builds.sr.ht
        E: it’s a full development pipeline for every part of the process, not just git hosting

        2 votes
  8. [6]
    unknown user
    Link
    I still wish for something like SQLite, but for the Web. It's probably impossible, considering how complex most web-technologies are.

    I still wish for something like SQLite, but for the Web. It's probably impossible, considering how complex most web-technologies are.

    1 vote
    1. unknown user
      Link Parent
      There are lighter engines out there, like Dillo's, Netsurf's, or TkHTML (does not do HTML5, discontinued). Also w3m and links use their own engines, AFAIK. Older versions of v8 used to build in...

      There are lighter engines out there, like Dillo's, Netsurf's, or TkHTML (does not do HTML5, discontinued). Also w3m and links use their own engines, AFAIK. Older versions of v8 used to build in quite reasonable times too (in 2013-14 when I used to play with Node.js, before it became the horrible thing it is w/ the introduction of NPM), but it took me quite some while when I tried to build a recent Node.js, IDK if that's due to v8 having gotten beefier. There's also Guile which can run JS, among other things. Also, trustable Webkit library builds are very widely available, on all distros, so often it does not need building unless specifically working on it.

      So it should not be hard to compose a bare-bones, basic browser out of lighter building parts, and there are many browsers out there that do that. I used to like Xombrero in particular, and used it for quite some time. But it did not update to the secure version of WebkitGTK. I intended to make a port, but that was beyond me I soon discovered. It was the best browser I ever used, I still miss it.

      3 votes
    2. [4]
      Wes
      Link Parent
      Well there is IndexedDB. It's supposed to be rather rubbish, though.

      Well there is IndexedDB. It's supposed to be rather rubbish, though.

      1 vote
      1. unknown user
        Link Parent
        What I meant is a “small, well-written, and good enough for most cases browser”, just like SQLite is a “small, well-written, and good enough for most (local) cases database”.

        What I meant is a “small, well-written, and good enough for most cases browser”, just like SQLite is a “small, well-written, and good enough for most (local) cases database”.

        3 votes
      2. Akir
        Link Parent
        I tried to use IndexedDB once. It was so difficult to work with that I eventually just decided to put everything into a serialized JSON object in localStorage. It wasn't a pretty solution, but I...

        I tried to use IndexedDB once. It was so difficult to work with that I eventually just decided to put everything into a serialized JSON object in localStorage. It wasn't a pretty solution, but I needed a short term solution and it worked for what I needed it to do. I would put effort into learning IndexedDB, but I would prefer to avoid frontend work in general.

        1 vote