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

sass-embedded installs x86_64-linux-gnu version and then fails on another machine #70

Closed
d4rky-pl opened this issue Oct 6, 2022 · 18 comments

Comments

@d4rky-pl
Copy link

d4rky-pl commented Oct 6, 2022

I'm frankly not sure if this is a Bundler issue or what but it only happens with sass-embedded.

When I add the gem to the Gemfile in Docker locally and then run bundle, it installs x86_64-linux-gnu version. It then fails on the CI with

Your bundle is locked to sass-embedded (1.55.0-x86_64-linux) from rubygems
repository https://rubygems.org/ or installed locally, but that version can no
longer be found in that source. That means the author of sass-embedded
(1.55.0-x86_64-linux) has removed it. You'll need to update your bundle to a
version other than sass-embedded (1.55.0-x86_64-linux) that hasn't been removed
in order to install.

The Gemfile.lock includes both version without the platform pin and with:

    sass-embedded (1.55.0)
      google-protobuf (~> 3.19)
      rake (>= 10.0.0)
    sass-embedded (1.55.0-x86_64-linux-gnu)
      google-protobuf (~> 3.19)

Removing the platform pin manually works and bundle no longer adds it until I update any of the gems, in which case it's getting re-added and the problem resurfaces.

I tried looking for a solution everywhere, searched through Bundler and RubyGems issues and I can't figure this one out. Is this a problem with how the gem is released or am I doing something wrong?

@d4rky-pl
Copy link
Author

d4rky-pl commented Oct 6, 2022

I believe this is an upstream issue related to this rubygems/rubygems/issues/4269 . We have x86_64-linux platform specified in our lockfile due to issues with other gems otherwise.

@deivid-rodriguez
Copy link

Ugh, I think this may be a new upstream issue. Which Bundler & RubyGems version are you using?

@d4rky-pl
Copy link
Author

d4rky-pl commented Oct 6, 2022

@deivid-rodriguez definitely an upstream issue. I was able to confirm that this happens on bundler < 2.3.21 and is solved with bundler 2.3.21 and newer:

semaphore@semaphore-vm:~/h2$ bundle
Bundler 2.3.23 is running, but your lockfile was generated with 2.3.22. Installing Bundler 2.3.22 and restarting using that version.
Fetching gem metadata from https://rubygems.org/.
Fetching bundler 2.3.22
Installing bundler 2.3.22
Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://gems.contribsys.com/..
sass-embedded-1.55.0-x86_64-linux requires rubygems version >= 3.3.21, which is incompatible with the current version, 3.3.11

vs

semaphore@semaphore-vm:~/h2$ bundle
Bundler 2.3.23 is running, but your lockfile was generated with 2.3.21. Installing Bundler 2.3.21 and restarting using that version.
Fetching gem metadata from https://rubygems.org/.
Fetching bundler 2.3.21
Installing bundler 2.3.21
Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://gems.contribsys.com/..
Your bundle is locked to sass-embedded (1.55.0-x86_64-linux) from rubygems repository https://rubygems.org/ or installed locally, but that version can no longer be found in that source. That means the
author of sass-embedded (1.55.0-x86_64-linux) has removed it. You'll need to update your bundle to a version other than sass-embedded (1.55.0-x86_64-linux) that hasn't been removed in order to install.

Seems that upgrading rubygems also solves the issue. I guess a note in README of the required rubygems version could be enough as older version mixed with older Bundler makes the error message unnecessarily hard to figure out.

@deivid-rodriguez
Copy link

Oh, that's great to hear! Given the coincidence in time I thought it was actually the other way around and that yesterday's releases (RubyGems 3.3.23 and Bundler 2.3.23) broke something.

@ntkme
Copy link
Member

ntkme commented Oct 6, 2022

