Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I link a custom compiled libchromiumcontent with Electron? #2023

Closed
frankhale opened this issue Jun 21, 2015 · 13 comments
Closed

How do I link a custom compiled libchromiumcontent with Electron? #2023

frankhale opened this issue Jun 21, 2015 · 13 comments

Comments

@frankhale
Copy link
Contributor

I'm hesitant to post this here but there is little chatter in the #atom-shell IRC channel and I don't know if the Electron channel on discuss.atom.io would be the appropriate place for this.

I have a need to patch libchromiumcontent and link it with Electron but I currently don't know how to do that. The build.py for Electron assumes I'm going to download a precompiled version. I've successfully compiled a custom libchromiumcontent and just need some pointers on how to take that and run build.py on Electron so that it links in my custom version.

When I look at the libchromiumcontent module in the vendor folder in Brightray it doesn't contain all of the same files so I don't know if I can just dump in my compiled fork there. Is that how it'd be done?

I think once this development workflow is mentioned here it would be great to put this as an additional development document so that others wishing to do some hard core development or help out could easily reference it to get started.

@frankhale
Copy link
Contributor Author

Actually I think I should just replace the libchromiumcontent module in the vendor folder of Brightray with the one I've compiled.

@frankhale
Copy link
Contributor Author

Actually on second thought I don't think this is the way to do it. It seems it doesn't matter what is in the Brightray folder because bootstrapping Electron will just use what it downloads instead of using what I put there.

@frankhale
Copy link
Contributor Author

This looks promising ->

electron\vendor\brightray\vendor\download\libchromiumcontent

rather than

electron\vendor\brightray\vendor\libchromiumcontent

Looks like doing a python script\create-dist.py is what I need to do in libchromiumcontent and then dump it in the first directory I listed above.

@hokein
Copy link
Contributor

hokein commented Jun 21, 2015

You can use the script/create-dist.py to make distributions for your custom libchromiumcontent, and unzip it to electron/vendor/brightray/vendor/download/libchromiumcontent dir.

It seems it doesn't matter what is in the Brightray folder because bootstrapping Electron will just use what it downloads instead of using what I put there.

The boostrap.py script will checkout the libchromiumcontent version everytime it runs. So you need to disable the download part of code in electron/vendor/brightray/vendor/libchromiumcontent/script/download.

@frankhale
Copy link
Contributor Author

Thank you! I'm doing a create-dist right now. I'll disable the download as well.

@frankhale
Copy link
Contributor Author

Looks like I still have some stuff to learn. Even though I am able to compile libchromiumcontent from master I am not able to get it to link against Electron 0.28.2. I've tried multiple times. I'll try again tomorrow. I can get Electron 0.28.2 to build fine against the libchromiumcontent it's expecting and that it downloads but not with my hand compiled one.

In the morning I'll delete all the code, clone it again and start over. Hopefully whatever is going wrong will work itself out.

@hokein
Copy link
Contributor

hokein commented Jun 21, 2015

@frankhale
Instead of building the master branch of libchromiumcontent, you should build the atom branch, which is used in Electron.

@frankhale
Copy link
Contributor Author

HAHA, I didn't even look at the branches. Thank you! I will definitely give this a shot in the morning. Hopefully my luck will be better. =)

@frankhale
Copy link
Contributor Author

@hokein, this worked well for me. Thanks!

@frankhale
Copy link
Contributor Author

Is it customary to write a libchromiumcontent patch, recompile, create dist, move dist to Electron's code, recompile Electron to test? Because that process is very time consuming. I'm okay with it but I want to make sure that I am not shooting myself in the foot.

@hokein
Copy link
Contributor

hokein commented Jun 22, 2015

I suppose you have to do it if you customize libchromiumcontent.

@frankhale
Copy link
Contributor Author

No worries, just wanted to see if I was doing something really crazy.

@zcbenz
Copy link
Member

zcbenz commented Jun 23, 2015

There is a -u option in bootstrap.py that can be used to custom the location of libchromiumcontent. This is what I usually do:

$ cd /path/to/libchromiumcontent
$ ./script/create-dist
$ mkdir -p win/x64/thecommithashusedbyelectron
$ mv libchromiumcontent* win/x64/thecommithashusedbyelectron
$ cd /path/to/electron
$ ./script/bootstrap.py -v -u file:///path/to/libchromiumcontent/

If the bootstrap script fails you need to check if thecommithashusedbyelectron matches the one used by electron.

It sucks but since I rarely test electron with custom libchromiumcontent it works fine for me so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants