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

Error Building on OSX #1

Open
madranet opened this issue Jan 1, 2019 · 8 comments
Open

Error Building on OSX #1

madranet opened this issue Jan 1, 2019 · 8 comments
Labels

Comments

@madranet
Copy link

madranet commented Jan 1, 2019

OSX version: 10,11,16
Crystal version:

Crystal 0.27.0 (2018-11-01)
LLVM: 3.9.1
Default target: x86_64-apple-macosx

when I download the repo and run shards install && shards build I get the following build error output:

★ Dalek ★  madranet-tester : master ✔ : ᐅ  shards install && shards build
Fetching https://github.com/straight-shoota/sass.cr.git
Fetching https://github.com/straight-shoota/crinja.git
Fetching https://github.com/icyleaf/markd.git
Using sass (0.4.0)
Using crinja (0.4.0)
Using markd (0.1.1)
Dependencies are satisfied
Building: criss
Error target criss failed to compile:
Error in /Users/madra/claraithe/crystal/CurrentVersion/src/kernel.cr:1: expanding macro

{% if flag?(:win32) %}
^

in macro 'macro_4594549296' /Users/madra/claraithe/crystal/CurrentVersion/src/kernel.cr:1, line 12:

   1.
   2.   require "c/unistd"
   3.
   4.   # The standard input file descriptor. Contains data piped to the program.
   5.   STDIN  = IO::FileDescriptor.from_stdio(0)
   6.
   7.   # The standard output file descriptor.
   8.   #
   9.   # Typically used to output data and information.
  10.   #
  11.   # NOTE: Gets flushed when a newline is written.
> 12.   STDOUT = IO::FileDescriptor.from_stdio(1).tap { |f| f.flush_on_newline = true }
  13.
  14.   # The standard error file descriptor.
  15.   #
  16.   # Typically used to output error messages and diagnostics.
  17.   #
  18.   # NOTE: Gets flushed when a newline is written.
  19.   STDERR = IO::FileDescriptor.from_stdio(2).tap { |f| f.flush_on_newline = true }

instantiating 'IO::FileDescriptor.class#from_stdio(Int32)'
in /Users/madra/claraithe/crystal/CurrentVersion/src/fiber.cr:155: instantiating 'Exception+#inspect_with_backtrace(IO::FileDescriptor)'

    ex.inspect_with_backtrace(STDERR)
       ^~~~~~~~~~~~~~~~~~~~~~

in /Users/madra/claraithe/crystal/CurrentVersion/src/exception.cr:57: instantiating 'message()'

    io << message << " (" << self.class << ")\n"
          ^~~~~~~

in lib/crinja/src/crinja/runtime/context.cr:222: instantiating 'super()'

      "Tag cycle exception #{@type}. #{super}"
                                       ^~~~~

in lib/crinja/src/crinja/error.cr:5: instantiating 'String.class#build()'

    String.build do |io|
           ^~~~~

in /Users/madra/claraithe/crystal/CurrentVersion/src/string.cr:268: instantiating 'String::Builder.class#build(Int32)'

    String::Builder.build(capacity) do |builder|
                    ^~~~~

in /Users/madra/claraithe/crystal/CurrentVersion/src/string.cr:268: instantiating 'String::Builder.class#build(Int32)'

    String::Builder.build(capacity) do |builder|
                    ^~~~~

in lib/crinja/src/crinja/error.cr:5: instantiating 'String.class#build()'

    String.build do |io|
           ^~~~~

in lib/crinja/src/crinja/error.cr:17: instantiating 'Exception+#message()'

        io << c.message
                ^~~~~~~

in lib/crinja/src/crinja/runtime/callable.cr:234: instantiating 'String::Builder#<<((Crinja::Callable | Crinja::Operator | Proc(Crinja::Callable::Arguments, Crinja::Type) | Nil))'

        "#{super} (called: #{callee}#{arg})"
        ^

in /Users/madra/claraithe/crystal/CurrentVersion/src/io.cr:184: instantiating '(Crinja::Callable | Crinja::Operator | Proc(Crinja::Callable::Arguments, Crinja::Type) | Nil)#to_s(String::Builder)'

    obj.to_s self
        ^~~~

in lib/crinja/src/crinja/runtime/callable.cr:127: instantiating 'Hash(String, Crinja::Type)#each_with_index()'

        me.defaults.each_with_index do |(key, value), i|
                    ^~~~~~~~~~~~~~~

in /Users/madra/claraithe/crystal/CurrentVersion/src/enumerable.cr:377: instantiating 'each()'

    each do |elem|
    ^~~~

