Closed aljelly closed 4 years ago
I updated to the latest version and I'm still getting the same error when trying to require Granite...
Just
require "gobject"
require_gobject "Granite"
?
IME sometimes shards
gets stuck, so if you included this as a dependency into your project a rm -rf lib && shards
might help after verifying the lock has the latest revision.
$ crystal init app granitetest
create granitetest/.gitignore
create granitetest/.editorconfig
create granitetest/LICENSE
create granitetest/README.md
create granitetest/.travis.yml
create granitetest/shard.yml
create granitetest/src/granitetest.cr
create granitetest/spec/spec_helper.cr
create granitetest/spec/granitetest_spec.cr
Initialised empty Git repository in .../granitetest/.git/
$ cd granitetest
$ nano shard.yml
$ shards update
Fetching https://github.com/jhass/crystal-gobject.git
Installing gobject (0.2.0 at master)
$ nano src/granitetest.cr
$ cat src/granitetest.cr
require "gobject"
require_gobject "Granite"
$ shards build
Dependencies are satisfied
Building: granitetest
Error target granitetest failed to compile:
syntax error in /usr/lib/x86_64-linux-gnu/girepository-1.0/Granite-1.0.typelib/ServicesLogger:12
Error: unexpected token: NEWLINE
Doesn't reproduce for me :/
Can you run crystal lib/gobject/src/generator/build_namespace.cr -- Granite > granite.cr
and gist the resulting file?
Super weird... can you show the shard.lock
please?
Never mind, I fixed it. It was a silly little mistake. I forgot to install libgranite-dev
. I assumed for some reason I had already installed it previously along with the other *-dev
packages necessary.
I discovered it just now while trying to find system information to give you to help narrow it down, and I thought I'd give you the version of libgranite-dev
that apt
reported was installed... and then I found it wasn't installed.
It's building now. Thank you!
Ok, glad it works for you! Weird that would just generate wrongly with it though, I would expect it to completely fail to generate (lack of gir file).
If you manage to get past #37 and try to build something with
require_gobject("Granite")
included, it fails:I don't know if this is due to my hacking around the array constant however.