The linux-gnu gem has required_rubygems_version = '>= 3.3.21' because it need this change: rubygems/rubygems#5852:
https://github.com/ntkme/sass-embedded-host-ruby/blob/e6d59f1fa3375ec0c7997b1bfad4786fea85dc2f/sass-embedded.gemspec#L25

@ntkme
Copy link
Member

ntkme commented Oct 6, 2022

Given the different output of Bundler 2.3.22 and Bundler 2.3.21, I think this PR might be the reason that 2.3.22 was able to report the correct error message but 2.3.21 was not behaving correctly: rubygems/rubygems#5875

@ntkme
Copy link
Member

ntkme commented Oct 6, 2022

The native gem will have required_rubygems_version = '>= 3.3.22' in the next release: bc9e4a3.

@ntkme
Copy link
Member

ntkme commented Oct 7, 2022

Only with the combination of rubygems < 3.3.21 and a Gemfile.lock generated by bundler <= 2.3.21, I was able to reproduce this error message locked to sass-embedded (1.55.0-x86_64-linux).

There isn't much I can do here. If you have different mixes of rubygems/bundler versions you need to support, you may want to lock it to the --platform=ruby version rather than the linux-gnu version to completely avoid this issue.

@ntkme ntkme closed this as not planned Won't fix, can't repro, duplicate, stale Oct 7, 2022
@d4rky-pl
Copy link
Author

d4rky-pl commented Oct 7, 2022

@ntkme unfortunately that won't work as we have other gems we need to set the platform for. I'm assuming it wouldn't be possible to release a just linux version without the GNU part?

@d4rky-pl
Copy link
Author

d4rky-pl commented Oct 7, 2022

I have downgraded the gem to version 1.6.2 until it (one way or another) becomes usable on Heroku again

@ntkme
Copy link
Member

ntkme commented Oct 7, 2022

A plain linux version will allow installation on linux-musl and it will break at runtime in a very strange way due to dart-lang being compiled against glibc, and that’s why it is gnu only.

Assuming you are checking in the Gemfile.lock, you can manually edit the file to lock it to the platform ruby version just for this dependency.

In my very limited test, I found that:

  • bundler 2.3.21 has issue when rubygems < 3.3.21 that it incorrectly parse linux-gnu as linux.
  • bundler 2.3.22 worked with rubygems < 3.3.21. I cannot reproduce the requires rubygems version >= 3.3.21 error message when running bundler 2.3.22 on rubygems 3.3.7. For me it just installed the platform-ruby gem as fallback.

What’s the gem --version you have?

@d4rky-pl
Copy link
Author

d4rky-pl commented Oct 7, 2022

My gem --version doesn't matter since we're deploying on Heroku which forces the Bundler and RubyGems version to the older ones that still have this problem (3.2.33 for Ruby 3.0, 3.3.7 for Ruby 3.1). I have already tested that an app with this Gemfile:

source 'https://rubygems.org'
gem 'sass-embedded', '~> 1.55'

and this Gemfile.lock

GEM
  remote: https://rubygems.org/
  specs:
    google-protobuf (3.21.7)
    google-protobuf (3.21.7-x86_64-linux)
    rake (13.0.6)
    sass-embedded (1.55.0)
      google-protobuf (~> 3.19)
      rake (>= 10.0.0)
    sass-embedded (1.55.0-x86_64-linux-gnu)
      google-protobuf (~> 3.19)

PLATFORMS
  ruby
  x86_64-linux

DEPENDENCIES
  sass-embedded (~> 1.55)

BUNDLED WITH
   2.3.23

will fail to deploy on Heroku. So basically if you ran bundle lock --add-platform x86_64-linux to solve this rubygems bug then this gem can no longer be used.

Assuming you are checking in the Gemfile.lock, you can manually edit the file to lock it to the platform ruby version just for this dependency.

The problem with this approach is that Bundler will happily reapply this the moment it has to regenerate the lockfile. You can check with the Gemfile I've given that if you add any other gem (for ex. bacon since it has no extra dependencies) it will re-add the sass-embedded (1.55.0-x86_64-linux-gnu) part on both bundle and bundle update bacon.

@ntkme
Copy link
Member

ntkme commented Oct 7, 2022

(ruby)root@e6082f4208e1:/home/linuxbrew/gemfile-test# ./test.sh 
+ gem --version
3.3.7
+ ls -d bundler-2.3.21-platform-linux bundler-2.3.21-platform-linux-ruby bundler-2.3.22-platform-linux bundler-2.3.22-platform-linux-ruby bundler-2.3.23-platform-linux bundler-2.3.23-platform-linux-ruby
+ cd bundler-2.3.21-platform-linux
+ cat Gemfile.lock
GEM
  remote: https://rubygems.org/
  specs:
    google-protobuf (3.21.7-x86_64-linux)
    sass-embedded (1.55.0-x86_64-linux-gnu)
      google-protobuf (~> 3.19)

PLATFORMS
  x86_64-linux

DEPENDENCIES
  sass-embedded

BUNDLED WITH
   2.3.21
+ bundle
Bundler 2.3.7 is running, but your lockfile was generated with 2.3.21. Installing Bundler 2.3.21 and restarting using that version.
Fetching gem metadata from https://rubygems.org/.
Fetching bundler 2.3.21
Installing bundler 2.3.21
Fetching gem metadata from https://rubygems.org/..
Your bundle is locked to sass-embedded (1.55.0-x86_64-linux) from rubygems repository https://rubygems.org/ or installed locally, but that version can no longer be found in that
source. That means the author of sass-embedded (1.55.0-x86_64-linux) has removed it. You'll need to update your bundle to a version other than sass-embedded (1.55.0-x86_64-linux)
that hasn't been removed in order to install.
+ cd ..
+ cd bundler-2.3.21-platform-linux-ruby
+ cat Gemfile.lock
GEM
  remote: https://rubygems.org/
  specs:
    google-protobuf (3.21.7)
    google-protobuf (3.21.7-x86_64-linux)
    rake (13.0.6)
    sass-embedded (1.55.0)
      google-protobuf (~> 3.19)
      rake (>= 10.0.0)
    sass-embedded (1.55.0-x86_64-linux-gnu)
      google-protobuf (~> 3.19)

PLATFORMS
  ruby
  x86_64-linux

DEPENDENCIES
  sass-embedded

BUNDLED WITH
   2.3.21
+ bundle
Fetching gem metadata from https://rubygems.org/.
Your bundle is locked to sass-embedded (1.55.0-x86_64-linux) from rubygems repository https://rubygems.org/ or installed locally, but that version can no longer be found in that
source. That means the author of sass-embedded (1.55.0-x86_64-linux) has removed it. You'll need to update your bundle to a version other than sass-embedded (1.55.0-x86_64-linux)
that hasn't been removed in order to install.
+ cd ..
+ cd bundler-2.3.22-platform-linux
+ cat Gemfile.lock
GEM
  remote: https://rubygems.org/
  specs:
    google-protobuf (3.21.7-x86_64-linux)
    sass-embedded (1.55.0-x86_64-linux-gnu)
      google-protobuf (~> 3.19)

PLATFORMS
  x86_64-linux

DEPENDENCIES
  sass-embedded

BUNDLED WITH
   2.3.22
+ bundle
Bundler 2.3.21 is running, but your lockfile was generated with 2.3.22. Installing Bundler 2.3.22 and restarting using that version.
Fetching gem metadata from https://rubygems.org/.
Fetching bundler 2.3.22
Installing bundler 2.3.22
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake 13.0.6
Using bundler 2.3.22
Fetching google-protobuf 3.21.7 (x86_64-linux)
Installing google-protobuf 3.21.7 (x86_64-linux)
Fetching sass-embedded 1.55.0
Installing sass-embedded 1.55.0 with native extensions
Bundle complete! 1 Gemfile dependency, 4 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
+ cd ..
+ cd bundler-2.3.22-platform-linux-ruby
+ cat Gemfile.lock
GEM
  remote: https://rubygems.org/
  specs:
    google-protobuf (3.21.7)
    google-protobuf (3.21.7-x86_64-linux)
    rake (13.0.6)
    sass-embedded (1.55.0)
      google-protobuf (~> 3.19)
      rake (>= 10.0.0)
    sass-embedded (1.55.0-x86_64-linux-gnu)
      google-protobuf (~> 3.19)

PLATFORMS
  ruby
  x86_64-linux

DEPENDENCIES
  sass-embedded

BUNDLED WITH
   2.3.22
+ bundle
Fetching gem metadata from https://rubygems.org/.
Using rake 13.0.6
Using bundler 2.3.22
Using google-protobuf 3.21.7 (x86_64-linux)
Using sass-embedded 1.55.0
Bundle complete! 1 Gemfile dependency, 4 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
1 installed gem you directly depend on is looking for funding.
  Run `bundle fund` for details
+ cd ..
+ cd bundler-2.3.23-platform-linux
+ cat Gemfile.lock
GEM
  remote: https://rubygems.org/
  specs:
    google-protobuf (3.21.7-x86_64-linux)
    sass-embedded (1.55.0-x86_64-linux-gnu)
      google-protobuf (~> 3.19)

PLATFORMS
  x86_64-linux

DEPENDENCIES
  sass-embedded

BUNDLED WITH
   2.3.23
+ bundle
Bundler 2.3.22 is running, but your lockfile was generated with 2.3.23. Installing Bundler 2.3.23 and restarting using that version.
Fetching gem metadata from https://rubygems.org/.
Fetching bundler 2.3.23
Installing bundler 2.3.23
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake 13.0.6
Using bundler 2.3.23
Using google-protobuf 3.21.7 (x86_64-linux)
Using sass-embedded 1.55.0
Bundle complete! 1 Gemfile dependency, 4 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
1 installed gem you directly depend on is looking for funding.
  Run `bundle fund` for details
+ cd ..
+ cd bundler-2.3.23-platform-linux-ruby
+ cat Gemfile.lock
GEM
  remote: https://rubygems.org/
  specs:
    google-protobuf (3.21.7)
    google-protobuf (3.21.7-x86_64-linux)
    rake (13.0.6)
    sass-embedded (1.55.0)
      google-protobuf (~> 3.19)
      rake (>= 10.0.0)
    sass-embedded (1.55.0-x86_64-linux-gnu)
      google-protobuf (~> 3.19)

PLATFORMS
  ruby
  x86_64-linux

DEPENDENCIES
  sass-embedded

BUNDLED WITH
   2.3.23
+ bundle
Fetching gem metadata from https://rubygems.org/.
Using rake 13.0.6
Using bundler 2.3.23
Using google-protobuf 3.21.7 (x86_64-linux)
Using sass-embedded 1.55.0
Bundle complete! 1 Gemfile dependency, 4 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
1 installed gem you directly depend on is looking for funding.
  Run `bundle fund` for details
+ cd ..

@ntkme
Copy link
Member

ntkme commented Oct 7, 2022

@d4rky-pl In my test above, depending on the BUNDLED WITH version it does have different behavior. 2.3.21 is definitely broken, but >=2.3.22 worked even with the same Gemfile.lock as the one you provided.

@ntkme
Copy link
Member

ntkme commented Oct 7, 2022

(ruby:3.0)root@e779d8fc1200:/home/linuxbrew/gemfile-test# ./test.sh 
+ gem --version
3.2.33
+ ls -d bundler-2.3.21-platform-linux bundler-2.3.21-platform-linux-ruby bundler-2.3.22-platform-linux bundler-2.3.22-platform-linux-ruby bundler-2.3.23-platform-linux bundler-2.3.23-platform-linux-ruby
+ cd bundler-2.3.21-platform-linux
+ cat Gemfile.lock
GEM
  remote: https://rubygems.org/
  specs:
    google-protobuf (3.21.7-x86_64-linux)
    sass-embedded (1.55.0-x86_64-linux-gnu)
      google-protobuf (~> 3.19)

PLATFORMS
  x86_64-linux

DEPENDENCIES
  sass-embedded

BUNDLED WITH
   2.3.21
+ bundle
Warning: the running version of Bundler (2.2.33) is older than the version that created the lockfile (2.3.21). We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.3.21`.
Fetching gem metadata from https://rubygems.org/..
Your bundle is locked to sass-embedded (1.55.0-x86_64-linux) from rubygems repository https://rubygems.org/ or installed locally, but that version can no longer be found in that
source. That means the author of sass-embedded (1.55.0-x86_64-linux) has removed it. You'll need to update your bundle to a version other than sass-embedded (1.55.0-x86_64-linux)
that hasn't been removed in order to install.
+ cd ..
+ cd bundler-2.3.21-platform-linux-ruby
+ cat Gemfile.lock
GEM
  remote: https://rubygems.org/
  specs:
    google-protobuf (3.21.7)
    google-protobuf (3.21.7-x86_64-linux)
    rake (13.0.6)
    sass-embedded (1.55.0)
      google-protobuf (~> 3.19)
      rake (>= 10.0.0)
    sass-embedded (1.55.0-x86_64-linux-gnu)
      google-protobuf (~> 3.19)

PLATFORMS
  ruby
  x86_64-linux

DEPENDENCIES
  sass-embedded

BUNDLED WITH
   2.3.21
+ bundle
Warning: the running version of Bundler (2.2.33) is older than the version that created the lockfile (2.3.21). We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.3.21`.
Fetching gem metadata from https://rubygems.org/.
Your bundle is locked to sass-embedded (1.55.0-x86_64-linux) from rubygems repository https://rubygems.org/ or installed locally, but that version can no longer be found in that
source. That means the author of sass-embedded (1.55.0-x86_64-linux) has removed it. You'll need to update your bundle to a version other than sass-embedded (1.55.0-x86_64-linux)
that hasn't been removed in order to install.
+ cd ..
+ cd bundler-2.3.22-platform-linux
+ cat Gemfile.lock
GEM
  remote: https://rubygems.org/
  specs:
    google-protobuf (3.21.7-x86_64-linux)
    sass-embedded (1.55.0-x86_64-linux-gnu)
      google-protobuf (~> 3.19)

PLATFORMS
  x86_64-linux

DEPENDENCIES
  sass-embedded

BUNDLED WITH
   2.3.22
+ bundle
Warning: the running version of Bundler (2.2.33) is older than the version that created the lockfile (2.3.22). We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.3.22`.
Fetching gem metadata from https://rubygems.org/..
Your bundle is locked to sass-embedded (1.55.0-x86_64-linux) from rubygems repository https://rubygems.org/ or installed locally, but that version can no longer be found in that
source. That means the author of sass-embedded (1.55.0-x86_64-linux) has removed it. You'll need to update your bundle to a version other than sass-embedded (1.55.0-x86_64-linux)
that hasn't been removed in order to install.
+ cd ..
+ cd bundler-2.3.22-platform-linux-ruby
+ cat Gemfile.lock
GEM
  remote: https://rubygems.org/
  specs:
    google-protobuf (3.21.7)
    google-protobuf (3.21.7-x86_64-linux)
    rake (13.0.6)
    sass-embedded (1.55.0)
      google-protobuf (~> 3.19)
      rake (>= 10.0.0)
    sass-embedded (1.55.0-x86_64-linux-gnu)
      google-protobuf (~> 3.19)

PLATFORMS
  ruby
  x86_64-linux

DEPENDENCIES
  sass-embedded

BUNDLED WITH
   2.3.22
+ bundle
Warning: the running version of Bundler (2.2.33) is older than the version that created the lockfile (2.3.22). We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.3.22`.
Fetching gem metadata from https://rubygems.org/.
Your bundle is locked to sass-embedded (1.55.0-x86_64-linux) from rubygems repository https://rubygems.org/ or installed locally, but that version can no longer be found in that
source. That means the author of sass-embedded (1.55.0-x86_64-linux) has removed it. You'll need to update your bundle to a version other than sass-embedded (1.55.0-x86_64-linux)
that hasn't been removed in order to install.
+ cd ..
+ cd bundler-2.3.23-platform-linux
+ cat Gemfile.lock
GEM
  remote: https://rubygems.org/
  specs:
    google-protobuf (3.21.7-x86_64-linux)
    sass-embedded (1.55.0-x86_64-linux-gnu)
      google-protobuf (~> 3.19)

PLATFORMS
  x86_64-linux

DEPENDENCIES
  sass-embedded

BUNDLED WITH
   2.3.23
+ bundle
Warning: the running version of Bundler (2.2.33) is older than the version that created the lockfile (2.3.23). We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.3.23`.
Fetching gem metadata from https://rubygems.org/..
Your bundle is locked to sass-embedded (1.55.0-x86_64-linux) from rubygems repository https://rubygems.org/ or installed locally, but that version can no longer be found in that
source. That means the author of sass-embedded (1.55.0-x86_64-linux) has removed it. You'll need to update your bundle to a version other than sass-embedded (1.55.0-x86_64-linux)
that hasn't been removed in order to install.
+ cd ..
+ cd bundler-2.3.23-platform-linux-ruby
+ cat Gemfile.lock
GEM
  remote: https://rubygems.org/
  specs:
    google-protobuf (3.21.7)
    google-protobuf (3.21.7-x86_64-linux)
    rake (13.0.6)
    sass-embedded (1.55.0)
      google-protobuf (~> 3.19)
      rake (>= 10.0.0)
    sass-embedded (1.55.0-x86_64-linux-gnu)
      google-protobuf (~> 3.19)

PLATFORMS
  ruby
  x86_64-linux

DEPENDENCIES
  sass-embedded

BUNDLED WITH
   2.3.23
+ bundle
Warning: the running version of Bundler (2.2.33) is older than the version that created the lockfile (2.3.23). We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.3.23`.
Fetching gem metadata from https://rubygems.org/.
Your bundle is locked to sass-embedded (1.55.0-x86_64-linux) from rubygems repository https://rubygems.org/ or installed locally, but that version can no longer be found in that
source. That means the author of sass-embedded (1.55.0-x86_64-linux) has removed it. You'll need to update your bundle to a version other than sass-embedded (1.55.0-x86_64-linux)
that hasn't been removed in order to install.
+ cd ..

@ntkme
Copy link
Member

ntkme commented Oct 7, 2022

@d4rky-pl From the two tests I did above you see gem --version definitely made a difference. rubygems =3.3.7 + bundler >= 2.3.22 always work. rubygems =3.2.33 or bundler <2.3.22 always fail.

Edit: Actually, it is the default version of bundler that comes with rubygems making the difference.

@ntkme
Copy link
Member

ntkme commented Oct 7, 2022

Here are a few conclusions:

  1. When generating Gemfile.lock, bundler >= 2.3.22 is required to make sure 2.3.21 will not be used.
  2. At install time, bundler >= 2.3.0 is required and it will work only if it install the higher version of bundler and restart.
  3. If heroku prevents auto install of the proper version of bundler, that is their problem of diverge from standard experience.

@ntkme
Copy link
Member

ntkme commented Oct 11, 2022

Actually, there is another way out for it to work on heroku. If you use rubygems < 3.3.21 in your dev environment to create Gemfile.lock, it will not have linux-gnu entry at all, so that it should work on heroku.

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

3 participants