Skip to content

Upgrade openssl, selectors, and cocoa - #6740

Merged
bors-servo merged 1 commit into
servo:masterfrom
mbrubeck:bitflags
Jul 30, 2015
Merged

bors-servo merged 1 commit into
servo:masterfrom
mbrubeck:bitflags

Conversation

@mbrubeck

Copy link
Copy Markdown
Contributor

This lets Servo use one version of bitflags for all dependencies.

r? @larsbergstrom or @Ms2ger

Review on Reviewable

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jul 24, 2015
@hoppipolla-critic-bot

Copy link
Copy Markdown

Critic review: https://critic.hoppipolla.co.uk/r/5645

This is an external review system which you may optionally use for the code review of your pull request.

In order to help critic track your changes, please do not make in-place history rewrites (e.g. via git rebase -i or git commit --amend) when updating this pull request.

@larsbergstrom

Copy link
Copy Markdown
Contributor

@bors-servo: r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 68b8060 has been approved by larsbergstrom

@jdm jdm added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Jul 25, 2015
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 68b8060 with merge c9d4e72...

bors-servo pushed a commit that referenced this pull request Jul 25, 2015
Upgrade openssl, selectors, and cocoa

This lets Servo use one version of bitflags for all dependencies.

r? @larsbergstrom or @Ms2ger

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6740)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - gonk

@bors-servo

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #6616) made this pull request unmergeable. Please resolve the merge conflicts.

@jdm

jdm commented Jul 25, 2015

Copy link
Copy Markdown
Member
error: linking with `./fake-ld.sh` failed: exit code: 1
[linker command line elided for brevity]
note: /home/servo/.cargo/registry/src/github.com-0a35038f75765ae4/openssl-0.6.4/src/bio/mod.rs:63: error: undefined reference to 'BIO_set_mem_eof_return_shim'
/home/servo/.cargo/registry/src/github.com-0a35038f75765ae4/openssl-0.6.4/src/bio/mod.rs:75: error: undefined reference to 'BIO_eof_shim'
/home/servo/.cargo/registry/src/github.com-0a35038f75765ae4/openssl-0.6.4/src/ssl/mod.rs:452: error: undefined reference to 'SSL_CTX_set_read_ahead_shim'
/home/servo/.cargo/registry/src/github.com-0a35038f75765ae4/openssl-0.6.4/src/ssl/mod.rs:700: error: undefined reference to 'SSL_set_tlsext_host_name_shim'
collect2: error: ld returned 1 exit status

error: aborting due to previous error
Could not compile `b2s`.

@jdm jdm added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jul 25, 2015
@mbrubeck

Copy link
Copy Markdown
Contributor Author

It looks like the gonk build was broken by rust-openssl/rust-openssl@d0b769c. I'm not sure why the linker arguments passed to fake-ld.sh don't include the openssl-sys out directory or the openssl_shim library.

@mbrubeck

Copy link
Copy Markdown
Contributor Author

Possibly related to this override in ports/gonk/.cargo/config?

[target.arm-linux-androideabi.openssl]
rustc-flags = "-l crypto -l ssl"

@mbrubeck

Copy link
Copy Markdown
Contributor Author

More details on the Gonk problem:

The openssl-sys crate includes a small C library called openssl_shim which wraps some functions from OpenSSL. In older versions of openssl-sys, this shim was needed only for compatibility with old versions of OpenSSL. But in the latest version of openssl-sys, the shim is needed regardless of OpenSSL version.

The shim depends on preprocessor macros defined in the OpenSSL headers. The B2G "obj" directory we use in our Gonk build has compiled OpenSSL libraries, but it does not have the OpenSSL headers. This causes errors when building the shim.

We previously worked around the lack of headers by overriding the build script in ports/gonk/.cargo/config, which just skips building the shim. However, in the latest version, the shim is required. Skipping it causes the above errors at link time.

Possible solutions:

  • Get the necessary header files for the OpenSSL libraries in our B2G build dir, and enable the shim (remove the override from ports/gonk/.cargo/config).
  • Revert rust-openssl/rust-openssl@d0b769c and move the shimmed macros back into Rust code.
  • If we don't actually depend on any of the shimmed functions, we could hide them behind an optional feature in openssl-sys and disable this in Servo.

@metajack metajack added the S-needs-rebase There are merge conflict errors. label Jul 29, 2015
@metajack

Copy link
Copy Markdown
Collaborator

pinging @sfackler

Also, this was discussed at the meeting, but the result was not recorded here. I think that @Manishearth had suggested getting the headers in the right place. What will that take?

@larsbergstrom

Copy link
Copy Markdown
Contributor

Oh, yeah, sorry - I was talking, so I think it got missed in the meeting minutes.

I lost my B2G build (I accidentally broke the linux VM image), but if we make a new one we should be able to add those files to the instructions:

tar zcf B2G.tgz B2G/bionic B2G/system B2G/frameworks/native/opengl/include B2G/external/zlib B2G/hardware/libhardware/include/hardware B2G/ndk/sources/cxx-stl B2G/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7 B2G/out/target/product/flame/obj/ B2G/prebuilts/ndk/9/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/
larsberg@ubuntu:/mnt/more$ s3cmd put B2G.tgz s3://servo-rust/B2G/B2G.tgz

@sfackler

Copy link
Copy Markdown

There's actually a second shim to handle mapping the SSL_OP_* constants since their values change based on the openssl version: https://github.com/sfackler/rust-openssl/blob/master/openssl-sys/build.rs#L77.

If you're okay keeping precompiled binaries around, one option would be to add a OPENSSL_SHIM_PATH environment variable that'd allow you to point the buildscript to a prebuilt version of the shim.

@larsbergstrom

Copy link
Copy Markdown
Contributor

I've added the openssl headers. They should be in B2G/external/openssl/include/openssl.

@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Jul 30, 2015
@mbrubeck mbrubeck removed the S-needs-rebase There are merge conflict errors. label Jul 30, 2015
@mbrubeck

Copy link
Copy Markdown
Contributor Author

r? @larsbergstrom

@larsbergstrom

Copy link
Copy Markdown
Contributor

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit a13e237 has been approved by larsbergstrom

@mbrubeck

Copy link
Copy Markdown
Contributor Author

@bors-servo r=larsbergstrom

(Forgot to "git add" a few more lines of Cargo.lock changes)

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 63d39a4 has been approved by larsbergstrom

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 63d39a4 with merge df722ec...

bors-servo pushed a commit that referenced this pull request Jul 30, 2015
Upgrade openssl, selectors, and cocoa

This lets Servo use one version of bitflags for all dependencies.

r? @larsbergstrom or @Ms2ger

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6740)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, gonk, linux1, linux2, linux3, mac1, mac2, mac3

@bors-servo
bors-servo merged commit 63d39a4 into servo:master Jul 30, 2015
@mbrubeck
mbrubeck deleted the bitflags branch May 11, 2016 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-review There is new code that needs to be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants