metacall / distributable-windows Goto Github PK
View Code? Open in Web Editor NEWWindows redistributable for shipping MetaCall Core.
License: Apache License 2.0
Windows redistributable for shipping MetaCall Core.
License: Apache License 2.0
When installing DotNet it shows an interface at the end that you must click, it should be run completely automated.
This needs to modify the code from metacall/core in order to work.
Enable each loader and link it to the correct path in the local folder.
For enabling the loaders, you must add the following options:
-DOPTION_BUILD_LOADERS_PY=ON -DOPTION_BUILD_LOADERS_NODE=ON -DOPTION_BUILD_LOADERS_CS=ON -DOPTION_BUILD_LOADERS_RB=ON -DOPTION_BUILD_LOADERS_TS=ON
Here's the complete list:
https://github.com/metacall/core/blob/ba0d8b49d765b72feae26ccc690a64afb4b30f59/source/loaders/CMakeLists.txt#L7
As they are being built in local folders, probably you will need to link them manually, you will face some problems when doing this. One option is to manually overwrite the variables after cloning, I had to do that in Guix because some CMake Find scripts are not configurable.
This is the way of doing it in NetCore: https://github.com/metacall/core/blob/ba0d8b49d765b72feae26ccc690a64afb4b30f59/tools/metacall-configure.sh#L201
On the Core Repo, We have used repository dispatch action, so that when a tag is pushed, it will check the tests and if passed it will trigger this repo's CI to build the distributable for Linux.
Solution continues for this issue -> Core Repo : metacall/core#505
name: "MetaCall Distributable Windows Release"
on:
repository_dispatch:
types: [test-trigger]
pull_request:
push:
tags:
- 'v*.*.*'
Create tests and add them as an extra phase in the workflow.
You can use the ones in distributable-linux as a base: https://github.com/metacall/distributable/tree/master/tests
I have tried to run MetaCall CLI and for some reason it does nothing. The problem may be related with dynamic linking but I am not sure. I know MetaCall fully works with MSVC, we should consider switching to that compiler.
In addition, NodeJS cannot be built with MinGW so.. basically we should switch to MSVC or provide a binary distribution of node where node.dll is already compiled.
Welcome to Tijuana, tequila, sexo & marijuana.
> load py test.py
Traceback (most recent call last):
File "py_loader_impl_load_from_file_path", line 33, in load_from_path
File "py_loader_impl_load_from_file_path", line 8, in load_from_spec
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "C:\Users\tauro\Documents\opensource\distributable-windows\tests\python\test.py", line 1, in <module>
from metacall import metacall_load_from_file
ModuleNotFoundError: No module named 'metacall'
Error: Python Error: Exception raised while loading the module 'test.py'
Error: Python Error: [Type: <class 'ModuleNotFoundError'>]: No module named 'metacall'
Traceback (most recent call last):
File "py_loader_impl_load_from_file_path", line 33, in load_from_path
File "py_loader_impl_load_from_file_path", line 8, in load_from_spec
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "C:\Users\tauro\Documents\opensource\distributable-windows\tests\python\test.py", line 1, in <module>
from metacall import metacall_load_from_file
ModuleNotFoundError: No module named 'metacall'
Script (test.py) load error in loader (py)
> load py ../../x.py
Traceback (most recent call last):
File "py_loader_impl_load_from_file_path", line 33, in load_from_path
File "py_loader_impl_load_from_file_path", line 8, in load_from_spec
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "C:\Users\tauro\Documents\opensource\distributable-windows\x.py", line 1, in <module>
from metacall import metacall_load_from_file
ImportError: cannot import name 'metacall_load_from_file' from 'metacall' (unknown location)
Error: Python Error: Exception raised while loading the module '../../x.py'
Error: Python Error: [Type: <class 'ImportError'>]: cannot import name 'metacall_load_from_file' from 'metacall' (unknown location)
Traceback (most recent call last):
File "py_loader_impl_load_from_file_path", line 33, in load_from_path
File "py_loader_impl_load_from_file_path", line 8, in load_from_spec
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "C:\Users\tauro\Documents\opensource\distributable-windows\x.py", line 1, in <module>
from metacall import metacall_load_from_file
ImportError: cannot import name 'metacall_load_from_file' from 'metacall' (unknown location)
Script (../../x.py) load error in loader (py)
x.py
from metacall import metacall_load_from_file
metacall_load_from_file('mock', ['test.mock'])
test.py
from metacall import metacall_load_from_file
metacall_load_from_file('mock', ['test.mock']);
def test():
return metacall('three_str', 'a', 'b', 'c');
import metacall
metacall.initialize()
metacall.load_from_file('./spacex.js', 'javascript')
response = metacall.call('getSpaceXData')
print(json.dumps(response, indent=4))
export const getSpaceXData = async () => {
try {
const response = await axios.get('https://api.spacexdata.com/v3/launchpads')
return response.data
} catch (error) {
console.error(error)
}
}
Django==4.1.2
mysql-connector==2.2.9
sqlparse==0.4.3
tzdata==2022.5
metacall==0.5.0
I just have discovered that w64devkit is also distributed as binaries. So we do not need to build it ourselves, and we won't depend on docker to build it.
Here's the link of the distribution: https://github.com/skeeto/w64devkit/releases/download/v1.10.0/w64devkit-1.10.0.zip
We can used a fixed version from the releases: https://github.com/skeeto/w64devkit/releases/tag/v1.10.0
We should replace this:
distributable-windows/build.bat
Lines 5 to 10 in f44df58
By a script that directly downloads the w64devkit.
Seems to be generating a segmentation fault, it needs review from metacall/core.
I have tried to run MetaCall CLI and for some reason it does nothing. The problem may be related with dynamic linking but I am not sure. I know MetaCall fully works with MSVC, we should consider switching to that compiler.
In addition, NodeJS cannot be built with MinGW so.. basically we should switch to MSVC or provide a binary distribution of node where node.dll is already compiled.
This snippet of code: https://github.com/metacall/install/blob/850dcfe81906aa8817ce21fa759b9d9db0eda7a7/install.sh#L404
Allows to implement package managers by means of metacall. For example, running this:
metacall npm install hello
or
metacall pip install hello
We should support this in the launcher in order to make it consistent with the Linux distribution.
Create a script file that downloads the tarball and installs it in the user folder or similar (without need of admin permissions).
It should be implemented in this repo: https://github.com/metacall/install
And the install command should be similar to this:
powershell -exec bypass -c "(New-Object Net.WebClient).Proxy.Credentials=[Net.CredentialCache]::DefaultNetworkCredentials;iwr('https://raw.githubusercontent.com/metacall/install/master/install.ps1')|iex"
Create a proxy script metacall
that mimics the behavior from distributable-linux:
https://github.com/metacall/install/blob/b7d83ca91342df071c2bed1dd52419c666aa62cd/install.sh#L375
https://github.com/metacall/distributable-windows/actions/runs/2708132998/jobs/4232422140#step:5:55
The system cannot find the path specified.
Error: Failed to load: D:\a\distributable-windows\distributable-windows\metacall\lib\file_loader.dll with error code [126]: The specified module could not be found.
Error: Failed to load library from plugin descriptor
Error: Plugin loader from manager 'loader' failed to load plugin: file
Error: Failed to create loader: file
Error: Tried to load 1 file(s) from non existent loader (file): pip
Script (pip) load error in loader (file)
Python test above fails but according to the workflow, the test has passed
For installing into a local directory, you have to use this flag during configuration: CMAKE_INSTALL_PREFIX
.
For example:
-DCMAKE_INSTALL_PREFIX=%loc%/metacall
Here you have the documentation: https://cmake.org/cmake/help/v3.0/variable/CMAKE_INSTALL_PREFIX.html
Use this for uploading metacall.zip
: https://github.com/softprops/action-gh-release
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.