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

ffi object file name and parameterized modules #1448

Closed
weaversa opened this issue Oct 6, 2022 · 1 comment
Closed

ffi object file name and parameterized modules #1448

weaversa opened this issue Oct 6, 2022 · 1 comment
Labels
maybe-fixed Might be resolved, but this needs to be confirmed. parameterized modules Related to Cryptol's parameterized modules

Comments

@weaversa
Copy link
Collaborator

weaversa commented Oct 6, 2022

Here we have a foreign definition in a parameterized module. We create an instantiation of that module and try to load it in cryptol. Cryptol looks for the foreign declaration using the name of the instantiated module rather than the parameterized module.

The test is here: https://github.com/weaversa/cryptol-ffi-tests

$ make
$ cryptol shatest_8.cry
┏━╸┏━┓╻ ╻┏━┓╺┳╸┏━┓╻
┃  ┣┳┛┗┳┛┣━┛ ┃ ┃ ┃┃
┗━╸╹┗╸ ╹ ╹   ╹ ┗━┛┗━╸
version 2.13.0.99 (7e2613a, modified)
https://cryptol.net  :? for help

Loading module Cryptol
Loading module shatest
Loading module shatest_8
[error] Failed to load foreign implementations for module shatest_8:
    Could not load foreign source for module located at cryptol-ffi-tests/shatest_8.cry:
        user error (dlopen: dlopen(cryptol-ffi-tests/shatest_8.dylib, 0x0002): tried: 'cryptol-ffi-tests/shatest_8.dylib' (no such file))
        user error (dlopen: dlopen(cryptol-ffi-tests/shatest_8.so, 0x0002): tried: 'cryptol-ffi-tests/shatest_8.so' (no such file))
@yav
Copy link
Member

yav commented Oct 11, 2022

FFI and parameterized do not work with the old module system. They do work with the new one, but we reject foreign declarations in functors, see comments on #1449

@yav yav added maybe-fixed Might be resolved, but this needs to be confirmed. parameterized modules Related to Cryptol's parameterized modules labels Oct 11, 2022
@yav yav closed this as completed Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maybe-fixed Might be resolved, but this needs to be confirmed. parameterized modules Related to Cryptol's parameterized modules
Projects
None yet
Development

No branches or pull requests

2 participants