Skip to content

Commit

Permalink
feat/docs: implementation (#29)
Browse files Browse the repository at this point in the history
* use curl

* use curl

* comment nodejs tests

* wip

* wip

* feat: tests

* feat: tests

* feat: tests

* Update test.sh

* Update test.sh

* fix merge

* wip

* fix merge

* feat: tests

* fix merge

* fix merge

* Update test.sh

* merge

* wip: fix deps

* wip: fix deps

* wip: fix deps

* wip: fix deps

* wip: use cleanup flag

* wip: fix deps

* wip: remove build deps

* feat: clean up .tgz and create distributable

* fix: release dir

* fix: tarball packaging

* revert

* add: .tgz tests

* feat: change static linking of shared libs

* fix: shared lib links

* fix: lib name

* wip: python deps

* wip: python deps

* wip: python deps

* wip: python deps

* fix: lib regex

* fix: lib regex

* fix: lib regex

* fix: dir path

* fix: dir path

* add: README

* add: master

* fix: merge

* fix: copy path

* fix: remove path manipulation

* m post release

* update readme

* update tests

* wip: use custom metacall.rb

* docs: add implementation

* Update build.sh

* Update ci.yml

---------

Co-authored-by: Vicente Eduardo Ferrer Garcia <[email protected]>
  • Loading branch information
FirePing32 and viferga authored Sep 3, 2024
1 parent 29c69de commit ba0abb3
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,37 @@ This repository contains shell scripts to generate MetaCall binaries for MacOS.
- `test.sh`: Runs various tests against MetaCall
- `./tests`: Includes language specific tests

## Implementation

This brew formulae compiles MetaCall core for ARM64 and AMD64. The installation process has been optimized to install the dependencies in a dynamic way.

- Enhanced Python setup process
- Support for detecting Python version and location dynamically.
- Improved handling of Python paths for both macOS and Linux systems.

- Refined NodeJS installation
- Installs node executable and other shared libraries separately instead of a brew dependency
- Bash completion for NPM

- Enhanced Metacall launcher:
- Added more robust path detection for metacallcli based on the dsitributable type

The final distributable is generated using a Homebrew extension [`brew-pkg`](https://github.com/metacall/brew-pkg). It generates a installable `.pkg` and a portable `.tgz` file. The fork includes some extra features which have been described below.

1. **Recursive library patching**: The function recursively processes linked libraries.

2. **Dynamic linking**: Uses `@executable_path` to create relative paths for dynamic linking.

3. **ELF file validation**: Checks if the target binary is a valid ELF (Executable and Linkable Format) file.

4. **Library dependency analysis**: Uses `otool -L` to identify linked libraries for the given binary.

5. **Path filtering**: Filters library paths to only process those within the specified prefix path.

6. **Relative path calculation**: Computes relative paths between the binary and its linked libraries.

7. **Library path updating**: Uses `install_name_tool` to update library paths in the binary.

## Usage

MetaCall supports `ARM64` and `AMD64` architectures at the moment.
Expand Down

0 comments on commit ba0abb3

Please sign in to comment.