Giter VIP home page Giter VIP logo

distributable-windows's People

Contributors

roysti10 avatar sagarkumar3105 avatar viferga avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

distributable-windows's Issues

Enable loaders and link them to the locally installed runtimes

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

Connecting Windows Tests from Core to Distributable Windows

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*.*.*'

MinGW may be problematic with dynamic linking or NodeJS build of node.dll

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.

Load py files fails

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');

ModuleNotFoundError: No module named 'metacall'

launchpads.py

import metacall
metacall.initialize()
metacall.load_from_file('./spacex.js', 'javascript')
response = metacall.call('getSpaceXData')
print(json.dumps(response, indent=4))

spacex.js

export const getSpaceXData = async () => {
  try {
    const response = await axios.get('https://api.spacexdata.com/v3/launchpads')
    return response.data
  } catch (error) {
    console.error(error)
  }
}

requirements.txt

Django==4.1.2
mysql-connector==2.2.9
sqlparse==0.4.3
tzdata==2022.5
metacall==0.5.0

Replace w64devkit Docker build from the script

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:

git clone https://github.com/skeeto/w64devkit
cd w64devkit
echo Make sure you have started DOCKER on your system and then press any key to continue...
pause >nul
docker build -t w64devkit .
docker run --rm w64devkit >w64devkit.zip

By a script that directly downloads the w64devkit.

Ruby 3.1 not working

Seems to be generating a segmentation fault, it needs review from metacall/core.

MinGW may be problematic with dynamic linking or NodeJS build of node.dll

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.

Create the installer script

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

Ci/cd test case passes even though in reality it fails

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.