Electron: Add FreeBSD support to electron

Created on 12 Dec 2015  ยท  124Comments  ยท  Source: electron/electron

Bountysource

Related: #2452

enhancement

Most helpful comment

Published a few hours ago.
https://www.freshports.org/devel/electron4/

All 124 comments

As mentioned in #2452, currently we don't have any plan to add support for FreeBSD, but if anyone is interested in sending a pull request, we will be very happy to accept it.

Hi @zcbenz,

Could you please keep this open? I opened the request and added a bounty to encourage someone to send in a PR adding in FreeBSD support.

Thank you,
Teran

Okay.

I'm getting close to compiling electron on FreeBSD 10.3.

I have two errors standing in my way:

https://gist.github.com/yonas/06d08aa591e4a452b16c1e9a9ac5e0f3

but I'm not sure how to fix them. Any C/C++ gurus here? :)

I see that $200 USD has been added to the bounty? Is this going to happen? I think it will rock if it does.

Sorry, I'll try to spend more time on this. If anyone knows C/C++ very well, there are Linux specific parts that need to be re-implemented for FreeBSD.

Yes, Electron is becoming more popular and being used in more apps than just the Atom editor. I'd love to have the Black Screen terminal running on my FreeBSD machine.

Was able to build electron and VSCode in freebsd11RC1. the build instruction is posted in
https://gist.github.com/prash-wghats/89be1ee069d2acf23c289e9c606616e1

@prash-wghats Great work!!! I'm curious, why did you compile with VSCode? Is there anything that GCC or CLANG is missing?

This is awesome. Can't wait to try it out, and would love to see those changes moved forward.

@yonas @prash-wghats didn't build using VSCode, he built Electron & VSCode.

@yonas Thanks. Built electron using clang, then used it to run VSCode.

Upped the bounty.

(Incidentally: the reference, above, from an _apparently_ Windows-related issue was the result of steering away from a multi-platform issue for the same product.)

Hello electron team, my compliments!!!! First I would like to congratulate you on the project and also leave here my desire as well as many others to see the electron running in the FresBSD, your application is very impressive and it would be great if you could add support to FreeBSD I very much enjoyed the platform and it would enable the BSDS systems to leverage enabling the creation of incredible apps.

Any chances of the patches referenced by prash-wghats commented on Oct 12, 2016 will be incorporated upstream? Are their blockers preventing this from happening, or anything the FreeBSD community can do to usher this along?

https://github.com/prash-wghats/VSCode-For-FreeBSD/releases.
This binaries were built with freebsd 11.

Soooo~ How's everything going? I am more than happy to know if electron is finally available on FreeBSD, or if I can help with something.

I'm also curious what progress, if any, has been made on this. I've been periodically checking but not really seeing any updates. I doubt that I have the know-how to contribute directly, but I'm more than happy to add to the bounty should someone commit to the work.

โ€ฆ if electron is finally available on FreeBSD โ€ฆ

From the Bountysource page:

โ€ฆ expects to finish by Sep 19, 2017. Will try to take a crack at this.

This is absolutely great. I will try to help with bug fixes after the initial implementation is done.

^ likewise.
Gonna keep a close eye on this,and help however I can.
Been working on porting some electron apps to the Linuxulator, but native support is best.

Any progress on getting a PR ready? I'd be happy to offer some C++ help if needed.

Do we have any news on this recently?

I would really like FreeBSD support

touche -- bumped the bounty as well.

Are there any updates?

I just added to the bounty as well. Hopefully someone isn't just sitting on a solution and waiting to get as much for a bounty as possible. ๐Ÿ˜„

Well @prash-wghats arrived at a working build the last year, but additional work is undoubtedly required.

lols, @ararslan -- I'm not sure there are enough FreeBSD users out there to take advantage of. Just the 19+ people who watch this thread : P

FreeBSD is in the 4th spot for desktop OS marketshare!

All the more reason to have Electron support. ๐Ÿ™‚

FreeBSD is in the 4th spot for desktop OS marketshare!

Indeed, or in other words, at 0.00%.

@stites I think there are plenty of FreeBSD, PC-BSD, OpenBSD, and NetBSD users who want to use Electron - and all the apps, like Atom, that are built on it - but they aren't all on this thread.

BTW does chromium support FreeBSD?

@ararslan Well, just based on this, adding support in electron would require a fair few of patches, which would be a large burden on those of the maintainers who do the chromium upgrades.

@brenca The first thing is to figure out what patches are required to make Electron run properly on FreeBSD.

After that, FreeBSD has a tradition of maintaining its own patches in the "Ports Collection". Some patches will be easy for the upstream maintainer to absorb, and so those patches will be committed upstream over time. That is how we've worked with all other open source communities.

That would be superb, I'm just a bit pessimistic, that's all. :)

It's not just about the desktop users. Electron on BSD would allow it to be used in commercial embedded hardware application.

Currently QT has basically a market monopoly. And it's expensive. 300 USD / Month expensive.

Electron, together with mobile frameworks such as ionic has the power to become the leading embedded UI platform in the coming years.

Are there CIs who can run BSD?

No major services (it was requested of Travis and they effectively said "not now"), though some projects roll their own. For example, Julia has Buildbot-powered FreeBSD CI running on hardware at National Chiao Tung University in Taiwan. I've wanted to start my own service, but that takes ๐Ÿ’ฐ, so in the mean time I think projects need to find their own ways.

I wonder if you can build+run tests of electron inside docker on travis or other CI hosting...

I wonder if you can build+run tests of electron inside docker on travis or other CI hosting...

Wonder no more. You can't.

Updated Vscode (v1.17.2) and Electron (1.7.7) for freebsd.
https://github.com/prash-wghats/VSCode-For-FreeBSD/releases

@prash-wghats I was confused about why we needed to build VSCode the first time I saw your repo. After reading your previous comments, it seems we don't need to build VSCode at all.

Would a build script like this work?

If that's true, we should just create a port using this form.

Yes , the script will build electron. The electron binaries will be placed in electron/dist/* folder. I have not created a freebsd port before. If you can do it please go ahead.

The script builds libchromiumcontent library from the FreeBSD port of chromium, then uses that to build electron.

@prash-wghats Awesome, I'll try to get this into the ports collection.

If you have time, would you be able to try building Atom? I know a lot of people would love to have that editor in FreeBSD.

I will give it a try

@prash-wghats Thanks, much appreciated!

Happy to contribute or help get it into ports if needed :)
Glad to see movement on this!

I'm happy to say that, with the help of @prash-wghats, I was also able to get electron to run on FreeBSD 11.1. :beer:

I'll try to get this into ports asap.

Congrats! Happy to see such progress on this, so excited that thousands of new apps are coming to FreeBSD. Also please let me know how I could help.

@yzgyyang dont get to happy just yet. It is a jump and good progress, but you still are at the mercy of many of the developers that build around electron to make sure their apps have support for freebsd. Some may just be a seamless transition, some may require additional modifications to their source, and others may require a rewrite (hopefully that wont be the case)

@dariusc93 Can you give an example of an Electron app that has OS-specific functionality?

My understanding is that isn't possible, because Electron apps are built using standardized technologies (JavaScript, HTML, and CSS). It would be like a website on the web not being able to run on FreeBSD.

@yonas You are right. They are like websites, but with electron you can also make use of os specific things as well just like any node app. Some apps load shared libraries that are built for a specific platform and those libraries would have to be ported to freebsd. I cannot think of the apps that done this from the top of my head as I stop using alot of electron app because of this as they may target windows or macos but not linux (and soon to be freebsd)

@yonas like node modules NSFW, minidump, spellchecker ... Some of this is trivial like adding OS name in the configuration file. others like nsfw will require platform specific code.

@dariusc93 @prash-wghats Ah, thanks. Hopefully we don't run into too many of those :)

@prash-wghats what do you believe is needed now for things to get brought upstream?

@dariusc93 For electron, need to make a port package and submit i guess, because all the work has been already done by the chromium port for freebsd. As for apps built by electron like vscode or atom, needs Freebsd support in some of the node modules.

Making a port package isnt the problem I dont believe. I mean making a pr towards electron (and any of its dependencies, if required) so it would reduce patches in the port, and so if someone wishes to build from git they would have the option of doing that.

Thanks @prash-wghats !! Atom finally runs on FreeBSD :smile: :tada:

I believe @prash-wghats should collect the bounty, or at least once Electron is available in Ports. At what point can this be considered "solved"? When the requisite patches have been upstreamed such that Electron can be built from source on FreeBSD outside of the Ports Collection, or once it's available in Ports?

I also support @prash-wghats getting the bounty. Amazing work.

I do believe @prash-wghats should get the bounty. He has put work into getting working and once things are push upstream to the repo, other devs could simply add support for freebsd with little to no excuses.

Is anyone making a new port for Electron now? I didn't see any PR on bugs.freebsd.org. I would like to do it if no one is up to it right now.

@yzgyyang I was going to, but don't have time right now. If you could create the PR, that'd be awesome. Thanks!

If you could post the PR link here, we'll be able to help test it and push it through.

@yonas Thanks! Can I see your progress somewhere so I can continue on that? Is it at yonas/VSCode-For-FreeBSD? (I can see some build scripts there, not sure which is the right one to use)

@yzgyyang Yes, https://github.com/yonas/VSCode-For-FreeBSD has the changes needed to fix some compile errors.

@yonas Alright then, I will try building it following your changes, and will start making a new port if everything works.

With @prash-wghats 's work and @yonas 's patches, and some more patches to fix build errors, Electron can be successfully built and run on my machine. I am already working on making a new port for it.
screenshot_2018-01-11_18-21-49

My question is will some of the patches be brought upstream? Doing so can reduce the patches in the ports, and make upgrading easier in the future vs having to update the patches.

@dariusc93 IMO we definitely should submit those patches to upstream after ensuring Electron is fully functional on FreeBSD. We probably still need to take care of them until FreeBSD is "officially supported" upstream though.

@yzgyyang: As stated further above it does not appear likely the project will officially support FreeBSD. Maybe one of the core team could make a clear statement about whether it will be maintained or not once a working pull request has landed.

Got to start somewhere @herrbischoff

Any updates on the port? @yzgyyang or @prash-wghats

@monty11ez I'm on it. Continued working with @prash-wghats and my mentors to update the build script and test the port, but the port still needs lots of investigation. In the meantime, please feel free to use the latest build script that @prash-wghats provided, it worked great.

@yzgyyang What version of FreeBSD is your port targeting? 11 or 12? I'm trying to build @prash-wghats electron build script on TrueOS (FreeBSD 12) and am having trouble.

Great. Now do the same for OpenBSD.

@qbit, who maintains OpenBSD's port of Node.js, tried building an Electron port last year.

Poor @qbit suffered terribly.

@dszidi while I cannot speak directly for trueos, but electron should be able to be built if youre using the right dependencies. Could you post any build logs?

A little late to this ticket, but to put in my two cents:

I don't think it makes sense for the GitHub Electron team to officially support BSD because none of us are running a (non-macOS) BSD and we're generally overloaded with the platforms we do support. So it's not anything about BSD and all about resources.

That said, I love that there is community interest in this and, as @zcbenz said above, we'd welcome patches for this and I'd be happy to help get PRs landed.

One comment though: I notice that the screenshot @yzgyyang posted has 1.6.x running in it. Merging will go a lot more smoothly if the PR is against master instead :smile:

@ckerr From what I gather, building Electron is both nightmarish and extremely convoluted. Even getting one version to build on OpenBSD should be enough for somebody to maintain a port for it.

The fact that both Chromium and Node have actively-maintained OpenBSD ports suggests that Electron's build process has room for improvement.

What version of FreeBSD is your port targeting? 11 or 12? I'm trying to build electron build script on TrueOS (FreeBSD 12) and am having trouble.

@dszidi Currently FreeBSD 11.1 is hard-coded in our patches and WIP ports. It would be a simple code change, but 11.1 is what we are working on right now. See https://github.com/prash-wghats/Electron-VSCode-Atom-For-FreeBSD/issues/8.

we'd welcome patches for this and I'd be happy to help get PRs landed.

@ckerr Thanks! I believe that is our next goal.

I notice that the screenshot @yzgyyang posted has 1.6.x running in it. Merging will go a lot more smoothly if the PR is against master instead ๐Ÿ˜„

@ckerr Our ongoing work has been shifted to build against 1.8 (latest stable) version.

@yzgyyang We actually wound up trying the precompiled binaries from that repo and I can say that vscode and the actual electron binary are working on TrueOS/FreeBSD 12 (haven't tried Atom yet).

@dariusc93 As far as building, I tried as a first attempt to simply find and replace any mention of freebsd11 with freebsd12 from the various vendor diff files in the electron directory.

EDIT: Instead of polluting this thread with my error messages, I posted them to the repo containing the patches. Link is below

https://github.com/prash-wghats/Electron-VSCode-Atom-For-FreeBSD/issues/9

An update: Electron 1.8.2 Beta 2 can be built and installed with the ports system! There's still a lot of work to bring this to the ports tree (more patches, more testing, switch to use 1.8.2 stable, etc. etc.), so no estimated time for now.
screenshot_2018-03-01_13-55-08

@yzgyyang Hey Congrats ๐Ÿ˜ƒ
I and @pizzamig had some efforts in summer (lead to having gyp into tree) maybe it can help you to reach to destination faster ๐Ÿ™‚
On https://github.com/pizzamig/freebsd-ports you can find a branch
called devel-libchromiumcontent that contains the initial work on some of dependencies and libraries.
Hope it helps and thanks in advance for efforts ๐Ÿ‘

@yzgyyang Hey! Great work!
I can help migrating the "build_electron.sh" script in a FreeBSD port compatible way

@pizzamig A lot of work was done by @prash-wghats on a buildable build_electron.sh, and I am already on writing ports and testing (check this out: https://github.com/yzgyyang/freebsd-ports-electron). More eyes and hands are always welcome ๐Ÿ˜„

great, I'll do some pull request in the weekend, there're some stuff to be fixed, but it's really promising

Should've commented on this sooner, but better late than never:

@Alhadis simplifying the build process would benefit BSD in exactly the same way that it would benefit all platforms, so maybe that should be split off to a separate issue if you have specific improvement suggestions to make. Thanks!

Has anyone successfully made a FreeBSD port of this work yet?

FYI I've added $50 to the bounty on this issue, which brings it to $750.

Here you can find the FreeBSD port that will build and install electron on FreeBSD:
https://github.com/yzgyyang/freebsd-ports-electron

Currently, the port is poudriere compatible, but not yet committed; in other words, you can build it, but there's no package yet.
Please, feel free to use it and test it! We need your feedback

@pizzamig Great, thanks! Will test soon. Hoping to get Cypress running on FreeBSD, so this is great timing :)

@pizzamig might it be worth implementing a USES=electron flag to simplify creating electron-based ports?

@fabianfreyer I think this is a fantastic idea, considering the large number of ports we'll see coming into the tree once this is committed.

@yzgyyang is there a holdup on committing, or are you just testing first? If you submitted and are waiting on a committer, I can ping my mentor and see if she can poke at it, or if someone else I know with a commit bit can :)

Is there any update on adding BSD support for electron apps?

BTW, the bounty is now $800.00 after I added 50

Why is this closed? I'm happily using both Chromium and node.js on FreeBSD, so there's no technical reason Electron shouldn't be able to work here.

Oops, sorry, saw the "closed" flag for the Haiku OS post above and thought it was for this issue. -_-

@pizzamig what happened with this? It's fine if you don't want to work on it anymore but if you could let us know how far you got and what issues you faced it would be helpful!

Electron is working in FreeBSD.

The binaries are great, and I've used your VSCode binaries a bit on 11.2. It would be great to get Electron and friends into the Ports Collection though. I think that's what would effectively "complete" this issue.

Added 50$ to bounty.

โ€ฆ vscode and the actual electron binary are working on TrueOS/FreeBSD 12 (haven't tried Atom yet). โ€ฆ

Atom 1.23.0

Atom-v1.23.0_5_6.tar.xz from https://github.com/prash-wghats/Electron-VSCode-Atom-For-FreeBSD/releases/tag/atom_v1.23.0

$ date ; uname -v ; pwd
Sun 30 Sep 2018 11:31:46 BST
FreeBSD 12.0-ALPHA7 r338956 GENERIC-NODEBUG 
/home/grahamperrin
$ Applications/Atom/atom Desktop/test.txt 
Fontconfig warning: "/usr/local/etc/fonts/local.conf", line 1093: saw number, expected matrix
Attempting to call a function in a renderer window that has been closed or released.
Function provided here: worker.js:61:22
Remote event names: destroyed, crashed
$ 

The three lines after the (negligible) fontconfig warning occur when quitting the application.

https://github.com/yzgyyang/freebsd-ports-electron is a port, compatible and usable with poudriere, to build a FreeBSD package and is largely based on the great work of @prash-wghats . Without his insight, nothing would be possible.
Unfortunately, the port, as it is, cannot land to the Port Collection, it has too many tricks and things not allowed (especially the libcc and the node packages).
Currently, I'm working on an acceptable port for libcc. If you have ever build chromium from sources, you'll now why it's "time consuming".

libcc is deprecated and not used in the current build of electron, so probably not a great idea to work on a port for it :)

Having it work in ports is good and all and I agree that it is a good start but there are apps that are closed source (GitKraken for example) I would not expect to have to directly support BSD but if it is an official platform for electron then they could cross compile a BSD build. But that cannot happen until there is an official build. That's just my opinion.

I think the main hurdle currently to bring the port upstream is the chromium library. Could be wrong though, but other than that, if the patches for electron itself is brought upstream, then it should be good to go from there but there is also more to it since there is likely libraries out there that isnt built to run on BSD or isnt configured for the platform. It would still need to be work for devs to make sure any native modules can run on BSD as well. If there isnt any dependencies that make use of native modules, then it should be fine.

+1 for this! Would love to get Atom and/or VS Code running on FreeBSD. CodeLite and Eclipse are all well and good, but I'd really like to be able to develop with Atom or VS Code without having to hop into a virtual machine running Linux.

How high does the bounty need to get before someone decides to do this? $1000 USD?

Hi, I have made an experimental port of electron 4.1.x and 5.0.0 for FreeBSD. This is largely based on the works by @prash-wghats and FreeBSD chromium team. If you are interested, take a look at https://github.com/tagattie/FreeBSD-Electron.

I'm running VS Code on FreeBSD with it for a while.

@tagattie looks like that includes quite substantial changes to Chromium. Are you working with the Chromium team at all to upstream those changes? If not I'm afraid they will quickly go out of date :(

@nornagon the Readme states the patches come from the FreeBSD Chromium team.

@nornagon The FreeBSD Chromium team maintains a large set of patches, because Google doesn't accept those changes, because FreeBSD (and any other BSDs) is not a platform they're interested in.

Published a few hours ago.
https://www.freshports.org/devel/electron4/

I feel like it should be removed

On Fri, Jun 21, 2019, 8:32 PM William Penton notifications@github.com
wrote:

Not sure previous message should be removed because of personal info in
the message.

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/electron/electron/issues/3797?email_source=notifications&email_token=AA54RSDXMHOUNACH7QIWAXDP3VXJLA5CNFSM4BWQZ7BKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYJ36TY#issuecomment-504610639,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA54RSFEWQKZMQ7WYK4WOMDP3VXJLANCNFSM4BWQZ7BA
.

Agreed. It doesn't appear to be related to this thread's topic, and that level of personal info shouldn't be left in the wild.

Sent from my iPad

On Jun 21, 2019, at 18:28, Darius Clark notifications@github.com wrote:

I feel like it should be removed

On Fri, Jun 21, 2019, 8:32 PM William Penton notifications@github.com
wrote:

Not sure previous message should be removed because of personal info in
the message.

โ€•
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/electron/electron/issues/3797?email_source=notifications&email_token=AA54RSDXMHOUNACH7QIWAXDP3VXJLA5CNFSM4BWQZ7BKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYJ36TY#issuecomment-504610639,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA54RSFEWQKZMQ7WYK4WOMDP3VXJLANCNFSM4BWQZ7BA
.

โ€•
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

Thanks, can upgrade it to 6.0.x?

There's a work-in-progress branch for 5.x but nothing on 6.x so far as far as I can see.

If this is now a registered port, someone should collect the BountySource bounty.

The point of this, if I understand correctly, to have Electron be able to generate a BSD build from any other platform. For example, on a Mac you can generate a Windows EXE or a Linux Binary. This is to allow them to generate the BSD Binary, not having to run BSD and then compile from there.

+1 I would love to have atom available on FreeBSD. The bounty to fix this is 850$ now!

Might future resolution of this issue allow me to (for example) install FF Password Exporter https://github.com/kspearrin/ff-password-exporter on FreeBSD-CURRENT?

From https://pastebin.com/Z3mmYLh9 I imagine not. Line 19:

Error: GET https://github.com/electron/electron/releases/download/v3.0.6/electron-v3.0.6-freebsd-x64.zip returned 404

Background: https://github.com/MrAlex94/Waterfox/issues/1258#issuecomment-552139342

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LongChair picture LongChair  ยท  139Comments

alexeykuzmin picture alexeykuzmin  ยท  133Comments

zcbenz picture zcbenz  ยท  259Comments

LoganDark picture LoganDark  ยท  110Comments

rhysd picture rhysd  ยท  81Comments