in /Users/madra/claraithe/crystal/CurrentVersion/src/enumerable.cr:377: instantiating 'each()'

    each do |elem|
    ^~~~

in lib/crinja/src/crinja/runtime/callable.cr:127: instantiating 'Hash(String, Crinja::Type)#each_with_index()'

        me.defaults.each_with_index do |(key, value), i|
                    ^~~~~~~~~~~~~~~

in lib/crinja/src/crinja/runtime/callable.cr:130: instantiating 'Crinja::Finalizer.class#stringify(Crinja::Type)'

          io << "=" << Finalizer.stringify(value, in_struct: true) unless value.is_a?(Undefined)
                                 ^~~~~~~~~

in lib/crinja/src/crinja/runtime/finalizer.cr:5: instantiating 'stringify((Array(Crinja::Type) | Bool | Crinja::Callable | Crinja::PyObject | Crinja::SafeString | Crinja::Undefined | Float64 | Hash(Crinja::Type, Crinja::Type) | Int32 | Int64 | Iterator(Crinja::Type) | Proc(Crinja::Callable::Arguments, Crinja::Type) | String | Time | Nil), Bool, Bool)'

  def self.stringify(raw, escape = false, in_struct = false)
  ^

in lib/crinja/src/crinja/runtime/finalizer.cr:7: instantiating 'Crinja::Finalizer#stringify((Array(Crinja::Type) | Bool | Crinja::Callable | Crinja::PyObject | Crinja::SafeString | Crinja::Undefined | Float64 | Hash(Crinja::Type, Crinja::Type) | Int32 | Int64 | Iterator(Crinja::Type) | Proc(Crinja::Callable::Arguments, Crinja::Type) | String | Time | Nil))'

    builder.stringify(raw)
            ^~~~~~~~~

in lib/crinja/src/crinja/runtime/finalizer.cr:50: instantiating 'Array(Crinja::Type)#join(String, IO::Memory)'

    array.join(", ", @io) { |item| stringify(item) }
          ^~~~

in /Users/madra/claraithe/crystal/CurrentVersion/src/enumerable.cr:668: instantiating 'each_with_index()'

    each_with_index do |elem, i|
    ^~~~~~~~~~~~~~~

in /Users/madra/claraithe/crystal/CurrentVersion/src/enumerable.cr:377: instantiating 'each()'

    each do |elem|
    ^~~~

in /Users/madra/claraithe/crystal/CurrentVersion/src/indexable.cr:187: instantiating 'each_index()'

    each_index do |i|
    ^~~~~~~~~~

in /Users/madra/claraithe/crystal/CurrentVersion/src/indexable.cr:187: instantiating 'each_index()'

    each_index do |i|
    ^~~~~~~~~~

in /Users/madra/claraithe/crystal/CurrentVersion/src/enumerable.cr:377: instantiating 'each()'

    each do |elem|
    ^~~~

in /Users/madra/claraithe/crystal/CurrentVersion/src/enumerable.cr:668: instantiating 'each_with_index()'

    each_with_index do |elem, i|
    ^~~~~~~~~~~~~~~

in lib/crinja/src/crinja/runtime/finalizer.cr:50: instantiating 'Array(Crinja::Type)#join(String, IO::Memory)'

    array.join(", ", @io) { |item| stringify(item) }
          ^~~~

in lib/crinja/src/crinja/runtime/finalizer.cr:50: instantiating 'stringify(Crinja::Type)'

    array.join(", ", @io) { |item| stringify(item) }
                                   ^~~~~~~~~

in lib/crinja/src/crinja/runtime/finalizer.cr:59: instantiating 'Hash(Crinja::Type, Crinja::Type)#each()'

    hash.each do |key, value|
         ^~~~

in lib/crinja/src/crinja/runtime/finalizer.cr:59: instantiating 'Hash(Crinja::Type, Crinja::Type)#each()'

    hash.each do |key, value|
         ^~~~

in lib/crinja/src/crinja/runtime/finalizer.cr:61: instantiating 'stringify(Crinja::Type)'

      stringify(key)
      ^~~~~~~~~

in lib/crinja/src/crinja/runtime/finalizer.cr:73: instantiating 'Crinja::PyTuple#join(String, IO::Memory)'

    array.join(", ", @io) { |item| stringify(item) }
          ^~~~

in /Users/madra/claraithe/crystal/CurrentVersion/src/enumerable.cr:668: instantiating 'each_with_index()'

    each_with_index do |elem, i|
    ^~~~~~~~~~~~~~~

