Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build and Usage Instructions #2

Closed
kjeet opened this issue May 3, 2018 · 6 comments
Closed

Build and Usage Instructions #2

kjeet opened this issue May 3, 2018 · 6 comments
Milestone

Comments

@kjeet
Copy link

kjeet commented May 3, 2018

I was experimenting with the graalpython following the directions from https://www.graalvm.org/docs/reference-manual/graal-updater/

I noticed that none of the installed jars seemed to contain SignalModuleBuiltins, so I figured I'd try to build this project myself but I can't seem to find build instructions.

Thanks!

@fniephaus
Copy link
Member

I agree that additional instructions would be useful. But since GraalPython uses mx, you should be able to build it with mx build.

@kjeet
Copy link
Author

kjeet commented May 3, 2018

I don't know if this is correct but I was able to build it by first locally building:
graal with the directions here: https://github.com/oracle/graal/blob/master/tools/README.md
then checkout out sulong and built that with mx build and then could even start building graalpython.

I had to comment out the block of code from graalpython:
mx.graalpython/mx_graalpython.py:532: mx_sdk.register_graalvm_component...
but that allowed the jars to complete building!

I can run a "Hello Python!" with the following (the CoreHome and StdLibHome set in java):
CP=:.:../JARS/graal-sdk.jar:../JARS/truffle-api.jar:../JARS/graalpython.jar
jdk10/bin/java -cp $CP HelloPolyglot

but if I run context.eval("python", "import platform") I get:
Exception in thread "main" ImportError: cannot import name 'monotonic' at <python> <module '../JARS/pyl/lib-python/3/subprocess.py'>(../JARS/pyl/lib-python/3/subprocess.py:54-56:1620-1696)

And it's true I'd expect "from time import monotonic as _time" from subprocess.py to fail. TimeModuleBuiltins.java declares @CoreFunctions(defineModule = "time") but has no mention of 'monotonic'.

(I just saw you response as I was typing this up)

@timfel
Copy link
Member

timfel commented May 3, 2018

@kjeet As you noticed, import platform is one of the many modules that doesn't work right now. The reason why you had to comment that block of code in mx_graalpython is that the build process is subject to change, but that is still an ongoing process. We'll have build instructions once the dust has settled a little bit :)

@kjeet
Copy link
Author

kjeet commented May 3, 2018

Awesome.
Anything I can do to help speed that along? or is this not a good stage to try to onboard as a contributor?
I'm a huge fan of jython and I'd love to see this get to the same level.

@timfel
Copy link
Member

timfel commented May 3, 2018

Thanks for the offer - at this point contributions will be difficult to integrate due to many moving parts. In a few weeks and after a couple of more RCs the situation should improve and then contributions would be easier.

@kjeet
Copy link
Author

kjeet commented May 4, 2018

Interesting. So did that platform.py code never work? or was it relying on functionality that got removed later for some reason?

Is the python code forked from somewhere?

@timfel timfel added this to the rc2 milestone May 17, 2018
@kjeet kjeet closed this as completed Jun 3, 2018
graalvmbot pushed a commit that referenced this issue May 18, 2022
Merge in ~PETR.PISL_ORACLE.COM/pythonjavapegparser from tim/update-actions to master

* commit '84111aa797c27c6f0ce88cedaef425efd558f312': (38 commits)
  change (soft)keywords to arrays of arrays, since microbenchmarking shows this is faster for our small lists
  add load factor for keyword hashing
  update license headers
  expose translated casts as actions
  translate two more pegen.c helper functions
  replace _PyPegen_seq_insert_in_front with this.insertInFront
  enable simple assignment action
  make missing actions very prominent in debug
  remove generated python parser
  revert pegen to CPython vanilla version
  import pegen from cpython b5b98bd8f8c72a9068cf149dbc162c8c95d30057 (same as the grammar)
  add back mapping to token String names
  add javadoc and reduce visibility
  remove the code string from ParserTokenizer
  add tests for atoms we support now
  update golden files
  fix temporary rule return value to object
  more parsing fixes
  fix test compilation
  rules have to be public
  ...
graalvmbot pushed a commit that referenced this issue Dec 16, 2022
PullRequest: graalpython/2567
The-Alchemist added a commit to The-Alchemist/graalpython that referenced this issue Mar 15, 2023
`utils.py` has changed slightly:

https://github.com/Ousret/charset_normalizer/blob/3.1.0/charset_normalizer/utils.py

```
Collecting charset-normalizer<4.0,>=2.0
  Downloading charset_normalizer-3.1.0-py3-none-any.whl (46 kB)
     |████████████████████████████████| 46 kB 631 kB/s
Looking for GraalPy patches for charset_normalizer
Patching package charset_normalizer using /Library/Java/JavaVirtualMachines/graalvm-ce-java19-22.3.1/Contents/Home/languages/python/lib-graalpython/patches/charset_normalizer/whl/charset_normalizer.patch
patching file charset_normalizer/utils.py
Hunk oracle#1 FAILED at 11.
Hunk oracle#2 succeeded at 258 with fuzz 2 (offset 11 lines).
1 out of 2 hunks FAILED -- saving rejects to file charset_normalizer/utils.py.rej
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants