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

Linux build links openssl dynamically #17

Closed
pmconrad opened this issue Sep 6, 2019 · 6 comments · Fixed by #18
Closed

Linux build links openssl dynamically #17

pmconrad opened this issue Sep 6, 2019 · 6 comments · Fixed by #18
Labels
bug Something isn't working

Comments

@pmconrad
Copy link
Collaborator

pmconrad commented Sep 6, 2019

See bitshares/bitshares-core#1979

Bug Description
Downloaded from https://github.com/bitshares/bitshares-core/releases/download/3.3.1/bitshares-core-3.3.1-linux-amd64-bin.tar.bz2

./witness_node: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
./cli_wallet: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
@pmconrad
Copy link
Collaborator Author

pmconrad commented Sep 6, 2019

It would be possible to create the builds with statically linked openssl (see bitshares/bitshares-core#1980). There are pros and cons though.

Pro:

  • statically linked binaries are more likely to run in different environments, due to fewer external dependencies

Con:

  • Security updates for libraries provided by the OS to not apply automatically to static binaries, whereas they do for dynamic libs.
  • Security updates for openssl would require a rebuild, and rebuilds would make the existing signatures obsolete.
  • Even worse, the build result changes after a security update, i. e. the original build result can no longer be reproduced.

We have to find a tradeoff here. Opinions @abitmore @ryanRfox ?

@abitmore
Copy link
Member

abitmore commented Sep 7, 2019

Right now I still prefer statically linking openssl.

the original build result can no longer be reproduced.

I think the original build result can still be reproduced with the original gitan setup. When rebuilding, we need to update gitan setup, since the setup is managed with git, the old configurations won't get lost.

With this in consideration, in order to reproduce the build results, we need to clearly describe what revision of bitshares-gitan is used for building the binaries in the release notes page, even mention versions of dependencies used to build the binaries.

In case when a security update is available, we need to

  • update gitan setup and rebuild,
  • upload new binaries,
  • remove old binaries,
  • update release notes,
  • add new signatures,
  • notice users of the binaries to update.

Actually this is important, but was ignored in the past. I hope we don't need to do it frequently.

@ryanRfox please invite other team members and even community members to discuss this.

@pmconrad
Copy link
Collaborator Author

pmconrad commented Sep 7, 2019

I think the original build result can still be reproduced with the original gitan setup.

Gitian automatically installs latest package versions on each run. I also believe that outdated package versions are no longer available in Ubuntu repos, so I think it would not work if we explicitly specified certain package versions for the build.

An alternative would be to do it for linux as is done for windows + mac builds - download openssl source package and use that.

I hope we don't need to do it frequently.

Static linking also puts the burden of monitoring this on us. OTOH we should keep an eye on it for win + mac anyway, as well as for the other statically linked libs (curl, boost). Sigh.

@abitmore
Copy link
Member

abitmore commented Sep 7, 2019

An alternative would be to do it for linux as is done for windows + mac builds - download openssl source package and use that.

I thought we did the same for all OS's.

@pmconrad
Copy link
Collaborator Author

pmconrad commented Sep 7, 2019

I thought we did the same for all OS's.

My approach was to use what's there and build only what's needed.

Since we have to monitor and update libraries for mac and windows binaries anyway, I think it makes sense to use the same process for linux as well.

I'm about to configure an external change notification service so notify me on changes to the following websites:

...and modify the linux build to use self-compiled openssl as well (it already builds a static libcurl). If necessary also boost.

@pmconrad
Copy link
Collaborator Author

pmconrad commented Sep 8, 2019

Found another con:

  • The location of the default CA certificates is distribution-dependent. With a static openssl we have to compile a default path into cli_wallet. Dynamic libs would use the system default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants