├── .dockerignore ├── .github └── workflows │ └── ci.yml ├── .gitignore ├── AUTHORS ├── CONTRIBUTORS ├── Dockerfile ├── LICENSE ├── Makefile ├── README.md ├── channels └── channels.scm ├── out └── .gitkeep ├── scripts ├── build.sh └── deps.sh ├── source └── metacall.scm └── tests ├── backtrace ├── Dockerfile └── test.c ├── c ├── Dockerfile └── test.c ├── cli └── Dockerfile ├── exe └── Dockerfile ├── node ├── Dockerfile └── test.js ├── python ├── Dockerfile └── script.py ├── ruby ├── Dockerfile ├── Gemfile └── script.rb ├── scripts ├── fib.ts ├── mult.rb ├── port-test.js ├── port-test.py ├── port-test.rb ├── say.cs └── sum.py ├── tsx ├── Dockerfile ├── package-lock.json ├── package.json ├── test.tsx └── tsconfig.json └── typescript └── Dockerfile /.dockerignore: -------------------------------------------------------------------------------- 1 | ** 2 | !scripts 3 | !source 4 | !channels 5 | !out 6 | !tests 7 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: "MetaCall Distributable Linux" 2 | 3 | on: 4 | workflow_dispatch: 5 | pull_request: 6 | push: 7 | tags: 8 | - 'v*.*.*' 9 | branches: 10 | - master 11 | 12 | env: 13 | GHR_VERSION: 0.17.0 14 | # GITHUB_TOKEN - From default secrets 15 | # GITHUB_REPOSITORY - Default variable 16 | 17 | jobs: 18 | build: 19 | name: Build and Package 20 | runs-on: ubuntu-latest 21 | 22 | strategy: 23 | fail-fast: false 24 | matrix: 25 | build: [ 26 | { mode: debug, suffix: "-dbg" }, 27 | { mode: release, suffix: "" } 28 | ] 29 | arch: [amd64, 386] 30 | 31 | steps: 32 | - name: Set up QEMU 33 | uses: docker/setup-qemu-action@v3 34 | if: ${{ matrix.arch != 'amd64' }} 35 | with: 36 | platforms: all 37 | 38 | - name: Set up Docker Buildx 39 | uses: docker/setup-buildx-action@v3 40 | 41 | - name: Check out the repo 42 | uses: actions/checkout@v4 43 | 44 | - name: Build tarball 45 | run: | 46 | make PLATFORM=${{ matrix.arch }} BUILD=${{ matrix.build.mode }} base pull deps build 47 | mv out/tarball.tar.gz out/metacall-tarball-linux-${{ matrix.arch }}${{ matrix.build.suffix }}.tar.gz 48 | 49 | - name: Upload tarball artifact 50 | uses: actions/upload-artifact@v4 51 | with: 52 | name: tarball-${{ matrix.arch }}-${{ matrix.build.mode }} 53 | path: out/metacall-tarball-linux-${{ matrix.arch }}${{ matrix.build.suffix }}.tar.gz 54 | 55 | - name: Test 56 | run: | 57 | mv out/metacall-tarball-linux-${{ matrix.arch }}${{ matrix.build.suffix }}.tar.gz out/tarball.tar.gz 58 | make PLATFORM=${{ matrix.arch }} BUILD=${{ matrix.build.mode }} test 59 | 60 | - name: Clear 61 | run: | 62 | set -exuo pipefail 63 | make clear 64 | 65 | publish-github: 66 | name: Publish on GitHub 67 | runs-on: ubuntu-latest 68 | needs: build 69 | if: startsWith(github.ref, 'refs/tags/v') 70 | 71 | steps: 72 | - name: Check out the repo 73 | uses: actions/checkout@v4 74 | with: 75 | fetch-depth: 0 76 | 77 | - name: Download tarball artifacts for all architectures 78 | uses: actions/download-artifact@v4 79 | with: 80 | merge-multiple: true 81 | path: out/ 82 | 83 | - name: Load GHR binary 84 | run: | 85 | curl -sL https://github.com/tcnksm/ghr/releases/download/v${GHR_VERSION}/ghr_v${GHR_VERSION}_linux_amd64.tar.gz | tar zx 86 | chmod +x ghr_v${GHR_VERSION}_linux_amd64/ghr 87 | mv ghr_v${GHR_VERSION}_linux_amd64/ghr /usr/local/bin 88 | 89 | - name: Export variables 90 | run: | 91 | set -exo pipefail 92 | echo "GH_REPO_OWNER=${GITHUB_REPOSITORY_OWNER}" >> $GITHUB_ENV 93 | echo "GH_REPO_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV 94 | echo "CI_COMMIT_SHA=${{ github.sha }}" >> $GITHUB_ENV 95 | export PREVIOUS_TAG=$(git describe HEAD^1 --abbrev=0 --tags) 96 | echo "PREVIOUS_TAG=${PREVIOUS_TAG}" >> $GITHUB_ENV 97 | echo "GIT_HISTORY<> $GITHUB_ENV 98 | echo "$(git log --no-merges --format="- %s" ${PREVIOUS_TAG}..HEAD)" >> $GITHUB_ENV 99 | echo "EOF" >> $GITHUB_ENV 100 | 101 | - name: Publish package to GitHub Releases 102 | run: | 103 | set -exo pipefail 104 | if [[ "${PREVIOUS_TAG}" == "" ]]; then export GIT_HISTORY=$(git log --no-merges --format="- %s"); fi 105 | export CI_COMMIT_TAG="${{ github.ref_name }}" 106 | export RELEASE_DATE=$(date '+%Y-%m-%d') 107 | echo "MetaCall Distributable Linux ${CI_COMMIT_TAG} [${RELEASE_DATE}] - ${GH_REPO_OWNER}/${GH_REPO_NAME}:${CI_COMMIT_SHA}" && echo "${GIT_HISTORY}" 108 | ghr -t "${{ secrets.GITHUB_TOKEN }}" -u "${GH_REPO_OWNER}" -r "${GH_REPO_NAME}" -c "${CI_COMMIT_SHA}" -n "MetaCall Distributable Linux ${CI_COMMIT_TAG} [${RELEASE_DATE}]" -b "${GIT_HISTORY}" -replace "${CI_COMMIT_TAG}" "${PWD}/out/" 109 | 110 | install-test: 111 | name: Trigger Install Test Workflow 112 | runs-on: ubuntu-latest 113 | needs: publish-github 114 | if: startsWith(github.ref, 'refs/tags/v') 115 | steps: 116 | - uses: convictional/trigger-workflow-and-wait@v1.6.5 117 | with: 118 | owner: metacall 119 | repo: install 120 | github_token: ${{ secrets.G_PERSONAL_ACCESS_TOKEN }} 121 | workflow_file_name: test-linux.yml 122 | wait_workflow: true 123 | ref: master 124 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore output folder 2 | out/* 3 | !out/.gitkeep 4 | 5 | # GitHub Auth 6 | .netrc 7 | 8 | # VSCode 9 | .vscode 10 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | 2 | Vicente Eduardo Ferrer Garcia 3 | -------------------------------------------------------------------------------- /CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | 2 | Tobias Geerinckx-Rice 3 | Hadi Azami 4 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # MetaCall Distributable by Parra Studios 3 | # Distributable infrastructure for MetaCall. 4 | # 5 | # Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | FROM metacall/guix:latest AS distributable 21 | 22 | # Image descriptor 23 | LABEL copyright.name="Vicente Eduardo Ferrer Garcia" \ 24 | copyright.address="vic798@gmail.com" \ 25 | maintainer.name="Vicente Eduardo Ferrer Garcia" \ 26 | maintainer.address="vic798@gmail.com" \ 27 | vendor="MetaCall Inc." \ 28 | version="0.1" 29 | 30 | COPY / /metacall/ 31 | 32 | RUN chmod +x /metacall/scripts/build.sh \ 33 | && chmod +x /metacall/scripts/deps.sh \ 34 | && mkdir -p /metacall/pack \ 35 | && mv /metacall/channels/channels.scm /root/.config/guix/channels.scm 36 | 37 | CMD ["sh"] 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2016-2025 Vicente Eduardo Ferrer Garcia 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # MetaCall Distributable by Parra Studios 3 | # Distributable infrastructure for MetaCall. 4 | # 5 | # Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | .PHONY: all download base pull deps build test help default 21 | 22 | # Define platform 23 | ifdef PLATFORM 24 | PLATFORM_ARGS := --platform=linux/${PLATFORM} 25 | endif 26 | 27 | # Define build mode (debug or release, by default release) 28 | ifdef BUILD 29 | BUILD_ARGS := ${BUILD} 30 | else 31 | BUILD_ARGS := release 32 | endif 33 | 34 | # Default target 35 | default: all 36 | 37 | # All targets 38 | all: 39 | @$(MAKE) clear 40 | @$(MAKE) base 41 | @$(MAKE) pull 42 | @$(MAKE) deps 43 | @$(MAKE) build 44 | @$(MAKE) test 45 | 46 | # Show help 47 | help: 48 | @echo 'Management commands for metacall-distributable:' 49 | @echo 50 | @echo 'Usage:' 51 | @echo ' make download Downloads MetaCall latest version, extracts the checksum and updates it in metacall.scm.' 52 | @echo ' make base Builds base image with MetaCall scripts.' 53 | @echo ' make pull Updates Guix repository to the latest version.' 54 | @echo ' make deps Build dependency images for caching the runtimes.' 55 | @echo ' make build Build the tarball for all platforms and architectures.' 56 | @echo ' make test Run integration tests for the already built tarballs.' 57 | @echo ' make clear Clear all containers and images.' 58 | @echo ' make help Show verbose help.' 59 | @echo 60 | 61 | # Update MetaCall source 62 | download: 63 | # Get latest tag from the repository 64 | $(eval LATEST_TAG := $(shell git ls-remote --tags https://github.com/metacall/core.git | sort -t '/' -k 3 -V | tail -n1 | sed 's/.*\///; s/\^{}//')) 65 | # Download the source and extract the checksum 66 | $(eval CHECKSUM := $(shell docker run --rm --privileged -it metacall/guix guix download https://github.com/metacall/core/archive/${LATEST_TAG}.tar.gz | tail -n1)) 67 | # Get latest version 68 | $(eval LATEST_VERSION := $(shell printf "${LATEST_TAG}" | tail -c +2)) 69 | # Print version and checksum 70 | @echo "${LATEST_VERSION} ${CHECKSUM}" 71 | # Update MetaCall source with latest version 72 | @sed -i '/(name "metacall")/!b;n;c\ (version "${LATEST_VERSION}")' source/metacall.scm 73 | # Update MetaCall source with checksum 74 | @sed -i '/"https:\/\/github.com\/metacall\/core\/archive\/v" version ".tar.gz"))/!b;n;c\ (sha256 (base32 "${CHECKSUM}"))))' source/metacall.scm 75 | 76 | # Build base Docker image 77 | base: 78 | # Clear the container 79 | @docker stop metacall_distributable_linux 2> /dev/null || true 80 | @docker rm metacall_distributable_linux 2> /dev/null || true 81 | # Build the base image 82 | @docker buildx build ${PLATFORM_ARGS} -t metacall/distributable_linux --load -f Dockerfile . 83 | 84 | # Pull latest version of Guix 85 | pull: 86 | # Clear the container 87 | @docker stop metacall_distributable_linux 2> /dev/null || true 88 | @docker rm metacall_distributable_linux 2> /dev/null || true 89 | # Install the additional channels and pull 90 | @docker run ${PLATFORM_ARGS} --privileged --name metacall_distributable_linux metacall/distributable_linux sh -c 'guix pull' 91 | @docker commit metacall_distributable_linux metacall/distributable_linux 92 | @docker rm -f metacall_distributable_linux 93 | @echo "Done" 94 | 95 | # Build deps 96 | deps: 97 | # Clear the container 98 | @docker stop metacall_distributable_linux 2> /dev/null || true 99 | @docker rm metacall_distributable_linux 2> /dev/null || true 100 | # Patch the source (metacall.scm) with latest version 101 | @docker run ${PLATFORM_ARGS} -v `pwd`/source:/metacall/patch --privileged --name metacall_distributable_linux metacall/distributable_linux cp /metacall/patch/metacall.scm /metacall/source/metacall.scm 102 | @docker commit metacall_distributable_linux metacall/distributable_linux 103 | @docker rm -f metacall_distributable_linux 104 | # Patch the script (deps.sh) with latest version 105 | @docker run ${PLATFORM_ARGS} -v `pwd`/scripts:/metacall/patch --privileged --name metacall_distributable_linux metacall/distributable_linux cp /metacall/patch/deps.sh /metacall/scripts/deps.sh 106 | @docker commit metacall_distributable_linux metacall/distributable_linux 107 | @docker rm -f metacall_distributable_linux 108 | # Build dependencies 109 | @docker run ${PLATFORM_ARGS} --privileged --name metacall_distributable_linux metacall/distributable_linux /metacall/scripts/deps.sh 110 | @docker commit metacall_distributable_linux metacall/distributable_linux 111 | @docker rm -f metacall_distributable_linux 112 | @echo "Done" 113 | 114 | # Build tarball 115 | build: 116 | # Clear the container 117 | @docker stop metacall_distributable_linux 2> /dev/null || true 118 | @docker rm metacall_distributable_linux 2> /dev/null || true 119 | # Patch the source (metacall.scm) with latest version 120 | @docker run ${PLATFORM_ARGS} -v `pwd`/source:/metacall/patch --privileged --name metacall_distributable_linux metacall/distributable_linux cp /metacall/patch/metacall.scm /metacall/source/metacall.scm 121 | @docker commit metacall_distributable_linux metacall/distributable_linux 122 | @docker rm -f metacall_distributable_linux 123 | # Patch the script (build.sh) with latest version 124 | @docker run ${PLATFORM_ARGS} -v `pwd`/scripts:/metacall/patch --privileged --name metacall_distributable_linux metacall/distributable_linux cp /metacall/patch/build.sh /metacall/scripts/build.sh 125 | @docker commit metacall_distributable_linux metacall/distributable_linux 126 | @docker rm -f metacall_distributable_linux 127 | # Build tarball and store it into out folder 128 | @docker run ${PLATFORM_ARGS} --rm -v `pwd`/out:/metacall/pack --privileged --name metacall_distributable_linux metacall/distributable_linux /metacall/scripts/build.sh ${BUILD_ARGS} 129 | @echo "Done" 130 | 131 | # Test tarballs 132 | test: 133 | # Generate a unique id for invalidating the cache of test layers 134 | $(eval CACHE_INVALIDATE := $(shell date +%s)) 135 | # Run tests 136 | @docker buildx build ${PLATFORM_ARGS} --build-arg CACHE_INVALIDATE=${CACHE_INVALIDATE} -t metacall/distributable_linux_test:backtrace -f tests/backtrace/Dockerfile . 137 | @docker buildx build ${PLATFORM_ARGS} --build-arg CACHE_INVALIDATE=${CACHE_INVALIDATE} -t metacall/distributable_linux_test:c -f tests/c/Dockerfile . 138 | @docker buildx build ${PLATFORM_ARGS} --build-arg CACHE_INVALIDATE=${CACHE_INVALIDATE} -t metacall/distributable_linux_test:typescript -f tests/typescript/Dockerfile . 139 | # TODO: 140 | # @docker buildx build ${PLATFORM_ARGS} --build-arg CACHE_INVALIDATE=${CACHE_INVALIDATE} -t metacall/distributable_linux_test:tsx -f tests/tsx/Dockerfile . 141 | @docker buildx build ${PLATFORM_ARGS} --build-arg CACHE_INVALIDATE=${CACHE_INVALIDATE} -t metacall/distributable_linux_test:cli -f tests/cli/Dockerfile . 142 | @docker buildx build ${PLATFORM_ARGS} --build-arg CACHE_INVALIDATE=${CACHE_INVALIDATE} -t metacall/distributable_linux_test:python -f tests/python/Dockerfile . 143 | @docker buildx build ${PLATFORM_ARGS} --build-arg CACHE_INVALIDATE=${CACHE_INVALIDATE} -t metacall/distributable_linux_test:node -f tests/node/Dockerfile . 144 | @docker buildx build ${PLATFORM_ARGS} --build-arg CACHE_INVALIDATE=${CACHE_INVALIDATE} -t metacall/distributable_linux_test:ruby -f tests/ruby/Dockerfile . 145 | # Skip executable tests on debug because node, python, ruby... are compiled without address sanitizer and they produce false positives 146 | @if [ "${BUILD_ARGS}" = "release" ]; then \ 147 | docker buildx build ${PLATFORM_ARGS} --build-arg CACHE_INVALIDATE=${CACHE_INVALIDATE} -t metacall/distributable_linux_test:exe -f tests/exe/Dockerfile . ; \ 148 | fi 149 | @echo "Done" 150 | 151 | # Clear images and containers 152 | clear: 153 | # Clear the tarball 154 | @rm -rf out/* && touch out/.gitkeep 155 | # Clear the container 156 | @docker stop metacall_distributable_linux 2> /dev/null || true 157 | @docker rm metacall_distributable_linux 2> /dev/null || true 158 | # Clear the images 159 | @docker images | grep metacall/distributable_linux_test | tr -s ' ' | cut -d ' ' -f 2 | xargs -I {} docker rmi metacall/distributable_linux_test:{} 2> /dev/null || true 160 | @docker rmi metacall/distributable_linux 2> /dev/null || true 161 | 162 | # Empty target do nothing 163 | %: 164 | @: 165 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MetaCall Distributable Linux 2 | 3 | Linux redistributable for shipping MetaCall Core. 4 | 5 | ## How to Generate the Distributable Tarballs 6 | 7 | This will generate all tarballs in the `out` directory. All logs will be stored in `dist.log`. This process will test if tarballs are correct too. 8 | 9 | ```bash 10 | make &> dist.log & tail -f dist.log 11 | ``` 12 | 13 | ## How to Embed MetaCall as a Library from Distributable 14 | 15 | In order to use MetaCall as a library in your applications, you can easily link `libmetacall.so` from the folder `/gnu/lib`. In order to set up additional environment variables required by the runtimes or MetaCall itself, run the following command before your application: 16 | 17 | ```sh 18 | source /gnu/etc/profile 19 | ``` 20 | 21 | ## How to Get the Hash from a Package 22 | 23 | Replace `$URL` by the URL of the source code tarball, for example: `https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz`. Then paste the resulting hash into the package definition in the `.scm` file. 24 | 25 | ```bash 26 | docker run --rm --privileged -it metacall/guix guix download $URL | tail -n1 27 | ``` 28 | 29 | In order to update hash from MetaCall Core package, just run the following command. It will automatically patch the hash in the `source/metacall.scm` file. 30 | 31 | ```bash 32 | make download 33 | ``` 34 | 35 | ## GitLab CI settings 36 | Make sure to increase the job timeout to 2h+ (build job takes about a litle over an hour) in order to publish the tarball on GitHub as auto release you need to define the following variables in GitLab CI/CD settings, variable submenu: 37 | 38 | * `GH_TOKEN` - a GitHub access token (select repo scope) 39 | * `GH_REPO` - a GitHub repo in the format of **OWNER/REPO** e.g. `metacall/distributable-linux` 40 | -------------------------------------------------------------------------------- /channels/channels.scm: -------------------------------------------------------------------------------- 1 | ; 2 | ; MetaCall Distributable by Parra Studios 3 | ; Distributable infrastructure for MetaCall. 4 | ; 5 | ; Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia 6 | ; 7 | ; Licensed under the Apache License, Version 2.0 (the "License"); 8 | ; you may not use this file except in compliance with the License. 9 | ; You may obtain a copy of the License at 10 | ; 11 | ; http://www.apache.org/licenses/LICENSE-2.0 12 | ; 13 | ; Unless required by applicable law or agreed to in writing, software 14 | ; distributed under the License is distributed on an "AS IS" BASIS, 15 | ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | ; See the License for the specific language governing permissions and 17 | ; limitations under the License. 18 | ; 19 | 20 | 21 | 22 | 23 | (list (channel 24 | (name 'guix) 25 | (url "https://git.savannah.gnu.org/git/guix.git") 26 | (branch "master") 27 | (commit "f0d4daa13f0b57f5c03af73d449b2c6dd3160d08")) ; 2025-02-17 14:29:56 +0100 28 | ) 29 | -------------------------------------------------------------------------------- /out/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacall/distributable-linux/288500a7da9c44632fe7394ab72ececcce318bce/out/.gitkeep -------------------------------------------------------------------------------- /scripts/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # MetaCall Distributable by Parra Studios 5 | # Distributable infrastructure for MetaCall. 6 | # 7 | # Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia 8 | # 9 | # Licensed under the Apache License, Version 2.0 (the "License") 10 | # you may not use this file except in compliance with the License. 11 | # You may obtain a copy of the License at 12 | # 13 | # http://www.apache.org/licenses/LICENSE-2.0 14 | # 15 | # Unless required by applicable law or agreed to in writing, software 16 | # distributed under the License is distributed on an "AS IS" BASIS, 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | # See the License for the specific language governing permissions and 19 | # limitations under the License. 20 | # 21 | 22 | set -euxo pipefail 23 | 24 | export GUILE_WARN_DEPRECATED='detailed' 25 | 26 | # Generate a portable package tarball 27 | # Uses --no-grafts option in order to avoid conflicts between duplicated versions 28 | 29 | # Debug 30 | if [ "$1" == "debug" ]; then 31 | # Patch the metacall.scm with debug build type and sanitizers 32 | sed -i 's/"-DCMAKE_BUILD_TYPE/; "-DCMAKE_BUILD_TYPE/g' /metacall/source/metacall.scm 33 | sed -i \ 34 | -e '/"-DOPTION_BUILD_GUIX=ON"/a\' \ 35 | -e ' "-DCMAKE_BUILD_TYPE=Debug" "-DOPTION_BUILD_ADDRESS_SANITIZER=ON"' \ 36 | /metacall/source/metacall.scm 37 | fi 38 | 39 | # Build 40 | guix build metacall metacall-python-port --fallback -L /metacall/nonguix -L /metacall/source 41 | 42 | # Install 43 | echo 'metacall' >> /metacall/source/metacall.scm 44 | guix package --fallback --no-grafts -f /metacall/source/metacall.scm | tee build.log 45 | 46 | # Lint 47 | guix lint -L /metacall/nonguix -L /metacall/source metacall 48 | 49 | # Pack 50 | guix pack --no-grafts \ 51 | -S /gnu/bin=bin -S /gnu/etc=etc -S /gnu/lib=lib -S /gnu/include=include -S /gnu/share=share \ 52 | -RR metacall metacall-python-port nss-certs \ 53 | -L /metacall/nonguix -L /metacall/source | tee build.log 54 | 55 | # Copy 56 | mv `grep 'tarball-pack.tar.gz$' build.log` /metacall/pack/tarball.tar.gz 57 | -------------------------------------------------------------------------------- /scripts/deps.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # MetaCall Distributable by Parra Studios 5 | # Distributable infrastructure for MetaCall. 6 | # 7 | # Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia 8 | # 9 | # Licensed under the Apache License, Version 2.0 (the "License") 10 | # you may not use this file except in compliance with the License. 11 | # You may obtain a copy of the License at 12 | # 13 | # http://www.apache.org/licenses/LICENSE-2.0 14 | # 15 | # Unless required by applicable law or agreed to in writing, software 16 | # distributed under the License is distributed on an "AS IS" BASIS, 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | # See the License for the specific language governing permissions and 19 | # limitations under the License. 20 | # 21 | 22 | set -euxo pipefail 23 | 24 | export GUILE_WARN_DEPRECATED='detailed' 25 | 26 | # Clone nonguix 27 | apk --update-cache add --virtual git-deps git 28 | rm -rf /metacall/nonguix 29 | git clone https://gitlab.com/nonguix/nonguix /metacall/nonguix 30 | cd /metacall/nonguix 31 | git checkout e0951349603581895e0ba61f0e7410368ea1902a # Fix nonguix version 32 | apk del git-deps 33 | 34 | # Build 35 | guix build --fallback \ 36 | nss-certs \ 37 | `# dotnet codeanalysis-csharp codeanalysis-common codeanalysis-analyzers` \ 38 | espree typescript \ 39 | -L /metacall/nonguix -L /metacall/source 40 | -------------------------------------------------------------------------------- /source/metacall.scm: -------------------------------------------------------------------------------- 1 | ; 2 | ; MetaCall Distributable by Parra Studios 3 | ; Distributable infrastructure for MetaCall. 4 | ; 5 | ; Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia 6 | ; 7 | ; Licensed under the Apache License, Version 2.0 (the "License"); 8 | ; you may not use this file except in compliance with the License. 9 | ; You may obtain a copy of the License at 10 | ; 11 | ; http://www.apache.org/licenses/LICENSE-2.0 12 | ; 13 | ; Unless required by applicable law or agreed to in writing, software 14 | ; distributed under the License is distributed on an "AS IS" BASIS, 15 | ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | ; See the License for the specific language governing permissions and 17 | ; limitations under the License. 18 | ; 19 | 20 | (define-module (metacall) 21 | ; Guix Packages 22 | #:use-module (guix packages) 23 | #:use-module (guix modules) 24 | #:use-module (guix download) 25 | 26 | ; Build Systems 27 | #:use-module (guix build-system) 28 | #:use-module (guix build-system copy) 29 | #:use-module (guix build-system gnu) 30 | #:use-module (guix build-system cmake) 31 | #:use-module (guix build-system node) 32 | #:use-module (guix build-system trivial) 33 | #:use-module (guix build-system python) 34 | #:use-module (guix build json) 35 | #:use-module (guix build union) 36 | #:use-module ((guix licenses) #:prefix license:) 37 | 38 | ; GNU Packages 39 | #:use-module (gnu packages) 40 | 41 | ; Python Dependencies 42 | #:use-module (gnu packages python) 43 | #:use-module (gnu packages python-xyz) 44 | 45 | ; Ruby Dependencies 46 | #:use-module (gnu packages ruby) 47 | 48 | ; NodeJS Dependencies 49 | #:use-module (guix utils) 50 | #:use-module ((guix build utils) #:select (alist-replace)) 51 | #:use-module (gnu packages node) 52 | #:use-module (gnu packages adns) 53 | #:use-module (gnu packages base) 54 | #:use-module (gnu packages compression) 55 | #:use-module (gnu packages icu4c) 56 | #:use-module (gnu packages libevent) 57 | #:use-module (gnu packages linux) 58 | #:use-module (gnu packages perl) 59 | #:use-module (gnu packages pkg-config) 60 | #:use-module (gnu packages python) 61 | #:use-module (gnu packages tls) 62 | #:use-module (gnu packages web) 63 | 64 | ; RapidJSON 65 | #:use-module (gnu packages web) 66 | 67 | ; NetCore Dependencies (TODO) 68 | ; #:use-module (nongnu packages dotnet) 69 | ; #:use-module (nonguix build-system binary) 70 | 71 | ; Cobol Dependencies 72 | #:use-module (gnu packages cobol) 73 | #:use-module (gnu packages multiprecision) 74 | 75 | ; RPC Dependencies 76 | #:use-module (gnu packages curl) 77 | 78 | ; ; Backtrace Dependencies 79 | #:use-module (guix git-download) 80 | #:use-module (guix gexp) 81 | #:use-module (gnu packages libunwind) 82 | ; #:use-module (gnu packages elf) 83 | ) 84 | 85 | ; NodeJS Loader Dependencies 86 | (define-public espree 87 | (package 88 | (name "espree") 89 | (version "9.4.0") 90 | (source 91 | (origin 92 | (method url-fetch) 93 | (uri (string-append "https://github.com/metacall/core-bootstrap.js-guix-package/releases/download/v0.0.4/espree-" version ".tgz")) 94 | (sha256 (base32 "1w8iy2wx6v7shr99jafi8mgcx7ma64x2mxx71kp1ixs19dg4pxr7")) 95 | ) 96 | ) 97 | (build-system node-build-system) 98 | (arguments 99 | `( 100 | #:phases 101 | (modify-phases %standard-phases 102 | (delete 'check) 103 | (delete 'configure) 104 | (delete 'build) 105 | ) 106 | ) 107 | ) 108 | (home-page "https://github.com/eslint/espree") 109 | (synopsis "An Esprima-compatible JavaScript parser.") 110 | (description "Espree started out as a fork of Esprima v1.2.2, the last stable published released 111 | of Esprima before work on ECMAScript 6 began. Espree is now built on top of Acorn, which has a modular 112 | architecture that allows extension of core functionality. The goal of Espree is to produce output 113 | that is similar to Esprima with a similar API so that it can be used in place of Esprima.") 114 | (license license:expat) 115 | ) 116 | ) 117 | 118 | ; TypeScript Loader Dependencies 119 | (define-public typescript 120 | (package 121 | (name "typescript") 122 | (version "4.2.3") 123 | (source 124 | (origin 125 | (method url-fetch) 126 | (uri (string-append "https://registry.npmjs.org/typescript/-/typescript-" version ".tgz")) 127 | (sha256 (base32 "0jpi7za7ak0ba8bm300219vhrr4raacx6s8rz3czlwxim1byyn6g")) 128 | ) 129 | ) 130 | (build-system node-build-system) 131 | (arguments 132 | `( 133 | #:phases 134 | (modify-phases %standard-phases 135 | (delete 'check) 136 | (delete 'configure) 137 | (delete 'build) 138 | ) 139 | ) 140 | ) 141 | (home-page "https://www.typescriptlang.org/") 142 | (synopsis "TypeScript extends JavaScript by adding types to the language. ") 143 | (description "TypeScript is a language for application-scale JavaScript. 144 | TypeScript adds optional types to JavaScript that support tools for large-scale JavaScript applications for any browser, 145 | for any host, on any OS. TypeScript compiles to readable, standards-based JavaScript.") 146 | (license license:asl2.0) 147 | ) 148 | ) 149 | 150 | ; NetCore Loader Dependencies (TODO) 151 | ; (define-public codeanalysis-csharp 152 | ; (package 153 | ; (name "codeanalysis-csharp") 154 | ; (version "3.2.1") 155 | ; (source 156 | ; (origin 157 | ; (method url-fetch) 158 | ; (uri (string-append "https://globalcdn.nuget.org/packages/microsoft.codeanalysis.csharp." version ".nupkg")) 159 | ; (sha256 (base32 "02kyh5xsr3ciw71afzyis91m18iys1kpndl6h6ykayg9w36z9rz7")) 160 | ; ) 161 | ; ) 162 | ; (build-system binary-build-system) 163 | ; (arguments 164 | ; `(#:phases 165 | ; (modify-phases %standard-phases 166 | ; (replace 'unpack 167 | ; (lambda* (#:key source #:allow-other-keys) 168 | ; (invoke "cp" source (string-append (getcwd) "/microsoft.codeanalysis.csharp.3.2.1.nupkg")) 169 | ; ) 170 | ; ) 171 | ; ) 172 | ; ) 173 | ; ) 174 | ; (home-page "https://www.nuget.org/packages/Microsoft.CodeAnalysis.CSharp") 175 | ; (synopsis ".NET Compiler Platform (Roslyn).") 176 | ; (description ".NET Compiler Platform (Roslyn).") 177 | ; (license license:expat) 178 | ; ) 179 | ; ) 180 | 181 | ; (define-public codeanalysis-common 182 | ; (package 183 | ; (name "codeanalysis-common") 184 | ; (version "3.2.1") 185 | ; (source 186 | ; (origin 187 | ; (method url-fetch) 188 | ; (uri (string-append "https://globalcdn.nuget.org/packages/microsoft.codeanalysis.common." version ".nupkg")) 189 | ; (sha256 (base32 "1n3jc5fz78f7smzjanmq00iv3pdifnhkgmmsb9czrfbzc3v4c3d2")) 190 | ; ) 191 | ; ) 192 | ; (build-system binary-build-system) 193 | ; (arguments 194 | ; `(#:phases 195 | ; (modify-phases %standard-phases 196 | ; (replace 'unpack 197 | ; (lambda* (#:key source #:allow-other-keys) 198 | ; (invoke "cp" source (string-append (getcwd) "/microsoft.codeanalysis.common.3.2.1.nupkg")) 199 | ; ) 200 | ; ) 201 | ; ) 202 | ; ) 203 | ; ) 204 | ; (home-page "https://www.nuget.org/packages/Microsoft.CodeAnalysis.Common") 205 | ; (synopsis ".NET Compiler Platform (Roslyn).") 206 | ; (description ".NET Compiler Platform (Roslyn).") 207 | ; (license license:expat) 208 | ; ) 209 | ; ) 210 | 211 | ; (define-public codeanalysis-analyzers 212 | ; (package 213 | ; (name "codeanalysis-analyzers") 214 | ; (version "2.9.3") 215 | ; (source 216 | ; (origin 217 | ; (method url-fetch) 218 | ; (uri (string-append "https://globalcdn.nuget.org/packages/microsoft.codeanalysis.analyzers." version ".nupkg")) 219 | ; (sha256 (base32 "1kskwc9gyd2sx3zwx52qwfsl7s0xhaclmlnxvjsb4jgvpydv3xii")) 220 | ; ) 221 | ; ) 222 | ; (build-system binary-build-system) 223 | ; (arguments 224 | ; `(#:phases 225 | ; (modify-phases %standard-phases 226 | ; (replace 'unpack 227 | ; (lambda* (#:key source #:allow-other-keys) 228 | ; (invoke "cp" source (string-append (getcwd) "/microsoft.codeanalysis.analyzers.2.9.3.nupkg")) 229 | ; ) 230 | ; ) 231 | ; ) 232 | ; ) 233 | ; ) 234 | ; (home-page "https://www.nuget.org/packages/Microsoft.CodeAnalysis.Analyzers") 235 | ; (synopsis ".NET Compiler Platform (Roslyn).") 236 | ; (description ".NET Compiler Platform (Roslyn).") 237 | ; (license license:expat) 238 | ; ) 239 | ; ) 240 | 241 | (define-public backward-cpp 242 | (package 243 | (name "backward-cpp") 244 | (version "1.6") 245 | (source (origin 246 | (method git-fetch) 247 | (uri (git-reference 248 | (url "https://github.com/bombela/backward-cpp") 249 | (commit (string-append "v" version)))) 250 | (file-name (git-file-name name version)) 251 | (sha256 252 | (base32 253 | "1b2h03iwfhcsg8i4f125mlrjf8l1y7qsr2gsbkv0z03i067lykns")))) 254 | (arguments 255 | (list 256 | #:tests? #f 257 | #:configure-flags 258 | #~(list 259 | "-DBACKWARD_TESTS=OFF" 260 | "-DBACKWARD_SHARED=OFF"))) 261 | (build-system cmake-build-system) 262 | (synopsis "Stack trace pretty printer for C++") 263 | (description 264 | "Backward-cpp is a stack trace pretty printer for C++. 265 | It can print annotated stack traces using debug info in the executable.") 266 | (home-page "https://github.com/bombela/backward-cpp") 267 | (license license:expat))) 268 | 269 | (define-public plthook 270 | (package 271 | (name "plthook") 272 | (version "0.1.0") 273 | (source (origin 274 | (method git-fetch) 275 | (uri (git-reference 276 | (url "https://github.com/metacall/plthook") 277 | (commit (string-append "v" version)))) 278 | (file-name (git-file-name name version)) 279 | (sha256 280 | (base32 281 | "07fxkd5mv6v02a4if2lz7rq236m5nfifrly8vjy6774zhn8zzs61")))) 282 | (build-system trivial-build-system) 283 | (arguments 284 | (list 285 | #:modules '((guix build utils)) 286 | #:builder 287 | #~(begin 288 | (use-modules (guix build utils)) 289 | (let ((out #$output) 290 | (src #$source)) 291 | (mkdir-p out) 292 | (copy-recursively src out)) 293 | #t))) 294 | (synopsis "Hook function calls by replacing PLT (Procedure Linkage Table) entries.") 295 | (description 296 | "A utility library to hook library function calls issued by specified object files (executable and libraries). 297 | This modifies PLT (Procedure Linkage Table) entries in ELF format used on most Unixes 298 | or IAT (Import Address Table) entries in PE format used on Windows.") 299 | (home-page "https://github.com/metacall/plthook") 300 | (license license:expat))) 301 | 302 | ; MetaCall 303 | (define-public metacall 304 | (package 305 | (name "metacall") 306 | (version "0.9.5") 307 | (source 308 | (origin 309 | (method url-fetch) 310 | (uri (string-append 311 | "https://github.com/metacall/core/archive/v" version ".tar.gz")) 312 | (sha256 (base32 "0ag8qmj2z8wwv72nxh9vzz5ybj14f0fv8bb625pwl2zg7nxy8zkz")))) 313 | 314 | (build-system cmake-build-system) 315 | (arguments 316 | `( 317 | #:phases 318 | ; TODO: This may be hidding a CMake bug with rpath on all ports, 319 | ; so this must be reviewed in the future 320 | (modify-phases %standard-phases 321 | (add-before 'configure 'runpath-workaround 322 | (lambda* (#:key outputs #:allow-other-keys) 323 | (let ((out (assoc-ref outputs "out"))) 324 | (setenv "LDFLAGS" (string-append "-Wl,-rpath=" out "/lib")) 325 | #t))) 326 | ; TODO 327 | ; (add-before 'configure 'dotnet-packages 328 | ; (lambda* (#:key inputs #:allow-other-keys) 329 | ; (let ( 330 | ; (global-pkgs "/tmp/.nuget/packages") 331 | ; (additional-pkgs "/tmp/.nuget/nupkgs") 332 | ; ) 333 | ; (setenv "NUGET_PACKAGES" global-pkgs) 334 | ; (setenv "DOTNET_SKIP_FIRST_TIME_EXPERIENCE" "true") 335 | ; (setenv "HOME" "/tmp") 336 | ; (setenv "DOTNET_ROOT" 337 | ; (string-append (assoc-ref inputs "dotnet") "/share/dotnet")) 338 | ; (mkdir-p global-pkgs) 339 | ; (mkdir-p additional-pkgs) 340 | ; ; TODO: Avoid harcoded versions of CodeAnalysis 341 | ; (invoke "cp" (string-append (assoc-ref inputs "codeanalysis-csharp") 342 | ; "/microsoft.codeanalysis.csharp.3.2.1.nupkg") additional-pkgs) 343 | ; (invoke "cp" (string-append (assoc-ref inputs "codeanalysis-common") 344 | ; "/microsoft.codeanalysis.common.3.2.1.nupkg") additional-pkgs) 345 | ; (invoke "cp" (string-append (assoc-ref inputs "codeanalysis-analyzers") 346 | ; "/microsoft.codeanalysis.analyzers.2.9.3.nupkg") additional-pkgs) 347 | ; (with-output-to-file 348 | ; "source/loaders/cs_loader/netcore/source/NuGet.Config" 349 | ; (lambda () 350 | ; (format #t " 351 | ; 352 | ; 353 | ; 354 | ; 355 | ; 356 | ; 357 | ; 358 | ; 359 | ; 360 | ; 361 | ; 362 | ; " (string-append (assoc-ref inputs "dotnet") "/share/dotnet/shared/Microsoft.NETCore.App/5.0.4/")))) 363 | ; #t))) 364 | (add-after 'build 'build-node-loader-bootstrap-espree 365 | (lambda* (#:key inputs #:allow-other-keys) 366 | (let* ((output (string-append (getcwd) "/node_modules/espree")) 367 | (espree (string-append 368 | (assoc-ref inputs "espree") "/lib/node_modules/espree"))) 369 | (mkdir-p output) 370 | (copy-recursively espree output)) 371 | #t)) 372 | (add-after 'build 'build-ts-loader-bootstrap-typescript 373 | (lambda* (#:key inputs #:allow-other-keys) 374 | (let* ((output (string-append (getcwd) "/node_modules/typescript")) 375 | (typescript (string-append 376 | (assoc-ref inputs "typescript") "/lib/node_modules/typescript"))) 377 | (mkdir-p output) 378 | (copy-recursively typescript output)) 379 | #t)) 380 | (add-after 'install 'symlink-debug-executable 381 | (lambda* (#:key outputs #:allow-other-keys) 382 | (let ((source-file (string-append (assoc-ref outputs "out") "/bin/metacallclid")) 383 | (symlink-target (string-append (assoc-ref outputs "out") "/bin/metacallcli"))) 384 | (when (file-exists? source-file) 385 | (symlink source-file symlink-target))))) 386 | (add-after 'install 'symlink-debug-library 387 | (lambda* (#:key outputs #:allow-other-keys) 388 | (let ((source-file (string-append (assoc-ref outputs "out") "/lib/libmetacalld.so")) 389 | (symlink-target (string-append (assoc-ref outputs "out") "/lib/libmetacall.so"))) 390 | (when (file-exists? source-file) 391 | (symlink source-file symlink-target)))))) 392 | 393 | ; TODO: Enable tests 394 | #:tests? #f 395 | #:configure-flags 396 | (list 397 | ; Disable developer warnings 398 | "-Wno-dev" 399 | 400 | ; Disable all unreproductible operations 401 | "-DOPTION_BUILD_GUIX=ON" 402 | 403 | ; Build with release mode 404 | "-DCMAKE_BUILD_TYPE=RelWithDebInfo" 405 | ; "-DCMAKE_BUILD_TYPE=Release" 406 | 407 | ; ; Build with debug mode 408 | ; "-DCMAKE_BUILD_TYPE=Debug" 409 | ; "-DOPTION_BUILD_ADDRESS_SANITIZER=ON" 410 | 411 | ; Disable stack-smashing protection and source fortify 412 | ; in order to improve libc portability / compatibility 413 | "-DOPTION_BUILD_SECURITY=OFF" 414 | 415 | ; Disable examples 416 | "-DOPTION_BUILD_EXAMPLES=OFF" 417 | 418 | ; Detours 419 | "-DOPTION_BUILD_DETOURS=ON" 420 | "-DOPTION_BUILD_DETOURS_PLTHOOK=ON" 421 | (string-append "-DPLTHook_SOURCE_DIR=" (assoc-ref %build-inputs "plthook")) 422 | 423 | ; Fork safety 424 | "-DOPTION_FORK_SAFE=ON" 425 | 426 | ; TODO: Enable tests 427 | "-DOPTION_BUILD_TESTS=OFF" 428 | 429 | ; TODO: Enable when tests 430 | "-DOPTION_BUILD_SCRIPTS=OFF" 431 | "-DOPTION_BUILD_SCRIPTS_PY=OFF" 432 | "-DOPTION_BUILD_SCRIPTS_RB=OFF" 433 | "-DOPTION_BUILD_SCRIPTS_FILE=OFF" 434 | "-DOPTION_BUILD_SCRIPTS_NODE=OFF" 435 | "-DOPTION_BUILD_SCRIPTS_CS=OFF" 436 | "-DOPTION_BUILD_LOADERS_JS=OFF" 437 | 438 | ; Serials 439 | "-DOPTION_BUILD_SERIALS=ON" 440 | "-DOPTION_BUILD_SERIALS_RAPID_JSON=ON" 441 | "-DOPTION_BUILD_SERIALS_METACALL=ON" 442 | 443 | ; Loaders 444 | "-DOPTION_BUILD_LOADERS=ON" 445 | "-DOPTION_BUILD_LOADERS_MOCK=ON" 446 | "-DOPTION_BUILD_LOADERS_PY=ON" 447 | "-DOPTION_BUILD_LOADERS_RB=ON" 448 | "-DOPTION_BUILD_LOADERS_FILE=ON" 449 | "-DOPTION_BUILD_LOADERS_NODE=ON" 450 | "-DOPTION_BUILD_LOADERS_TS=ON" 451 | "-DOPTION_BUILD_LOADERS_CS=OFF" ; TODO: ON 452 | "-DOPTION_BUILD_LOADERS_JS=OFF" ; TODO: Implement V8 Loader 453 | "-DOPTION_BUILD_LOADERS_COB=ON" 454 | "-DOPTION_BUILD_LOADERS_RPC=ON" 455 | 456 | ; Ruby Loader 457 | (string-append "-DRuby_EXECUTABLE=" 458 | (assoc-ref %build-inputs "ruby") "/bin/ruby") 459 | (string-append "-DRuby_INCLUDE_DIRS=" 460 | (assoc-ref %build-inputs "ruby") "/include/ruby-3.3.0") 461 | (string-append "-DRuby_LIBRARY=" 462 | (assoc-ref %build-inputs "ruby") "/lib/libruby.so") 463 | (string-append "-DRuby_VERSION=" "3.3.3") 464 | 465 | ; NodeJS Loader 466 | (string-append "-DNodeJS_EXECUTABLE=" 467 | (assoc-ref %build-inputs "node") "/bin/node") 468 | (string-append "-DNodeJS_INCLUDE_DIR=" 469 | (assoc-ref %build-inputs "node") "/include/node") 470 | (string-append "-DNodeJS_LIBRARY=" 471 | (assoc-ref %build-inputs "libnode") "/lib/libnode.so.127") 472 | "-DNodeJS_CMAKE_DEBUG=ON" 473 | "-DNodeJS_SHARED_UV=ON" 474 | 475 | ; TODO 476 | ; (string-append "-DDOTNET_COMMAND=" 477 | ; (assoc-ref %build-inputs "dotnet") "/share/dotnet/dotnet") 478 | ; (string-append "-DDOTNET_CORE_PATH=" 479 | ; (assoc-ref %build-inputs "dotnet") 480 | ; "/share/dotnet/shared/Microsoft.NETCore.App/5.0.4/") 481 | ; "-DDOTNET_ADDITIONAL_PACKAGES=/tmp/.nuget/nupkgs/" 482 | 483 | ; Cobol Loader 484 | (string-append "-DCOBOL_EXECUTABLE=" 485 | (assoc-ref %build-inputs "gnucobol") "/bin/cobc") 486 | (string-append "-DCOBOL_INCLUDE_DIR=" 487 | (assoc-ref %build-inputs "gnucobol") "/include") 488 | (string-append "-DCOBOL_LIBRARY=" 489 | (assoc-ref %build-inputs "gnucobol") "/lib/libcob.so") 490 | 491 | ; RPC Loader 492 | (string-append "-DCURL_INCLUDE_DIR=" 493 | (assoc-ref %build-inputs "curl") "/include/curl") 494 | 495 | ; TODO: Finish all loaders 496 | "-DOPTION_BUILD_SCRIPTS_JS=OFF" 497 | 498 | ; Ports 499 | "-DOPTION_BUILD_PORTS=ON" 500 | "-DOPTION_BUILD_PORTS_PY=ON" 501 | "-DOPTION_BUILD_PORTS_NODE=ON" 502 | "-DOPTION_BUILD_PORTS_TS=OFF" ; TODO: Not implemented yet 503 | "-DOPTION_BUILD_PORTS_CS=ON" 504 | "-DOPTION_BUILD_PORTS_RB=ON" 505 | 506 | ; Enable backtrace support 507 | "-DBACKWARD_TESTS=OFF" 508 | "-DSTACK_DETAILS_AUTO_DETECT=OFF" 509 | "-DSTACK_WALKING_UNWIND=OFF" 510 | "-DSTACK_WALKING_LIBUNWIND=ON" 511 | (string-append "-DBACKWARD_LIBRARIES=" (assoc-ref %build-inputs "libunwind") "/lib/libunwind.so") 512 | (string-append "-DBACKWARD_INCLUDE_DIRS=" (assoc-ref %build-inputs "libunwind") "/include") 513 | ; "-DSTACK_DETAILS_DWARF=ON" 514 | ; (string-append "-DBACKWARD_LIBRARIES=" 515 | ; (assoc-ref %build-inputs "libdwarf") "/lib/libdwarf.so" ";" 516 | ; (assoc-ref %build-inputs "libelf") "/lib/libelf.so") 517 | ; (string-append "-DBACKWARD_INCLUDE_DIRS=" 518 | ; (assoc-ref %build-inputs "libdwarf") "/include/libdwarf-0" ";" 519 | ; (assoc-ref %build-inputs "libelf") "/include") 520 | (string-append "-DBackwardCpp_SOURCE=" (assoc-ref %build-inputs "backward-cpp") "/lib/backward") 521 | "-DBACKWARD_SHARED=OFF" 522 | "-DOPTION_BUILD_PLUGINS_BACKTRACE=ON" 523 | 524 | ; Disable coverage 525 | "-DOPTION_COVERAGE=OFF"))) 526 | 527 | (propagated-inputs 528 | `( 529 | ("python" ,python-3) ; Python Loader dependency 530 | ("ruby" ,ruby-3.3) ; Ruby Loader dependency 531 | ("node" ,node-lts) ; NodeJS Loader dependency 532 | ("libnode" ,libnode) ; NodeJS Loader dependency 533 | ("libuv" ,libuv) ; NodeJS Loader dependency 534 | ("espree" ,espree) ; NodeJS Loader dependency 535 | ("typescript" ,typescript) ; TypeScript Loader dependency 536 | ("gnucobol" ,gnucobol) ; Cobol Loader dependency 537 | ("gmp" ,gmp) ; Cobol Loader dependency 538 | ; TODO 539 | ; ("dotnet" ,dotnet) ; NetCore Loader dependency 540 | ; ("codeanalysis-csharp" ,codeanalysis-csharp) ; NetCore Loader dependency 541 | ; ("codeanalysis-common" ,codeanalysis-common) ; NetCore Loader dependency 542 | ; ("codeanalysis-analyzers" ,codeanalysis-analyzers) ; NetCore Loader dependency 543 | ("curl" ,curl) ; RPC Loader Dependency 544 | ("libunwind", libunwind))) ; Backtrace Plugin dependency 545 | ; ("libdwarf", libdwarf) ; Backtrace Plugin dependency 546 | ; ("libelf", libelf))) ; Backtrace Plugin dependency 547 | 548 | (native-inputs 549 | `( 550 | ("rapidjson" ,rapidjson) ; RapidJSON Serial dependency 551 | ("plthook" ,plthook) ; PLTHook dependency 552 | ("backward-cpp", backward-cpp))) ; Backtrace Plugin dependency 553 | 554 | ; Set all environment variables for subsequent packages 555 | (search-paths 556 | (list 557 | ; MetaCall 558 | (search-path-specification 559 | (variable "LOADER_LIBRARY_PATH") 560 | (files '("lib"))) 561 | (search-path-specification 562 | (variable "SERIAL_LIBRARY_PATH") 563 | (files '("lib"))) 564 | (search-path-specification 565 | (variable "DETOUR_LIBRARY_PATH") 566 | (files '("lib"))) 567 | (search-path-specification 568 | (variable "PORT_LIBRARY_PATH") 569 | (files '("lib"))) 570 | (search-path-specification 571 | (variable "CONFIGURATION_PATH") 572 | (file-type 'regular) 573 | (files '("configurations/global.json"))) 574 | ; Python 575 | (search-path-specification 576 | (variable "PYTHONTZPATH") 577 | (files (list "share/zoneinfo"))) 578 | ; PYTHONPATH is incompatible with Guix Python 579 | ; but we require it for tarball installation 580 | (search-path-specification 581 | (variable "PYTHONPATH") 582 | (files (list (string-append 583 | "lib/python" 584 | (version-major+minor (package-version python-3)) 585 | "/site-packages")))) 586 | ; NodeJS 587 | (search-path-specification 588 | (variable "NODE_PATH") 589 | (files '("lib/node_modules"))) 590 | ; Ruby 591 | (search-path-specification 592 | (variable "GEM_PATH") 593 | (files (list (string-append "lib/ruby/vendor_ruby")))) 594 | (search-path-specification 595 | (variable "GEM_HOME") 596 | (files (list (string-append "lib/ruby/vendor_ruby")))) 597 | (search-path-specification 598 | (variable "BUNDLE_PATH") 599 | (files (list (string-append "lib/ruby/vendor_ruby")))) 600 | ; GCC 601 | (search-path-specification 602 | (variable "C_INCLUDE_PATH") 603 | (files '("include"))) 604 | (search-path-specification 605 | (variable "CPLUS_INCLUDE_PATH") 606 | (files '("include/c++" "include"))) 607 | (search-path-specification 608 | (variable "LIBRARY_PATH") 609 | (files '("lib" "lib64"))))) 610 | 611 | ; TODO: 612 | ; 613 | ; Dynamic Linker Path 614 | ; #:use-module ((gnu packages bootstrap) #:select (glibc-dynamic-linker)) 615 | ; 616 | ; (search-path-specification 617 | ; (variable "GLIBC_LD_LIBRARY_PATH") 618 | ; (file-type 'regular) 619 | ; (files '(glibc-dynamic-linker))) 620 | 621 | (native-search-paths search-paths) 622 | 623 | (home-page "https://metacall.io/") 624 | (synopsis "Inter-language foreign function interface call library") 625 | (description "METACALL is a library that allows calling functions, 626 | methods or procedures between programming languages. 627 | With METACALL you can transparently execute code from / to any 628 | programming language, for example, call Python code from NodeJS code.") 629 | (license license:asl2.0))) 630 | 631 | ; MetaCall Python Port 632 | ; TODO: Can it be unified with metacall package? 633 | ; https://www.futurile.net/2024/07/23/guix-package-structure-build-system-phases/ 634 | (define-public metacall-python-port 635 | (package 636 | (inherit metacall) 637 | (name "metacall-python-port") 638 | (build-system python-build-system) 639 | (arguments 640 | `(#:tests? #f 641 | #:phases (modify-phases %standard-phases 642 | (add-before 'build 'change-directory 643 | (lambda _ 644 | (chdir "source/ports/py_port"))) 645 | (delete 'test) 646 | (delete 'sanity-check)))) 647 | (inputs (list metacall)))) 648 | -------------------------------------------------------------------------------- /tests/backtrace/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # MetaCall Distributable by Parra Studios 3 | # Distributable infrastructure for MetaCall. 4 | # 5 | # Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | FROM debian:trixie-slim AS c_test 21 | 22 | # Image descriptor 23 | LABEL copyright.name="Vicente Eduardo Ferrer Garcia" \ 24 | copyright.address="vic798@gmail.com" \ 25 | maintainer.name="Vicente Eduardo Ferrer Garcia" \ 26 | maintainer.address="vic798@gmail.com" \ 27 | vendor="MetaCall Inc." \ 28 | version="0.1" 29 | 30 | SHELL ["/bin/bash", "-c"] 31 | 32 | RUN apt-get update \ 33 | && apt-get install --no-install-recommends -y build-essential 34 | 35 | COPY out/tarball.tar.gz / 36 | 37 | RUN cd / \ 38 | && tar --no-same-owner --no-same-permissions -xzf tarball.tar.gz \ 39 | && rm tarball.tar.gz 40 | 41 | COPY tests/backtrace/test.c / 42 | 43 | COPY tests/scripts/ /scripts/ 44 | 45 | WORKDIR /scripts 46 | 47 | ARG CACHE_INVALIDATE 48 | 49 | RUN echo "Running tests ${CACHE_INVALIDATE}" \ 50 | && set -exo pipefail \ 51 | && source /gnu/etc/profile \ 52 | && export LDLIB_PATH="`find /gnu/store/ -type f -wholename '*-glibc-*/lib/ld-*.so*' | head -n 1`" \ 53 | && export LOADER_SCRIPT_PATH="/scripts/" \ 54 | && cd / \ 55 | && gcc \ 56 | -I/gnu/include \ 57 | test.c \ 58 | -B$(dirname ${LDLIB_PATH}) \ 59 | -Wl,--dynamic-linker=${LDLIB_PATH} \ 60 | -Wl,-rpath=/gnu/lib \ 61 | -L/gnu/lib \ 62 | -lmetacall \ 63 | && if [ -f /gnu/bin/metacallclid ]; then \ 64 | export LIBASAN_PATH="`find /gnu/store/ -name 'libasan.so' | head -n 1`" \ 65 | && export LIBUBSAN_PATH="`find /gnu/store/ -name 'libubsan.so' | head -n 1`" \ 66 | && export LD_PRELOAD="${LIBASAN_PATH} ${LIBUBSAN_PATH}" \ 67 | && export ASAN_OPTIONS="halt_on_error=0"; \ 68 | fi \ 69 | && ./a.out &> output.txt \ 70 | || cat output.txt \ 71 | && grep output.txt \ 72 | -e 'Stack trace (most recent call last)' 73 | 74 | ENTRYPOINT ["sh", "-c"] 75 | -------------------------------------------------------------------------------- /tests/backtrace/test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * MetaCall Distributable by Parra Studios 3 | * Distributable infrastructure for MetaCall. 4 | * 5 | * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | #include 22 | #include 23 | 24 | static int cleanup(int code) 25 | { 26 | metacall_destroy(); 27 | 28 | return code; 29 | } 30 | 31 | int main(int argc, char *argv[]) 32 | { 33 | struct metacall_log_stdio_type log_stdio = { stdout }; 34 | 35 | printf("%s\n", metacall_print_info()); 36 | 37 | if (metacall_log(METACALL_LOG_STDIO, (void *)&log_stdio) != 0) 38 | { 39 | return cleanup(1); 40 | } 41 | 42 | if (metacall_initialize() != 0) 43 | { 44 | return cleanup(2); 45 | } 46 | 47 | /* Backtrace */ 48 | { 49 | char *segfault = (void *)&cleanup; 50 | *segfault = 34; 51 | } 52 | 53 | return cleanup(0); 54 | } 55 | -------------------------------------------------------------------------------- /tests/c/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # MetaCall Distributable by Parra Studios 3 | # Distributable infrastructure for MetaCall. 4 | # 5 | # Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | FROM debian:trixie-slim AS c_test 21 | 22 | # Image descriptor 23 | LABEL copyright.name="Vicente Eduardo Ferrer Garcia" \ 24 | copyright.address="vic798@gmail.com" \ 25 | maintainer.name="Vicente Eduardo Ferrer Garcia" \ 26 | maintainer.address="vic798@gmail.com" \ 27 | vendor="MetaCall Inc." \ 28 | version="0.1" 29 | 30 | SHELL ["/bin/bash", "-c"] 31 | 32 | RUN apt-get update \ 33 | && apt-get install --no-install-recommends -y build-essential 34 | 35 | COPY out/tarball.tar.gz / 36 | 37 | RUN cd / \ 38 | && tar --no-same-owner --no-same-permissions -xzf tarball.tar.gz \ 39 | && rm tarball.tar.gz 40 | 41 | COPY tests/c/test.c / 42 | 43 | COPY tests/scripts/ /scripts/ 44 | 45 | WORKDIR /scripts 46 | 47 | ARG CACHE_INVALIDATE 48 | 49 | RUN echo "Running tests ${CACHE_INVALIDATE}" \ 50 | && set -exo pipefail \ 51 | && source /gnu/etc/profile \ 52 | && export LDLIB_PATH="`find /gnu/store/ -type f -wholename '*-glibc-*/lib/ld-*.so*' | head -n 1`" \ 53 | && export LOADER_SCRIPT_PATH="/scripts/" \ 54 | && cd / \ 55 | && gcc \ 56 | -I/gnu/include \ 57 | test.c \ 58 | -B$(dirname ${LDLIB_PATH}) \ 59 | -Wl,--dynamic-linker=${LDLIB_PATH} \ 60 | -Wl,-rpath=/gnu/lib \ 61 | -L/gnu/lib \ 62 | -lmetacall \ 63 | && if [ -f /gnu/bin/metacallclid ]; then \ 64 | export LIBASAN_PATH="`find /gnu/store/ -name 'libasan.so' | head -n 1`" \ 65 | && export LIBUBSAN_PATH="`find /gnu/store/ -name 'libubsan.so' | head -n 1`" \ 66 | && export LD_PRELOAD="${LIBASAN_PATH} ${LIBUBSAN_PATH}" \ 67 | && export ASAN_OPTIONS="halt_on_error=0"; \ 68 | fi \ 69 | && ./a.out | grep \ 70 | -e 'Hello World' \ 71 | -e 'abc' \ 72 | -e '1099' 73 | 74 | ENTRYPOINT ["sh", "-c"] 75 | -------------------------------------------------------------------------------- /tests/c/test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * MetaCall Distributable by Parra Studios 3 | * Distributable infrastructure for MetaCall. 4 | * 5 | * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | static int cleanup(int code) 27 | { 28 | metacall_destroy(); 29 | 30 | return code; 31 | } 32 | 33 | int main(int argc, char *argv[]) 34 | { 35 | struct metacall_log_stdio_type log_stdio = { stdout }; 36 | 37 | printf("%s\n", metacall_print_info()); 38 | 39 | if (metacall_log(METACALL_LOG_STDIO, (void *)&log_stdio) != 0) 40 | { 41 | return cleanup(1); 42 | } 43 | 44 | if (metacall_initialize() != 0) 45 | { 46 | return cleanup(2); 47 | } 48 | 49 | /* Mock */ 50 | { 51 | const char * mock_scripts[] = 52 | { 53 | "test.mock" 54 | }; 55 | 56 | const enum metacall_value_id three_str_ids[] = 57 | { 58 | METACALL_STRING, METACALL_STRING, METACALL_STRING 59 | }; 60 | 61 | void * ret = NULL; 62 | 63 | if (metacall_load_from_file("mock", mock_scripts, sizeof(mock_scripts) / sizeof(mock_scripts[0]), NULL) != 0) 64 | { 65 | return cleanup(6); 66 | } 67 | 68 | ret = metacallt("three_str", three_str_ids, "a", "b", "c"); 69 | 70 | if (ret == NULL) 71 | { 72 | return cleanup(7); 73 | } 74 | 75 | /* Check result */ 76 | { 77 | const char result[] = "Hello World"; 78 | const char * str = metacall_value_to_string(ret); 79 | 80 | if (strncmp(str, result, sizeof(result)) != 0) 81 | { 82 | return cleanup(8); 83 | } 84 | 85 | printf("%s\n", str); 86 | } 87 | 88 | metacall_value_destroy(ret); 89 | } 90 | 91 | /* Python */ 92 | { 93 | const char * py_scripts[] = 94 | { 95 | "/scripts/sum.py" 96 | }; 97 | 98 | const enum metacall_value_id sum_ids[] = 99 | { 100 | METACALL_STRING, METACALL_STRING, METACALL_STRING 101 | }; 102 | 103 | void * ret = NULL; 104 | 105 | if (metacall_load_from_file("py", py_scripts, sizeof(py_scripts) / sizeof(py_scripts[0]), NULL) != 0) 106 | { 107 | return cleanup(3); 108 | } 109 | 110 | ret = metacallt("sum", sum_ids, "a", "b", "c"); 111 | 112 | if (ret == NULL) 113 | { 114 | return cleanup(4); 115 | } 116 | 117 | /* Check result */ 118 | { 119 | const char result[] = "abc"; 120 | const char * str = metacall_value_to_string(ret); 121 | 122 | if (strncmp(str, result, sizeof(result)) != 0) 123 | { 124 | return cleanup(5); 125 | } 126 | 127 | printf("%s\n", str); 128 | } 129 | 130 | metacall_value_destroy(ret); 131 | } 132 | 133 | /* Ruby */ 134 | { 135 | const char * rb_scripts[] = 136 | { 137 | "/scripts/mult.rb" 138 | }; 139 | 140 | const enum metacall_value_id mult_ids[] = 141 | { 142 | METACALL_LONG, METACALL_LONG 143 | }; 144 | 145 | void * ret = NULL; 146 | 147 | if (metacall_load_from_file("rb", rb_scripts, sizeof(rb_scripts) / sizeof(rb_scripts[0]), NULL) != 0) 148 | { 149 | return cleanup(6); 150 | } 151 | 152 | ret = metacall("add", 324, 775); 153 | 154 | if (ret == NULL) 155 | { 156 | return cleanup(7); 157 | } 158 | 159 | /* Check result */ 160 | { 161 | const int result = 1099; 162 | const int value = metacall_value_to_int(ret); 163 | 164 | if (result != value) 165 | { 166 | return cleanup(8); 167 | } 168 | 169 | 170 | printf("%d\n", value); 171 | } 172 | 173 | metacall_value_destroy(ret); 174 | 175 | /* TODO: This generates a segmentation fault, review */ 176 | /* 177 | ret = metacallt("mult", mult_ids, 324L, 775L); 178 | 179 | if (ret == NULL) 180 | { 181 | return cleanup(7); 182 | } 183 | 184 | *//* Check result *//* 185 | { 186 | const long result = 251100L; 187 | const long value = metacall_value_to_long(ret); 188 | 189 | if (result != value) 190 | { 191 | return cleanup(8); 192 | } 193 | 194 | printf("%ld\n", value); 195 | } 196 | 197 | metacall_value_destroy(ret); 198 | */ 199 | } 200 | 201 | 202 | /* Inspect */ 203 | { 204 | size_t size = 0; 205 | 206 | struct metacall_allocator_std_type std_ctx = { &malloc, &realloc, &free }; 207 | 208 | void * allocator = metacall_allocator_create(METACALL_ALLOCATOR_STD, (void *)&std_ctx); 209 | 210 | char * inspect_str = metacall_inspect(&size, allocator); 211 | 212 | printf("Inspect:\n%s\n", inspect_str); 213 | 214 | metacall_allocator_free(allocator, inspect_str); 215 | 216 | metacall_allocator_destroy(allocator); 217 | } 218 | 219 | 220 | return cleanup(0); 221 | } 222 | -------------------------------------------------------------------------------- /tests/cli/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # MetaCall Distributable by Parra Studios 3 | # Distributable infrastructure for MetaCall. 4 | # 5 | # Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | FROM busybox:1.31.1 AS cli_test 21 | 22 | # Image descriptor 23 | LABEL copyright.name="Vicente Eduardo Ferrer Garcia" \ 24 | copyright.address="vic798@gmail.com" \ 25 | maintainer.name="Vicente Eduardo Ferrer Garcia" \ 26 | maintainer.address="vic798@gmail.com" \ 27 | vendor="MetaCall Inc." \ 28 | version="0.1" 29 | 30 | COPY out/tarball.tar.gz / 31 | 32 | RUN cd / \ 33 | && tar --no-same-owner --no-same-permissions -xzf tarball.tar.gz \ 34 | && rm tarball.tar.gz 35 | 36 | COPY tests/scripts/ /scripts/ 37 | 38 | WORKDIR /scripts 39 | 40 | ARG CACHE_INVALIDATE 41 | 42 | RUN echo "Running tests ${CACHE_INVALIDATE}" \ 43 | && set -exo pipefail \ 44 | && export LOADER_SCRIPT_PATH="/scripts/" \ 45 | && source /gnu/etc/profile \ 46 | && export ASAN_OPTIONS="halt_on_error=0" \ 47 | && metacallcli test.mock \ 48 | && metacallcli mult.rb \ 49 | && metacallcli sum.py \ 50 | && printf "load mock test.mock\ninspect\nexit" \ 51 | | metacallcli \ 52 | | grep -e 'function three_str(a_str, b_str, c_str)' \ 53 | && printf "load rb mult.rb\ninspect\nexit" \ 54 | | metacallcli \ 55 | | grep -e 'function add(a, b)' -e 'function mult(a, b)' \ 56 | && printf "load py sum.py\ninspect\nexit" \ 57 | | metacallcli \ 58 | | grep -e 'function sum(a, b, c)' \ 59 | && metacallcli port-test.js \ 60 | | grep "Node.js port works" \ 61 | && metacallcli port-test.py \ 62 | | grep "Python port works" 63 | 64 | # TODO: C# Loader 65 | # && printf "load cs say.cs\ninspect\nexit" \ 66 | # | metacallcli 67 | 68 | # TODO: Ruby Port 69 | # && metacallcli port-test.rb \ 70 | # | grep "Ruby port works" 71 | 72 | ENTRYPOINT ["sh", "-c"] 73 | -------------------------------------------------------------------------------- /tests/exe/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # MetaCall Distributable by Parra Studios 3 | # Distributable infrastructure for MetaCall. 4 | # 5 | # Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | FROM debian:trixie-slim AS exe_test 21 | 22 | # Image descriptor 23 | LABEL copyright.name="Vicente Eduardo Ferrer Garcia" \ 24 | copyright.address="vic798@gmail.com" \ 25 | maintainer.name="Vicente Eduardo Ferrer Garcia" \ 26 | maintainer.address="vic798@gmail.com" \ 27 | vendor="MetaCall Inc." \ 28 | version="0.1" 29 | 30 | SHELL ["/bin/bash", "-c"] 31 | 32 | RUN apt-get update \ 33 | && apt-get install --no-install-recommends -y python3 nodejs ruby 34 | 35 | COPY out/tarball.tar.gz / 36 | 37 | RUN cd / \ 38 | && tar --no-same-owner --no-same-permissions -xzf tarball.tar.gz \ 39 | && rm tarball.tar.gz 40 | 41 | COPY tests/scripts/ /scripts/ 42 | 43 | WORKDIR /scripts 44 | 45 | ARG CACHE_INVALIDATE 46 | 47 | RUN echo "Running tests ${CACHE_INVALIDATE}" \ 48 | && set -exo pipefail \ 49 | && source /gnu/etc/profile \ 50 | && whereis node \ 51 | && ls -la /usr/bin/node \ 52 | && /usr/bin/node port-test.js | grep \ 53 | -e 'Node.js port works' \ 54 | && whereis python3 \ 55 | && ls -la /usr/bin/python3 \ 56 | && /usr/bin/python3 port-test.py | grep \ 57 | -e 'Python port works' 58 | # \ 59 | # && ruby port-test.rb | grep \ 60 | # -e 'Ruby port works' 61 | 62 | ENTRYPOINT ["sh", "-c"] 63 | -------------------------------------------------------------------------------- /tests/node/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # MetaCall Distributable by Parra Studios 3 | # Distributable infrastructure for MetaCall. 4 | # 5 | # Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | FROM busybox:1.31.1 AS node_test 21 | 22 | # Image descriptor 23 | LABEL copyright.name="Vicente Eduardo Ferrer Garcia" \ 24 | copyright.address="vic798@gmail.com" \ 25 | maintainer.name="Vicente Eduardo Ferrer Garcia" \ 26 | maintainer.address="vic798@gmail.com" \ 27 | vendor="MetaCall Inc." \ 28 | version="0.1" 29 | 30 | COPY out/tarball.tar.gz / 31 | 32 | RUN cd / \ 33 | && tar --no-same-owner --no-same-permissions -xzf tarball.tar.gz \ 34 | && rm tarball.tar.gz 35 | 36 | COPY tests/scripts/ /scripts/ 37 | 38 | COPY tests/node/test.js /scripts/ 39 | 40 | WORKDIR /scripts 41 | 42 | ARG CACHE_INVALIDATE 43 | 44 | RUN echo "Running tests ${CACHE_INVALIDATE}" \ 45 | && set -exo pipefail \ 46 | && source /gnu/etc/profile \ 47 | && export LOADER_SCRIPT_PATH="/scripts/" \ 48 | && export NODE_ENV=debug \ 49 | && export ASAN_OPTIONS="halt_on_error=0" \ 50 | && printf 'load node test.js\ncall mock()\nexit' | metacallcli \ 51 | | grep \ 52 | -e 'Hello World' \ 53 | && printf 'load node test.js\ncall python()\nexit' | metacallcli \ 54 | | grep \ 55 | -e '366667' \ 56 | && metacallcli port-test.js \ 57 | | grep \ 58 | -e 'Node.js port works' 59 | 60 | ENTRYPOINT ["sh", "-c"] 61 | -------------------------------------------------------------------------------- /tests/node/test.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | * MetaCall Distributable by Parra Studios 5 | * Distributable infrastructure for MetaCall. 6 | * 7 | * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | 23 | 24 | const path = require('path'); 25 | const { metacall, metacall_load_from_file, metacall_inspect } = require('metacall'); 26 | 27 | /* TODO: Monkey-patch */ 28 | 29 | module.exports = { 30 | mock: function() { 31 | /* Mock */ 32 | console.log(metacall_load_from_file('mock', [ 'test.mock' ])); 33 | console.log(metacall('three_str', 'a', 'b', 'c')); 34 | }, 35 | python: function() { 36 | /* Python */ 37 | console.log(metacall_load_from_file('py', [ 'sum.py' ])); 38 | console.log(metacall_inspect()); 39 | console.log("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"); 40 | console.log(metacall('sum', 111111, 222222, 33334)); 41 | console.log("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"); 42 | }, 43 | }; 44 | 45 | -------------------------------------------------------------------------------- /tests/python/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # MetaCall Distributable by Parra Studios 3 | # Distributable infrastructure for MetaCall. 4 | # 5 | # Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | FROM busybox:1.31.1 AS python_test 21 | 22 | # Image descriptor 23 | LABEL copyright.name="Vicente Eduardo Ferrer Garcia" \ 24 | copyright.address="vic798@gmail.com" \ 25 | maintainer.name="Vicente Eduardo Ferrer Garcia" \ 26 | maintainer.address="vic798@gmail.com" \ 27 | vendor="MetaCall Inc." \ 28 | version="0.1" 29 | 30 | COPY out/tarball.tar.gz / 31 | 32 | RUN cd / \ 33 | && tar --no-same-owner --no-same-permissions -xzf tarball.tar.gz \ 34 | && rm tarball.tar.gz 35 | 36 | COPY tests/scripts/ /scripts/ 37 | 38 | COPY tests/python/script.py /scripts/ 39 | 40 | WORKDIR /scripts 41 | 42 | ARG CACHE_INVALIDATE 43 | 44 | RUN echo "Running tests ${CACHE_INVALIDATE}" \ 45 | && set -exo pipefail \ 46 | && source /gnu/etc/profile \ 47 | && pip3 install metacall \ 48 | && export LOADER_SCRIPT_PATH="/scripts/" \ 49 | && export ASAN_OPTIONS="halt_on_error=0" \ 50 | && printf 'load py script.py\ninspect\ncall test()\nexit' | metacallcli \ 51 | | grep \ 52 | -e 'Hello World' 53 | 54 | ENTRYPOINT ["sh", "-c"] 55 | -------------------------------------------------------------------------------- /tests/python/script.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # 4 | # MetaCall Distributable by Parra Studios 5 | # Distributable infrastructure for MetaCall. 6 | # 7 | # Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia 8 | # 9 | # Licensed under the Apache License, Version 2.0 (the "License"); 10 | # you may not use this file except in compliance with the License. 11 | # You may obtain a copy of the License at 12 | # 13 | # http://www.apache.org/licenses/LICENSE-2.0 14 | # 15 | # Unless required by applicable law or agreed to in writing, software 16 | # distributed under the License is distributed on an "AS IS" BASIS, 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | # See the License for the specific language governing permissions and 19 | # limitations under the License. 20 | # 21 | 22 | from metacall import metacall, metacall_load_from_file 23 | 24 | metacall_load_from_file('mock', ['test.mock']); 25 | 26 | def test(): 27 | return metacall('three_str', 'a', 'b', 'c'); 28 | -------------------------------------------------------------------------------- /tests/ruby/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # MetaCall Distributable by Parra Studios 3 | # Distributable infrastructure for MetaCall. 4 | # 5 | # Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | FROM busybox:1.31.1 AS ruby_test 21 | 22 | # Image descriptor 23 | LABEL copyright.name="Vicente Eduardo Ferrer Garcia" \ 24 | copyright.address="vic798@gmail.com" \ 25 | maintainer.name="Vicente Eduardo Ferrer Garcia" \ 26 | maintainer.address="vic798@gmail.com" \ 27 | vendor="MetaCall Inc." \ 28 | version="0.1" 29 | 30 | COPY out/tarball.tar.gz / 31 | 32 | RUN cd / \ 33 | && tar --no-same-owner --no-same-permissions -xzf tarball.tar.gz \ 34 | && rm tarball.tar.gz 35 | 36 | COPY tests/ruby/script.rb /scripts/ 37 | COPY tests/ruby/Gemfile /scripts/ 38 | 39 | WORKDIR /scripts 40 | 41 | ARG CACHE_INVALIDATE 42 | 43 | RUN echo "Running tests ${CACHE_INVALIDATE}" \ 44 | && set -exo pipefail \ 45 | && source /gnu/etc/profile \ 46 | && gem install open-uri \ 47 | && bundle install --verbose \ 48 | && bundle config path \ 49 | && export LOADER_SCRIPT_PATH="/scripts/" \ 50 | && export ASAN_OPTIONS="halt_on_error=0" \ 51 | && metacallcli script.rb \ 52 | | grep \ 53 | -e 'Ruby simple test' 54 | 55 | ENTRYPOINT ["sh", "-c"] 56 | -------------------------------------------------------------------------------- /tests/ruby/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'xml-simple' 4 | -------------------------------------------------------------------------------- /tests/ruby/script.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # 4 | # MetaCall Distributable by Parra Studios 5 | # Distributable infrastructure for MetaCall. 6 | # 7 | # Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia 8 | # 9 | # Licensed under the Apache License, Version 2.0 (the 'License'); 10 | # you may not use this file except in compliance with the License. 11 | # You may obtain a copy of the License at 12 | # 13 | # http://www.apache.org/licenses/LICENSE-2.0 14 | # 15 | # Unless required by applicable law or agreed to in writing, software 16 | # distributed under the License is distributed on an "AS IS" BASIS, 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | # See the License for the specific language governing permissions and 19 | # limitations under the License. 20 | # 21 | 22 | # Debug load path 23 | puts $LOAD_PATH 24 | 25 | puts "Ruby simple test" 26 | 27 | # TODO: 28 | # 29 | # Ruby 2.7 30 | # 31 | # + metacallcli script.rb 32 | # # 33 | # /gnu/store/6669014b1cf15njllsd0ryir5d0gp5ch-ruby-2.7.8/lib/ruby/2.7.0/openssl/buffering.rb:1 34 | # /gnu/store/6669014b1cf15njllsd0ryir5d0gp5ch-ruby-2.7.8/lib/ruby/2.7.0/openssl/ssl.rb:13:in `require' 35 | # /gnu/store/6669014b1cf15njllsd0ryir5d0gp5ch-ruby-2.7.8/lib/ruby/2.7.0/openssl/ssl.rb:13:in `' 36 | # /gnu/store/6669014b1cf15njllsd0ryir5d0gp5ch-ruby-2.7.8/lib/ruby/2.7.0/openssl.rb:21:in `require' 37 | # /gnu/store/6669014b1cf15njllsd0ryir5d0gp5ch-ruby-2.7.8/lib/ruby/2.7.0/openssl.rb:21:in `' 38 | # /gnu/store/6669014b1cf15njllsd0ryir5d0gp5ch-ruby-2.7.8/lib/ruby/2.7.0/net/https.rb:23:in `require' 39 | # /gnu/store/6669014b1cf15njllsd0ryir5d0gp5ch-ruby-2.7.8/lib/ruby/2.7.0/net/https.rb:23:in `' 40 | # /gnu/store/6669014b1cf15njllsd0ryir5d0gp5ch-ruby-2.7.8/lib/ruby/2.7.0/open-uri.rb:321:in `require' 41 | # /gnu/store/6669014b1cf15njllsd0ryir5d0gp5ch-ruby-2.7.8/lib/ruby/2.7.0/open-uri.rb:321:in `open_http' 42 | # /gnu/store/6669014b1cf15njllsd0ryir5d0gp5ch-ruby-2.7.8/lib/ruby/2.7.0/open-uri.rb:764:in `buffer_open' 43 | # /gnu/store/6669014b1cf15njllsd0ryir5d0gp5ch-ruby-2.7.8/lib/ruby/2.7.0/open-uri.rb:235:in `block in open_loop' 44 | # /gnu/store/6669014b1cf15njllsd0ryir5d0gp5ch-ruby-2.7.8/lib/ruby/2.7.0/open-uri.rb:233:in `catch' 45 | # /gnu/store/6669014b1cf15njllsd0ryir5d0gp5ch-ruby-2.7.8/lib/ruby/2.7.0/open-uri.rb:233:in `open_loop' 46 | # /gnu/store/6669014b1cf15njllsd0ryir5d0gp5ch-ruby-2.7.8/lib/ruby/2.7.0/open-uri.rb:174:in `open_uri' 47 | # /gnu/store/6669014b1cf15njllsd0ryir5d0gp5ch-ruby-2.7.8/lib/ruby/2.7.0/open-uri.rb:744:in `open' 48 | # /gnu/store/6669014b1cf15njllsd0ryir5d0gp5ch-ruby-2.7.8/lib/ruby/2.7.0/open-uri.rb:50:in `open' 49 | # eval:25:in `' 50 | # eval:1:in `
' 51 | # Error: Ruby evaluation failed script.rb 52 | # 53 | ################################################################################################################ 54 | # 55 | # Ruby 3.2 & 3.3 56 | # 57 | # # 58 | # /gnu/store/75dz8nhrawcahgxnjjxpfazmkq6pmcxh-ruby-3.2.3/lib/ruby/3.2.0/uri/common.rb:21:in `' 59 | # /gnu/store/75dz8nhrawcahgxnjjxpfazmkq6pmcxh-ruby-3.2.3/lib/ruby/3.2.0/uri/common.rb:15:in `'# /gnu/store/75dz8nhrawcahgxnjjxpfazmkq6pmcxh-ruby-3.2.3/lib/ruby/3.2.0/uri.rb:94:in `require_relative' 60 | # /gnu/store/75dz8nhrawcahgxnjjxpfazmkq6pmcxh-ruby-3.2.3/lib/ruby/3.2.0/uri.rb:94:in `' 61 | # /gnu/store/75dz8nhrawcahgxnjjxpfazmkq6pmcxh-ruby-3.2.3/lib/ruby/3.2.0/open-uri.rb:2:in `require' 62 | # eval:23:in `require' 63 | # eval:23:in `'uby/3.2.0/open-uri.rb:2:in `' 64 | # eval:1:in `
' 65 | # 66 | ################################################################################################################ 67 | # 68 | # Code: 69 | # 70 | # require 'open-uri' 71 | # 72 | # URI.open('http://www.ruby-lang.org/') {|f| 73 | # f.each_line {|line| p line} 74 | # } 75 | ################################################################################################################ 76 | 77 | # TODO: Ruby cannot find gems installed by bundle 78 | #require 'xmlsimple' 79 | #result = XmlSimple.xml_in(html) 80 | #p result 81 | -------------------------------------------------------------------------------- /tests/scripts/fib.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * MetaCall Distributable by Parra Studios 3 | * Distributable infrastructure for MetaCall. 4 | * 5 | * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | 'use strict'; 21 | 22 | export function fibonacci(num: number): number { 23 | return (num <= 1) ? 1 : fibonacci(num - 1) + fibonacci(num - 2); 24 | } 25 | -------------------------------------------------------------------------------- /tests/scripts/mult.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # 4 | # MetaCall Distributable by Parra Studios 5 | # Distributable infrastructure for MetaCall. 6 | # 7 | # Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia 8 | # 9 | # Licensed under the Apache License, Version 2.0 (the "License"); 10 | # you may not use this file except in compliance with the License. 11 | # You may obtain a copy of the License at 12 | # 13 | # http://www.apache.org/licenses/LICENSE-2.0 14 | # 15 | # Unless required by applicable law or agreed to in writing, software 16 | # distributed under the License is distributed on an "AS IS" BASIS, 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | # See the License for the specific language governing permissions and 19 | # limitations under the License. 20 | # 21 | 22 | def mult(a, b) 23 | result = left * right 24 | return result 25 | end 26 | 27 | def add(a: Fixnum, b: Fixnum) 28 | result = a + b 29 | return result 30 | end 31 | -------------------------------------------------------------------------------- /tests/scripts/port-test.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | * MetaCall Distributable by Parra Studios 5 | * Distributable infrastructure for MetaCall. 6 | * 7 | * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | 23 | const { metacall } = require('metacall'); 24 | 25 | console.log("Node.js port works"); 26 | -------------------------------------------------------------------------------- /tests/scripts/port-test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # 4 | # MetaCall Distributable by Parra Studios 5 | # Distributable infrastructure for MetaCall. 6 | # 7 | # Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia 8 | # 9 | # Licensed under the Apache License, Version 2.0 (the "License"); 10 | # you may not use this file except in compliance with the License. 11 | # You may obtain a copy of the License at 12 | # 13 | # http://www.apache.org/licenses/LICENSE-2.0 14 | # 15 | # Unless required by applicable law or agreed to in writing, software 16 | # distributed under the License is distributed on an "AS IS" BASIS, 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | # See the License for the specific language governing permissions and 19 | # limitations under the License. 20 | # 21 | 22 | import metacall 23 | 24 | print("Python port works") 25 | -------------------------------------------------------------------------------- /tests/scripts/port-test.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # 4 | # MetaCall Distributable by Parra Studios 5 | # Distributable infrastructure for MetaCall. 6 | # 7 | # Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia 8 | # 9 | # Licensed under the Apache License, Version 2.0 (the 'License'); 10 | # you may not use this file except in compliance with the License. 11 | # You may obtain a copy of the License at 12 | # 13 | # http://www.apache.org/licenses/LICENSE-2.0 14 | # 15 | # Unless required by applicable law or agreed to in writing, software 16 | # distributed under the License is distributed on an "AS IS" BASIS, 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | # See the License for the specific language governing permissions and 19 | # limitations under the License. 20 | # 21 | 22 | require 'metacall' 23 | 24 | puts "Ruby port works" 25 | -------------------------------------------------------------------------------- /tests/scripts/say.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * MetaCall Distributable by Parra Studios 3 | * Distributable infrastructure for MetaCall. 4 | * 5 | * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | using System; 21 | 22 | namespace Scripts 23 | { 24 | public class Program 25 | { 26 | public static string Say(string text) 27 | { 28 | Console.WriteLine(text); 29 | 30 | return text; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /tests/scripts/sum.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # 4 | # MetaCall Distributable by Parra Studios 5 | # Distributable infrastructure for MetaCall. 6 | # 7 | # Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia 8 | # 9 | # Licensed under the Apache License, Version 2.0 (the "License"); 10 | # you may not use this file except in compliance with the License. 11 | # You may obtain a copy of the License at 12 | # 13 | # http://www.apache.org/licenses/LICENSE-2.0 14 | # 15 | # Unless required by applicable law or agreed to in writing, software 16 | # distributed under the License is distributed on an "AS IS" BASIS, 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | # See the License for the specific language governing permissions and 19 | # limitations under the License. 20 | # 21 | 22 | def sum(a, b, c): 23 | return a + b + c; 24 | -------------------------------------------------------------------------------- /tests/tsx/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # MetaCall Distributable by Parra Studios 3 | # Distributable infrastructure for MetaCall. 4 | # 5 | # Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | FROM busybox:1.31.1 AS tsx_test 21 | 22 | # Image descriptor 23 | LABEL copyright.name="Vicente Eduardo Ferrer Garcia" \ 24 | copyright.address="vic798@gmail.com" \ 25 | maintainer.name="Vicente Eduardo Ferrer Garcia" \ 26 | maintainer.address="vic798@gmail.com" \ 27 | vendor="MetaCall Inc." \ 28 | version="0.1" 29 | 30 | COPY out/tarball.tar.gz / 31 | 32 | RUN cd / \ 33 | && tar --no-same-owner --no-same-permissions -xzf tarball.tar.gz \ 34 | && rm tarball.tar.gz 35 | 36 | COPY tests/tsx/test.tsx /scripts/ 37 | COPY tests/tsx/tsconfig.json /scripts/ 38 | COPY tests/tsx/package.json /scripts/ 39 | COPY tests/tsx/package-lock.json /scripts/ 40 | 41 | # Needed in order to load the tsconfig.json 42 | WORKDIR /scripts 43 | 44 | ARG CACHE_INVALIDATE 45 | 46 | RUN echo "Running tests ${CACHE_INVALIDATE}" \ 47 | && set -exo pipefail \ 48 | && source /gnu/etc/profile \ 49 | && export LOADER_SCRIPT_PATH="/scripts/" \ 50 | && export NODE_ENV=debug \ 51 | && export ASAN_OPTIONS="halt_on_error=0" \ 52 | && npm install \ 53 | && printf 'load ts test.tsx\ninspect\ncall hello("world")\nexit' | metacallcli \ 54 | | grep \ 55 | -e '

