Coder Social home page Coder Social logo

Comments (8)

mattgreen avatar mattgreen commented on July 18, 2024

Post your Rakefile. I'm curious how you're calling SMLoginItemSetEnabled; I'm worried that motion.h is conflicting.

from motion-sqlite3.

JonasNielsen avatar JonasNielsen commented on July 18, 2024

I tried including only motion.h without the gem but couldn't trigger the conflict. Can't tell what parts of motion-sqlite3 is causing the issue.

Here's a simple example project that demonstrates the issue: https://github.com/JonasNielsen/service-management-motion-sqlite3-conflict

Rakefile, Gemfile and app_delegate.rb

from motion-sqlite3.

mattgreen avatar mattgreen commented on July 18, 2024

I love these weird bugs. This looks like a build system deficiency that's being exposed.

I think the problem is the app.include line in motion-sqlite3 (https://github.com/mattgreen/motion-sqlite3/blob/master/lib/motion-sqlite3.rb). When it runs, motion.h updates the BridgeSupport file list with a generated BridgeSupport file. However, the XcodeConfig object (https://github.com/HipByte/RubyMotion/blob/60cc0bf979c62d5b2e279eb26c9536ed16053dd5/lib/motion/project/xcode_config.rb) seems to only expect it's methods to be called after all frameworks have been declared. This makes it tough to use these methods from gems, since Bundler ensures that they get the first shot at RM config objects.

In other words, it's like ServiceManagement.framework never gets linked in because app.frameworks was updated after motion-sqlite3's use of app.include.

You can demonstrate this by updating the bug repo to muck with the Config object directly:
app.instance_variable_get(:@bridgesupport_files) << "/Library/RubyMotion/data/osx/10.9/BridgeSupport/ServiceManagement.bridgesupport"
app.instance_variable_set(:@frameworks_dependencies, nil)

This is a suitable short term hack, but it's horrible. The real fix is probably to incorporate motion.h's functionality directly into RubyMotion to avoid these sorts of issues.

Thoughts, @kastiglione and @lrz?

from motion-sqlite3.

JonasNielsen avatar JonasNielsen commented on July 18, 2024

Yikes, that's hairy. Thanks for the help Matt, I really appreciate it. Your suggested workaround works well.

from motion-sqlite3.

vespakoen avatar vespakoen commented on July 18, 2024

Hey guys,

Just a heads up that this also breaks 'CoreLocation', I got this error:

2014-05-28 00:26:07.496 abc[65287:70b] app_delegate.rb:4:in `application:didFinishLaunchingWithOptions:': undefined method `CLLocationCoordinate2DMake' for #<AppDelegate:0x9dbcb30> (NoMethodError)

Just spend a couple of hours debugging this, the trick was using rake clean:all before recompiling with a different set of gems, until I narrowed it down to motion-sqlite3.

I guess I will wait for a fix or try another sqlite project for now.

Thanks for the project, it is really nice to use, but this bug is a very hard one to debug, so I think a fix or a warning or something is in place.

from motion-sqlite3.

kastiglione avatar kastiglione commented on July 18, 2024

I don't know when I'll actually get to it, but I'll create an issue on the motion.h repo to find out how it is breaking. It's doubtful I'll get to it before the second week of June.

from motion-sqlite3.

mattgreen avatar mattgreen commented on July 18, 2024

I'm thinking it's better to not use motion.h for now.

I'll see if I can talk to Laurent or Eloy about getting RM to generate BridgeSupport files for SQLite.

from motion-sqlite3.

mattgreen avatar mattgreen commented on July 18, 2024

Originally, I made motion-sqlite3 to see how viable RM's C FFI is. Answer: very. However, the BridgeSupport issue is enough for me to tank the idea. I think I'll move to exposing the SQLite API in a very low-level way via Obj-C, and then use that from Ruby.

from motion-sqlite3.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.