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

Doesn't work currently? #1

Closed
phortx opened this issue Jul 23, 2017 · 3 comments
Closed

Doesn't work currently? #1

phortx opened this issue Jul 23, 2017 · 3 comments

Comments

@phortx
Copy link

phortx commented Jul 23, 2017

I've added crinja to my shard.yml, ran crystal deps and tried to build the app with a require "crinja", but it just produced errors like:

in lib/crinja/src/crinja/runtime/py_tuple.cr:1: while requiring "../value": can't find file '../value' relative to '/home/phortx/workspaces/benny/tesseract/lib/crinja/src/crinja/runtime'

require "../value"

and

in lib/crinja/src/crinja/lib/function/cycler.cr:9: undefined method 'getattr'

  getattr :next, :rewind, :reset, :current
  ^~~~~~~
@straight-shoota
Copy link
Owner

Hey @phortx,
Crinja should be mostly operational as is proven by passing the quite extensive test suite.

The first error is indeed a mistake in Crinja, though I am not sure why the compiler did not complain about this, neither on my PC nor the test suite on travis-ci. It looks like a compiler bug, so I've opened issue crystal-lang/crystal#4742 to track this. The Crinja code should be fixed now.

What version of Crystal are you using (shell crystal --version)? Crinja depends on the current release Crystal 0.23.1 (or newer). The second error might be related to an issue in previous versions of Crystal.

@phortx
Copy link
Author

phortx commented Jul 24, 2017

Wow, thanks for the fast response and the fix!

My crystal version is Crystal 0.23.0 (2017-07-13) LLVM 4.0.1, so I'll wait for 0.23.1 to be in the Manjaro Repos and will try again.

@straight-shoota
Copy link
Owner

All right, then it's the macro lookup bug in 0.23.0 (crystal-lang/crystal#4639.
It should be working under 0.23.0 if the class-scope calls to getattr are explicitly prefixed as PyObject.getattr. Though I don't plan to provide a patch with this because 0.23.1 is already out as a bugfix release to address this issue.

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

2 participants