Hello world

' 56 | 57 | ENTRYPOINT ["sh", "-c"] 58 | -------------------------------------------------------------------------------- /tests/tsx/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "templating-tsx", 3 | "version": "1.0.0", 4 | "lockfileVersion": 2, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "templating-tsx", 9 | "version": "1.0.0", 10 | "license": "Apache-2.0", 11 | "dependencies": { 12 | "react": "^17.0.2", 13 | "react-dom": "^17.0.2" 14 | } 15 | }, 16 | "node_modules/js-tokens": { 17 | "version": "4.0.0", 18 | "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", 19 | "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" 20 | }, 21 | "node_modules/loose-envify": { 22 | "version": "1.4.0", 23 | "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", 24 | "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", 25 | "dependencies": { 26 | "js-tokens": "^3.0.0 || ^4.0.0" 27 | }, 28 | "bin": { 29 | "loose-envify": "cli.js" 30 | } 31 | }, 32 | "node_modules/object-assign": { 33 | "version": "4.1.1", 34 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 35 | "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", 36 | "engines": { 37 | "node": ">=0.10.0" 38 | } 39 | }, 40 | "node_modules/react": { 41 | "version": "17.0.2", 42 | "resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz", 43 | "integrity": "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==", 44 | "dependencies": { 45 | "loose-envify": "^1.1.0", 46 | "object-assign": "^4.1.1" 47 | }, 48 | "engines": { 49 | "node": ">=0.10.0" 50 | } 51 | }, 52 | "node_modules/react-dom": { 53 | "version": "17.0.2", 54 | "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-17.0.2.tgz", 55 | "integrity": "sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==", 56 | "dependencies": { 57 | "loose-envify": "^1.1.0", 58 | "object-assign": "^4.1.1", 59 | "scheduler": "^0.20.2" 60 | } 61 | }, 62 | "node_modules/scheduler": { 63 | "version": "0.20.2", 64 | "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.20.2.tgz", 65 | "integrity": "sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==", 66 | "dependencies": { 67 | "loose-envify": "^1.1.0", 68 | "object-assign": "^4.1.1" 69 | } 70 | } 71 | }, 72 | "dependencies": { 73 | "js-tokens": { 74 | "version": "4.0.0", 75 | "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", 76 | "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" 77 | }, 78 | "loose-envify": { 79 | "version": "1.4.0", 80 | "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", 81 | "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", 82 | "requires": { 83 | "js-tokens": "^3.0.0 || ^4.0.0" 84 | } 85 | }, 86 | "object-assign": { 87 | "version": "4.1.1", 88 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 89 | "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" 90 | }, 91 | "react": { 92 | "version": "17.0.2", 93 | "resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz", 94 | "integrity": "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==", 95 | "requires": { 96 | "loose-envify": "^1.1.0", 97 | "object-assign": "^4.1.1" 98 | } 99 | }, 100 | "react-dom": { 101 | "version": "17.0.2", 102 | "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-17.0.2.tgz", 103 | "integrity": "sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==", 104 | "requires": { 105 | "loose-envify": "^1.1.0", 106 | "object-assign": "^4.1.1", 107 | "scheduler": "^0.20.2" 108 | } 109 | }, 110 | "scheduler": { 111 | "version": "0.20.2", 112 | "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.20.2.tgz", 113 | "integrity": "sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==", 114 | "requires": { 115 | "loose-envify": "^1.1.0", 116 | "object-assign": "^4.1.1" 117 | } 118 | } 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /tests/tsx/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "templating-tsx", 3 | "version": "1.0.0", 4 | "main": "templating.tsx", 5 | "scripts": { 6 | "test": "echo \"Error: no test specified\" && exit 1" 7 | }, 8 | "license": "Apache-2.0", 9 | "dependencies": { 10 | "react": "^17.0.2", 11 | "react-dom": "^17.0.2" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/tsx/test.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { renderToString } from 'react-dom/server'; 3 | 4 | export function hello(text: string): string { 5 | return renderToString(