in /Users/madra/claraithe/crystal/CurrentVersion/src/enumerable.cr:377: instantiating 'each()'

    each do |elem|
    ^~~~

in /Users/madra/claraithe/crystal/CurrentVersion/src/indexable.cr:187: instantiating 'each_index()'

    each_index do |i|
    ^~~~~~~~~~

in /Users/madra/claraithe/crystal/CurrentVersion/src/indexable.cr:187: instantiating 'each_index()'

    each_index do |i|
    ^~~~~~~~~~

in /Users/madra/claraithe/crystal/CurrentVersion/src/indexable.cr:188: abstract `def Indexable(T)#unsafe_fetch(index : Int)` must be implemented by Crinja::PyTuple

      yield unsafe_fetch(i)
            ^~~~~~~~~~~~

Any ideas how to fix that?

BTW: Just in case it's relevant. My Crystal installation is via downloaded tarball in ~ with the Crystal and Shards binaries sym-linked into /usr/local/bin, as I'm using an older version of OSX in which the Homebrew installation method is broken.

@straight-shoota
Copy link
Owner

That's just an incompatibility of crinja 0.4.0 with Crystal 0.27.0. I think this should be fixed in master, but I'll also need to cut a new release.

The codebase of Criss is also pretty outdated. I have it completely reworked locally. If you're interested in this shard, I can see if I can put the current version online. It's still all under development though and I can't guarantee a stable API.

@straight-shoota
Copy link
Owner

I just tagged Crinja 0.4.1. If you run shards update it should fetch the latest release.

@madranet
Copy link
Author

madranet commented Jan 1, 2019

The codebase of Criss is also pretty outdated. I have it completely reworked locally. If you're interested in this shard, I can see if I can put the current version online...

Thanks for that. I'm just dipping a toe in the water with Crystal at the moment and there aren't that many static site generators available, to have a poke around at. So anything you could upload to "show me how it's done" would be really useful.

I just tagged Crinja 0.4.1. If you run shards update it should fetch the latest release.

Well, that got me a bit forr'arder. Still getting an error message but it's a lot shorter now:

★ Dalek ★  madranet-tester : master ✔ : ᐅ  shards update
Fetching https://github.com/straight-shoota/sass.cr.git
Fetching https://github.com/straight-shoota/crinja.git
Fetching https://github.com/icyleaf/markd.git
Installing sass (0.4.0)
Installing crinja (0.4.1)
Installing markd (0.1.1)
★ Dalek ★  madranet-tester : master ✘ :✹ ᐅ  shards install && shards build
Fetching https://github.com/straight-shoota/sass.cr.git
Fetching https://github.com/straight-shoota/crinja.git
Fetching https://github.com/icyleaf/markd.git
Using sass (0.4.0)
Using crinja (0.4.1)
Using markd (0.1.1)
Dependencies are satisfied
Building: criss
Error target criss failed to compile:
Error in src/criss_cli.cr:1: while requiring "./criss"

require "./criss"
^

in src/criss.cr:1: while requiring "./criss/context"

require "./criss/context"
^

in src/criss/context.cr:4: undefined constant Crinja::PyObject (did you mean 'Crinja::Object')

  include Crinja::PyObject
          ^~~~~~~~~~~~~~~~

@straight-shoota
Copy link
Owner

Oh yeah, that's not gonna work. The old criss code is not compatible to the latest crinja :D You'll have to wait for the updated code or try to find some older Crystal version that works with old criss and crinja. That's probably not the best idea, though.

@straight-shoota
Copy link
Owner

I've pushed the current development status to master branch. The old is still available in first-trial.

Some specs will probably fail because the test data is not available. I'll have to provide that, too. But it should be good enough to take a look and see how it works.

@madranet
Copy link
Author

madranet commented Jan 1, 2019

That worked. Well Criss built and ran. I haven't started kicking the tyres yet.

Thanks for your help.

@madranet
Copy link
Author

madranet commented Jan 1, 2019

Any chance you could upload an example _config.yml file? As, without documentation, I don't know what I should be putting in it and, if I leave it empty I get a Unhandled exception: did not find expected <document start>... error, referencing the config file.

@madranet madranet reopened this Jan 1, 2019
@straight-shoota
Copy link
Owner

It's essentially the same format as Jekyll's _config.yml. Not everything is supported right now. The mapping is in Criss::Config.

An empty config file should obviously work. I suppose it doesn't error when you put any yaml mapping in it (for example foo: bar, or you could just choose a real option).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants