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

Yanked mimemagic 0.3.5 leaves us with no buildable version of rails 6.0 #23

Closed
alexmreis opened this issue Mar 24, 2021 · 30 comments
Closed

Comments

@alexmreis
Copy link

mimemagic 0.3.5 has been yanked from rubygems, marcel needs to be upgraded to use 0.4.0 and released ASAP.

Rails applications depending on activestorage -> marcel are unable to be built currently..

Bundler could not find compatible versions for gem "mimemagic":
  In Gemfile:
    mimemagic (~> 0.4.0)

    rails (~> 6.0.3, >= 6.0.3.4) was resolved to 6.0.3.4, which depends on
      activestorage (= 6.0.3.4) was resolved to 6.0.3.4, which depends on
        marcel (~> 0.3.1) was resolved to 0.3.3, which depends on
          mimemagic (~> 0.3.2)
@907th
Copy link

907th commented Mar 24, 2021

Old Rails versions are affected too:

Bundler could not find compatible versions for gem "mimemagic":
  In Gemfile:
    mimemagic (~> 0.4.0)

    rails (~> 5.2) was resolved to 5.2.1.rc1, which depends on
      activestorage (= 5.2.1.rc1) was resolved to 5.2.1.rc1, which depends on
        marcel (~> 0.3.1) was resolved to 0.3.3, which depends on
          mimemagic (~> 0.3.2)

@907th
Copy link

907th commented Mar 24, 2021

mimemagic 0.3.6 has been released several minutes ago which solves the issue

@alexmreis
Copy link
Author

Tried upgrading marcel to use mimemagic 0.4.0, but there's breaking changes (yay for non-semantic versioning)

File does not exist: mimemagic/overlay

@mrahul17
Copy link

thanks @907th , couldn't see it on the releases page. but this exits as a separate branch

@907th
Copy link

907th commented Mar 24, 2021

@light94 It is available on rubygems.org

@vizjerai-vineti
Copy link

Gem was yanked due to license change from MIT to GPL-2.0

mimemagicrb/mimemagic#97

@bdewater
Copy link

@alexmreis

Tried upgrading marcel to use mimemagic 0.4.0, but there's breaking changes (yay for non-semantic versioning)

It's a 0.y.z version and that means according to SemVer the API is not considered stable: https://semver.org/#spec-item-4

@coding-bunny
Copy link

just leaving a note to track this, as this affects the PR I have open for the Rails project.
Marcel is a dependency, and GPL is not really an option, so interested to see how this will be resolved.

@beauraF
Copy link

beauraF commented Mar 24, 2021

#24

@coding-bunny
Copy link

Just offering this as a potential alternative : rails/rails#41751
Not depend on the gem anymore and replace with something else?
I know someone is rebuilding the mimemagic gem, but it might also not work out.

@jrochkind
Copy link

Note that mimemagic 0.3.6 is GPL licensed though. So while it might build, it might not be legal to use it in a non-GPL-licenesed project.

The yankings are actually around this license error/dispute.

@jellybob
Copy link

I'm working with the maintainer to get jellybob/mimemagic#3 (further discussion at jellybob/mimemagic#1) merged and shipped as 0.3.7, which resolves the GPL violations in MimeMagic at the expense of a slightly more involved install process.

@stanhu
Copy link

stanhu commented Mar 25, 2021

For those of you looking for an alternative and are okay with compiling a C extension, I took the fine work in https://github.com/kwilczynski/ruby-magic and bundled libmagic via https://gitlab.com/gitlab-org/ruby-magic/-/merge_requests/1.

You can find this gem under ruby-magic-static: https://rubygems.org/gems/ruby-magic-static. No longer needed.

I've commented in the upstream gem about making this the behavior of ruby-magic: kwilczynski/ruby-magic#1

UPDATE: ruby-magic now vendors libmagic.

@adam-ludgate
Copy link

mimemagic 0.3.6 has been released several minutes ago which solves the issue

I don't think it solves the issue, marcel will not accept 0.3.6 as a dependancy, error from a Rails project:
Downloading marcel-0.3.3 revealed dependencies not in the API or the lockfile

@jellybob
Copy link

0.3.6 has been also been yanked as it was also in breach of the GPL. 0.3.7 is legitimately MIT licensed and should work for you.

@rjadrian1
Copy link

0.3.6 has been also been yanked as it was also in breach of the GPL. 0.3.7 is legitimately MIT licensed and should work for you.

#11 26.18 Could not find MIME type database in the following locations:
#11 26.18 ["/usr/local/share/mime/packages/freedesktop.org.xml",
#11 26.18 "/opt/homebrew/share/mime/packages/freedesktop.org.xml",
#11 26.18 "/usr/share/mime/packages/freedesktop.org.xml"]
#11 26.18
#11 26.18 Ensure you have either installed the shared-mime-types package for your
#11 26.18 distribution, or
#11 26.18 obtain a version of freedesktop.org.xml and set FREEDESKTOP_MIME_TYPES_PATH to
#11 26.18 the location
#11 26.18 of that file.

@fabioperrella
Copy link

For those who don't need activestorage, it's also possible to remove this dependency with something like this https://gist.github.com/mensfeld/3437de2fae7fc58faccbf28c2e825443

@jellybob
Copy link

@rjadrian1 please see the MimeMagic readme at https://github.com/mimemagicrb/mimemagic/blob/master/README.md for details on how to make sure you have a copy of the file available.

@adam-ludgate
Copy link

Moving to mimemagic 0.3.7 does not resolve the dependency issues

Downloading marcel-0.3.3 revealed dependencies not in the API or the lockfile
(mimemagic (~> 0.3.2)).

This error makes sense per https://rubygems.org/gems/marcel/versions/0.3.3
Anyone have a workaround for this, or do we wait for a patch to the marcel gem?

@chechsp
Copy link

chechsp commented Mar 25, 2021

Moving to mimemagic 0.3.7 does not resolve the dependency issues

Downloading marcel-0.3.3 revealed dependencies not in the API or the lockfile
(mimemagic (~> 0.3.2)).

This error makes sense per https://rubygems.org/gems/marcel/versions/0.3.3
Anyone have a workaround for this, or do we wait for a patch to the marcel gem?

Waiting for a fix here, marcel is needed for many Rails 5.2 projects too. Monkeypatched a solution extracting mimemagic code from RVM meanwhile.

@eraffel-MDSol
Copy link

eraffel-MDSol commented Mar 25, 2021

I don't understand the issue and I'm having it as well. Shouldn't ~> 0.3.2 allow 0.3.7?

Update: I was able to get it working with bundle update mimemagic nokogiri

My issue was made irrelevant by 0.3.8

@dkoriakin
Copy link

0.3.6 has been also been yanked as it was also in breach of the GPL. 0.3.7 is legitimately MIT licensed and should work for you.

#11 26.18 Could not find MIME type database in the following locations:
#11 26.18 ["/usr/local/share/mime/packages/freedesktop.org.xml",
#11 26.18 "/opt/homebrew/share/mime/packages/freedesktop.org.xml",
#11 26.18 "/usr/share/mime/packages/freedesktop.org.xml"]
#11 26.18
#11 26.18 Ensure you have either installed the shared-mime-types package for your
#11 26.18 distribution, or
#11 26.18 obtain a version of freedesktop.org.xml and set FREEDESKTOP_MIME_TYPES_PATH to
#11 26.18 the location
#11 26.18 of that file.

please try to add "shared-mime-info" if you using alpine based docker image. " apk add shared-mime-info"

@alfonso-adriasola
Copy link

mimemagic 0.3.8 needs shared-mime-info package

@ShadSterling
Copy link

Everything I've seen about this seems to be linux-specific; on macOS macports and homebrew both have shared-mime-info and at least the brew package is compatible with updated mimemagic

@jellybob
Copy link

Sorry folks, its shared-mime-info on Linux as well, the error message just used the wrong name. The latest version resolves that.

@dnalbach
Copy link

dnalbach commented Mar 25, 2021

*** UPDATE ***
I see:
#25
It looks like the team is changing mime type gems and is removing mimemagic entirely, which is also fine. Thank you for your efforts on this. Is there any ETA on a potential release of the updated version?

@millerjs
Copy link

millerjs commented Mar 25, 2021

Re @ShadSterling's comment about OSX, if you're running an M1, compiling against x86 following a alias ibrew='arch -x86_64 /usr/local/homebrew/bin/brew' pattern, you might also need a export FREEDESKTOP_MIME_TYPES_PATH=/usr/local/homebrew/share/mime/packages/freedesktop.org.xml

@ddhung95
Copy link

0.3.6 has been also been yanked as it was also in breach of the GPL. 0.3.7 is legitimately MIT licensed and should work for you.

#11 26.18 Could not find MIME type database in the following locations:
#11 26.18 ["/usr/local/share/mime/packages/freedesktop.org.xml",
#11 26.18 "/opt/homebrew/share/mime/packages/freedesktop.org.xml",
#11 26.18 "/usr/share/mime/packages/freedesktop.org.xml"]
#11 26.18
#11 26.18 Ensure you have either installed the shared-mime-types package for your
#11 26.18 distribution, or
#11 26.18 obtain a version of freedesktop.org.xml and set FREEDESKTOP_MIME_TYPES_PATH to
#11 26.18 the location
#11 26.18 of that file.

please try to add "shared-mime-info" if you using alpine based docker image. " apk add shared-mime-info"

How can I resolve that error on windows?

@khacluan
Copy link

@ddhung95 create a file and set the export FREEDESKTOP_MIME_TYPES_PATH=<file_location> to that file could solved your issue

@georgeclaghorn
Copy link
Contributor

Marcel 1.0.0 has been released without the mimemagic dependency. Active Storage patches upgrading to the new version have also been released.

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