{`Hello ${text}`}

); 6 | } 7 | -------------------------------------------------------------------------------- /tests/tsx/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "include": [ 3 | "templating.tsx" 4 | ], 5 | "compilerOptions": { 6 | "target": "es6", 7 | "module": "commonjs", 8 | "esModuleInterop": true, 9 | "jsx": "react", 10 | "lib": ["es2016", "dom"] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /tests/typescript/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # MetaCall Distributable by Parra Studios 3 | # Distributable infrastructure for MetaCall. 4 | # 5 | # Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | FROM busybox:1.31.1 AS ts_test 21 | 22 | # Image descriptor 23 | LABEL copyright.name="Vicente Eduardo Ferrer Garcia" \ 24 | copyright.address="vic798@gmail.com" \ 25 | maintainer.name="Vicente Eduardo Ferrer Garcia" \ 26 | maintainer.address="vic798@gmail.com" \ 27 | vendor="MetaCall Inc." \ 28 | version="0.1" 29 | 30 | COPY out/tarball.tar.gz / 31 | 32 | RUN cd / \ 33 | && tar --no-same-owner --no-same-permissions -xzf tarball.tar.gz \ 34 | && rm tarball.tar.gz 35 | 36 | COPY tests/scripts/fib.ts /scripts/ 37 | 38 | WORKDIR /scripts 39 | 40 | ARG CACHE_INVALIDATE 41 | 42 | RUN echo "Running tests ${CACHE_INVALIDATE}" \ 43 | && export LOADER_SCRIPT_PATH="/scripts/" \ 44 | && export NODE_ENV=debug \ 45 | && source /gnu/etc/profile \ 46 | && export ASAN_OPTIONS="halt_on_error=0" \ 47 | && printf 'load ts fib.ts\ncall fibonacci(10)\nexit' | metacallcli \ 48 | | grep \ 49 | -e '89' 50 | 51 | ENTRYPOINT ["sh", "-c"] 52 | --------------------------------------------------------------------------------