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

fix(build) Refactor build.rs to better handle old glibc #16238

Merged
merged 4 commits into from
Oct 15, 2022

Conversation

LukeChannings
Copy link
Contributor

Follow-up to #16208.

  • Refactors build.rs behaviour to use -exported_symbols_list / --export-dynamic-symbol-list
  • Since all build systems now rely on a symbols list file, I have added generate_exported_symbols_list, which derives the symbol list file depending on the platform, which makes tools/napi/generate_link_win.js redundant.
  • Fixes a missed instance of i8 being used instead of c_char

@LukeChannings
Copy link
Contributor Author

@littledivy

@LukeChannings LukeChannings changed the title Refactor build.rs to better handle old glibc fix(build) Refactor build.rs to better handle old glibc Oct 10, 2022
@ry
Copy link
Member

ry commented Oct 10, 2022

@LukeChannings What version of glibc does it support with this? It would be great if this allowed us to run on glibc 2.23 (Ubuntu 16)

@LukeChannings
Copy link
Contributor Author

@LukeChannings What version of glibc does it support with this? It would be great if this allowed us to run on glibc 2.23 (Ubuntu 16)

Seems to work fine against the ubuntu:16.04 docker image, tested against aarch64 only, see output below.

root@09bae5bd899f:/deno# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.7 LTS"
root@09bae5bd899f:/deno# ./target/
release/ tmp/
root@09bae5bd899f:/deno# ./target/release/
.fingerprint/    deno             examples/        incremental/     libnapi_sym.so   libtest_napi.so
build/           deps/            gn_out/          libdeno_ops.so   libtest_ffi.so   test_server
root@09bae5bd899f:/deno# ./target/release/deno --version
deno 1.26.1 (release, aarch64-unknown-linux-gnu)
v8 10.7.193.13
typescript 4.8.3
root@09bae5bd899f:/deno# ldd --version
ldd (Ubuntu GLIBC 2.23-0ubuntu11.3) 2.23
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
root@09bae5bd899f:/deno# uname -am
Linux 09bae5bd899f 5.10.124-linuxkit #1 SMP PREEMPT Thu Jun 30 08:18:26 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
root@09bae5bd899f:/deno#

Copy link
Member

@littledivy littledivy left a comment

Choose a reason for hiding this comment

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

@LukeChannings Thank you for looking into this. The symbol generation script was there to avoid doing this at build-time since its very rarely updated. Can we generalize generate_link_win.js for Linux and macOS?

The glibc check LGTM

@ry ry requested a review from piscisaureus October 11, 2022 05:23
@LukeChannings
Copy link
Contributor Author

LukeChannings commented Oct 11, 2022

Can we generalize generate_link_win.js for Linux and macOS?

@littledivy I can look into it. Are we ok with having it output three separate files?

I'd probably end up with lib/cli/generated_symbol_exports_list_{windows,macos,linux}.def.

@LukeChannings
Copy link
Contributor Author

@littledivy Can I get another review?

Copy link
Member

@littledivy littledivy left a comment

Choose a reason for hiding this comment

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

LGTM!

… image, lowering the glibc requirement to version 2.23
@littledivy littledivy merged commit fa22956 into denoland:main Oct 15, 2022
littledivy added a commit that referenced this pull request Oct 16, 2022
bartlomieju pushed a commit that referenced this pull request Oct 17, 2022
Follow-up to #16208.

- Refactors build.rs behaviour to use `-exported_symbols_list` /
`--export-dynamic-symbol-list`
- Since all build systems now rely on a symbols list file, I have added
`generate_exported_symbols_list`, which derives the symbol list file
depending on the platform, which makes `tools/napi/generate_link_win.js`
redundant.
- Fixes a missed instance of `i8` being used instead of `c_char`

Co-authored-by: Divy Srivastava <[email protected]>
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

Successfully merging this pull request may close these issues.

None yet

4 participants