Nakilon / dhash-vips

vips-powered ruby gem to measure images similarity, implementing dHash and IDHash algorithms
MIT License
88 stars 14 forks source link

Add Rails Caveats Around Spring #10

Open cguess opened 3 years ago

cguess commented 3 years ago

I think it would be a good idea to add instructions for Rails users (just to be nice), which involves removing Spring as referenced here by @jcupitt.

I can do submit a PR for this, but just wanted to make sure everyone is cool with it?

Nakilon commented 3 years ago

I think it's more like a ruby-vips problem. There are many other gems that depend on it.

jcupitt commented 3 years ago

Yes, I could well be wrong, it was just a guess. You'd need to test disabling spring, and perhaps ask a spring or senior rails dev for their opinion.

AvtiveStorage itself uses ruby-vips for image handling, so I'd expect this to be a fairly well-known issue.

cguess commented 3 years ago

@jcupitt Disabling spring does, in fact, fix this issue. It may be a ruby-vips issue but from my perspective it seems like a good idea to at least note it in the set up.

jcupitt commented 3 years ago

Ah, sorry, I hadn't realized. I agree, it's worth noting then.

I wonder how activestorage dodges this issue? I suppose it must delay init until requests come in.

cguess commented 3 years ago

I'll ask over in the rails forums and update here when I hear more, because, yes, this seems like an interesting problem.

In the mean time expect a PR to the docs for this.

jcupitt commented 3 years ago

Hello all, I think Kleis might have found the problem (or part of it) -- macOS is missing sched_getattr and this forces glib to start threads sooner.

https://github.com/libvips/php-vips-ext/issues/42#issuecomment-879817757

I've pushed a change to the head of 8.11 to delay thread startup a bit longer, and this might fix this. Would anyone be able to test?