chakra-core / chakra-core/ChakraCore
Confirm how dynamically built `ch` binary looks for the library
- Dominant language
- JavaScript
- Stars
- 9.3k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
It seems to me that, under Linux/macOS, dynamically built `ch` binary will only looks for the dynamic library (`libChakraCore.so`/`libChakraCore.dylib`) under the same directory as the binary itself.
However, Linux/macOS usually put binaries and libraries under different directories (`bin` and `lib`).
If that's the case, when packaging ChakraCore for Linux and macOS, we have to build two times in order to get the dynamic library and a usable (statically built) `ch` binary.
I provide patches to build scripts for ArchLinux and Homebrew (macOS):
1. https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=chakracore (line 21-22)
2. https://github.com/MikeChou/homebrew-core/blob/5823ffee6bafe925a8bc2ab53f500ae6489542f4/Formula/chakra.rb#L29-L30
If `ch` can look for the dynamic library according to the environment vairable `LD_LIBRARY_PATH` or some other standard mechanism, there will be no need to build the binary a second time for this purpose alone, hence will save time and disk space.
Contributor guide
Research direction
Start by reproducing the dynamically built `ch` packaging setup described in the ArchLinux `PKGBUILD` and Homebrew `chakra.rb` links, placing the binary and library in separate directories on Linux and macOS. Check how the runtime locates `libChakraCore.so` or `libChakraCore.dylib`; done means documenting the confirmed behavior and establishing whether standard library search paths allow packaging without a second build.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, linux, macos
- Domain
- build-system, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100