Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

Embedded executables do not run #12

Open
rjdbcm opened this issue Sep 2, 2021 · 0 comments
Open

Embedded executables do not run #12

rjdbcm opened this issue Sep 2, 2021 · 0 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@rjdbcm
Copy link
Owner

rjdbcm commented Sep 2, 2021

Describe the bug
As far as I can tell this is from a known limitation of Cython. When you import from Aspidites.tests.examples.compiled without invoking main it just grabs the current stack frame from the calling scope. As of now Cython does not make use of stack frames and disposes of them as soon as you are out of scope.

$ ./compiled
Traceback (most recent call last):
  File "Aspidites/tests/examples/compiled.pyx", line 79, in init Aspidites.tests.examples.compiled
    C = pmap({'a': (3+5), 'b': 8, 'c': True, 4: None, 'd': Maybe(SafeExp, 6, 2*5+3)})
  File "Aspidites/monads.pyx", line 37, in Aspidites.monads.Maybe.__init__
  File "/Users/ross/.pyenv/versions/3.9.6/lib/python3.9/inspect.py", line 1552, in stack
    return getouterframes(sys._getframe(1), context)
ValueError: call stack is not deep enough

To Reproduce
Steps to reproduce the behavior:

  1. Run the binary generated from embed.

Expected behavior
It should print hello world

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: macos-11
  • Version 0.14.31

Proposed Workaround
I tried getting rid of stack inspection but the first call to Maybe or SafeExp but seemingly got the exact same error. Not sure if that's due to caching from Cython or what...

@rjdbcm rjdbcm added bug Something isn't working help wanted Extra attention is needed labels Sep 2, 2021
@rjdbcm rjdbcm added this to the Standalone Executables milestone Sep 2, 2021
@rjdbcm rjdbcm self-assigned this Sep 2, 2021
@rjdbcm rjdbcm added this to To do in v1.0.0 Milestones via automation Sep 2, 2021
@rjdbcm rjdbcm changed the title Embedded executables do not run. Embedded executables do not run Sep 2, 2021
@rjdbcm rjdbcm pinned this issue Oct 11, 2021
@rjdbcm rjdbcm moved this from To do to Sidelined in v1.0.0 Milestones Oct 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
v1.0.0 Milestones
  
Sidelined
Development

No branches or pull requests

1 participant