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

libcef: init at 51.0.2704.47-1414 #15648

Closed
wants to merge 1 commit into from
Closed

Conversation

abbradar
Copy link
Member

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • OS X
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

I've packaged it some time ago but haven't found any use of it in the end. I'm not sure if it works correctly but I see no reason it won't. This can be useful for #10452 for example. Credits to @aszlig -- this was based on his work.

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @aszlig, @edolstra and @Eternity-Yarr to be potential reviewers

@abbradar abbradar mentioned this pull request May 23, 2016
@aszlig
Copy link
Member

aszlig commented May 25, 2016

Very cool, will review this tomorrow! Thanks in advance already :-)

@abbradar
Copy link
Member Author

I've updated this -- moved libcef to a separate directory and built chrome-sandbox and resources. Should be good, although I haven't tested this with nix-build yet.

# Run "git rev-list --count HEAD" to get this number
cefVersion = "1414";
# from CHROMIUM_BUILD_COMPATIBILITY.txt
upstreamVersion = "51.0.2704.47";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that an update of Chromium will potentially break libcef as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, and sadly there's no way around -- each libcef revision is bound to a specific chromium version.

Copy link
Member

@aszlig aszlig May 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, so it probably might make sense to add it to the updater. However I'm not sure on how to namespace it properly, because if the chromium updater also updates libcef it might get confusing, so it's probably better to move the updater out of the chromium directory, as it's not only used for Chromium, but also for Chrome and now libcef, so we should pick an appropriate name for it.

However, we can still decide on that at some later point.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to merge #15762 very soon, so I think this will break libcef. Can you please test building libcef after the merge is done? I'll Cc you in the merge commit so that you'll get notified.

@abbradar
Copy link
Member Author

Overall it may prove fairly useless to us -- for example, it's too new for Unity3D (which I've packaged per friend's request -- PR is coming) and causes segfaults, and a version which would be good for it doesn't support userns yet. If there're another use cases for it, good.

'';

dontAddPrefix = true;
configureScript = "python build/gyp_chromium";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I'm not sure whether this is a good idea, because the configurePhase from stdenv does a lot of other things than just adding --prefix (for example fixing libtool or add other flags if desired). I think it's better to not only use $gypFlags as a builder environment variable but also add something like $gypScript and $gypBasePath (or similar name) which can be overridden in the libcef attributes.

Copy link
Member Author

@abbradar abbradar May 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, we can just make our own configurePhase:

  runHook preConfigure
  python build/gyp_chromium -f ninja $gypScript $gypFlags
  runHook postConfigure

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, or just call it $gypFlags because even -f ninja and -I are gyp flags already.

@aszlig
Copy link
Member

aszlig commented May 26, 2016

Other than that, the implementation looks good to me and I'm going to test/merge it by tomorrow or (more likely) on Monday. If you're impatient, you can also merge it by yourself.

@abbradar
Copy link
Member Author

New version -- I've now built cefclient in a separate output and verified that everything works. I've also changed things according to our previous discussion.

@aszlig
Copy link
Member

aszlig commented May 28, 2016

Hm, in case of Unity3D, we could make sure that we build a version which matches with their ancient version. Is there a way to automatically retrieve the libcef version they're using within Unity3D so that we could write an updater for it?

@abbradar
Copy link
Member Author

About Unity: Yes we can, but there's a problem -- I cannot understand how can we actually find "commit number" which serves as libcef's version. From the code they calculate this with git rev-list --count HEAD, but the numbers that I get are a lot smaller than returned by Unity 3D's libcef, even while we can check the bundled Chromium version and definitely conclude that it's older. I suppose that it should be calculated with some different way.

But this won't help us because Unity requires such an old libcef that it doesn't support user namespaces at all (they were included in chromium 43 IIUC (see MovedFrom), and Unity bundles 37).

@aszlig
Copy link
Member

aszlig commented May 28, 2016

@abbradar: We can use my old user namespace patch, which works in version 36 and 37: 536feff

@abbradar
Copy link
Member Author

Nice! So, the only problem is "how to find out version which Unity actually uses"... or rather "how to find out version which we built", because those git rev-list --count numbers are way smaller than those from Unity or in libcef documentation.

@abbradar
Copy link
Member Author

I've updated libcef and also included a simple updater script which also tries to auto-detect needed Chromium package.

@abbradar abbradar mentioned this pull request May 29, 2016
7 tasks
@gilligan gilligan mentioned this pull request Jan 2, 2017
@matthewbauer
Copy link
Member

matthewbauer commented Jan 4, 2017

👍 This looks good. The merge conflicts should be trivial.

I think we should be able to use this to build "Brackets" which is currently just using a binary blob. Similarly, "libchromiumcontent" should be buildable using this same method and enable us to build Electron from source.

@the-kenny
Copy link
Contributor

Any update on this?

@abbradar
Copy link
Member Author

This seems to work but I haven't tried to actually use it for anything which is a main problem. I lost motivation to try to build something that uses libcef from source -- everything that I looked at had horrible build systems which I didn't want to mess with (I don't remember details nor specific projects).

@abbradar
Copy link
Member Author

abbradar commented Feb 8, 2017

I've refreshed this PR and split most unrelated changes to #22568. libcef also works (it can be tested with cefclient); if someone wants it in nixpkgs it can be safely merged I think.

@fpletz fpletz changed the title (WIP) libcef: init at 51.0.2704.47-1414 libcef: init at 51.0.2704.47-1414 Aug 15, 2017
@ryantm
Copy link
Member

ryantm commented Nov 18, 2017

@abbradar I am trying to package the new minecraft launcher (work in progress branch: https://github.com/ryantm/nixpkgs/tree/minecraft ) and ldd result/share/minecraft/launcher says it needs libcef.so, so I would like to see it in nixpkgs. I tried cherry picking this commit and depending on libcef, and an assertion failed:

ryantm@laptop2 ~/p/nixpkgs (minecraft)$ nix-build -A pkgs.minecraft --show-trace
error: while evaluating the attribute ‘installPhase’ of the derivation ‘minecraft-2.0.579’ at /home/ryantm/p/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:98:11:
while evaluating ‘makeSearchPathOutput’ at /home/ryantm/p/nixpkgs/lib/strings.nix:94:42, called from /home/ryantm/p/nixpkgs/pkgs/games/minecraft/default.nix:58:22:
while evaluating ‘makeSearchPath’ at /home/ryantm/p/nixpkgs/lib/strings.nix:84:28, called from /home/ryantm/p/nixpkgs/lib/strings.nix:94:48:
while evaluating anonymous function at /home/ryantm/p/nixpkgs/lib/strings.nix:85:32, called from undefined position:
while evaluating the attribute ‘version’ of the derivation ‘cef-63.0.3239.40’ at /home/ryantm/p/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:98:11:
assertion failed at /home/ryantm/p/nixpkgs/pkgs/development/libraries/libcef/default.nix:19:13

@matthewbauer
Copy link
Member

👍 for merging (after updating chromiumVersion of course)

@ryantm
Copy link
Member

ryantm commented Nov 19, 2017

I tried running cef-update.sh but the version of Chromium libcef supports is slightly different from what we have in nixpkgs, so it fails.

Copy link
Member

@ryantm ryantm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't merge currently. We also need to figure out the updater.

@aszlig aszlig removed their assignment Mar 16, 2019
@c0bw3b
Copy link
Contributor

c0bw3b commented May 18, 2019

Stalled, but feel free to come up with a new PR

@c0bw3b c0bw3b closed this May 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants