Граф коммитов

23 Коммитов

Автор SHA1 Сообщение Дата
Jon Ruskin 9686c16713 remove ruby_packer checks from bundler source 2022-12-11 13:32:32 -07:00
Jarek Radosz 598f683243
Replace mini_racer to fix latest macOS/Apple silicon compatibility
mini_racer 0.3.1 isn't compatible with more recent macOS versions (in part due to lack of python 2) which made `script/setup` fail with:

```
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/cvx/dev/licensed/test/fixtures/bundler/vendor/gems/ruby/2.7.0/gems/libv8-8.4.255.0/ext/libv8
/Users/cvx/.rubies/ruby-2.7.6/bin/ruby -I /Users/cvx/.rubies/ruby-2.7.6/lib/ruby/site_ruby/2.7.0 extconf.rb
creating Makefile
/Users/cvx/dev/licensed/test/fixtures/bundler/vendor/gems/ruby/2.7.0/gems/libv8-8.4.255.0/ext/libv8/builder.rb:57:in `setup_python!': libv8 requires python 2 to be installed in order to build, but it is currently
3.9.13 (RuntimeError)
	from /Users/cvx/dev/licensed/test/fixtures/bundler/vendor/gems/ruby/2.7.0/gems/libv8-8.4.255.0/ext/libv8/builder.rb:39:in `build_libv8!'
	from /Users/cvx/dev/licensed/test/fixtures/bundler/vendor/gems/ruby/2.7.0/gems/libv8-8.4.255.0/ext/libv8/location.rb:24:in `install!'
	from extconf.rb:7:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /Users/cvx/dev/licensed/test/fixtures/bundler/vendor/gems/ruby/2.7.0/gems/libv8-8.4.255.0 for inspection.
Results logged to /Users/cvx/dev/licensed/test/fixtures/bundler/vendor/gems/ruby/2.7.0/extensions/arm64-darwin-21/2.7.0-static/libv8-8.4.255.0/gem_make.out

  /Users/cvx/.rubies/ruby-2.7.6/lib/ruby/site_ruby/2.7.0/rubygems/ext/builder.rb:102:in `run'
  /Users/cvx/.rubies/ruby-2.7.6/lib/ruby/site_ruby/2.7.0/rubygems/ext/ext_conf_builder.rb:28:in `build'
  /Users/cvx/.rubies/ruby-2.7.6/lib/ruby/site_ruby/2.7.0/rubygems/ext/builder.rb:171:in `build_extension'
  /Users/cvx/.rubies/ruby-2.7.6/lib/ruby/site_ruby/2.7.0/rubygems/ext/builder.rb:205:in `block in build_extensions'
  /Users/cvx/.rubies/ruby-2.7.6/lib/ruby/site_ruby/2.7.0/rubygems/ext/builder.rb:202:in `each'
  /Users/cvx/.rubies/ruby-2.7.6/lib/ruby/site_ruby/2.7.0/rubygems/ext/builder.rb:202:in `build_extensions'
  /Users/cvx/.rubies/ruby-2.7.6/lib/ruby/site_ruby/2.7.0/rubygems/installer.rb:851:in `build_extensions'
  /Users/cvx/.rubies/ruby-2.7.6/lib/ruby/site_ruby/2.7.0/bundler/rubygems_gem_installer.rb:72:in `build_extensions'
  /Users/cvx/.rubies/ruby-2.7.6/lib/ruby/site_ruby/2.7.0/bundler/rubygems_gem_installer.rb:28:in `install'
  /Users/cvx/.rubies/ruby-2.7.6/lib/ruby/site_ruby/2.7.0/bundler/source/rubygems.rb:207:in `install'
  /Users/cvx/.rubies/ruby-2.7.6/lib/ruby/site_ruby/2.7.0/bundler/installer/gem_installer.rb:54:in `install'
  /Users/cvx/.rubies/ruby-2.7.6/lib/ruby/site_ruby/2.7.0/bundler/installer/gem_installer.rb:16:in `install_from_spec'
  /Users/cvx/.rubies/ruby-2.7.6/lib/ruby/site_ruby/2.7.0/bundler/installer/parallel_installer.rb:186:in `do_install'
  /Users/cvx/.rubies/ruby-2.7.6/lib/ruby/site_ruby/2.7.0/bundler/installer/parallel_installer.rb:177:in `block in worker_pool'
  /Users/cvx/.rubies/ruby-2.7.6/lib/ruby/site_ruby/2.7.0/bundler/worker.rb:62:in `apply_func'
  /Users/cvx/.rubies/ruby-2.7.6/lib/ruby/site_ruby/2.7.0/bundler/worker.rb:57:in `block in process_queue'
  /Users/cvx/.rubies/ruby-2.7.6/lib/ruby/site_ruby/2.7.0/bundler/worker.rb:54:in `loop'
  /Users/cvx/.rubies/ruby-2.7.6/lib/ruby/site_ruby/2.7.0/bundler/worker.rb:54:in `process_queue'
  /Users/cvx/.rubies/ruby-2.7.6/lib/ruby/site_ruby/2.7.0/bundler/worker.rb:91:in `block (2 levels) in create_threads'

An error occurred while installing libv8 (8.4.255.0), and Bundler cannot continue.

In Gemfile:
  mini_racer was resolved to 0.3.1, which depends on
    libv8
Encountered an error running script/source-setup/bundler.
```

Updating it caused a different problem - a bug in bundler caused it to install both `linux` and `linux-musl` variants in the CI environment. (see: https://github.com/rubyjs/libv8-node/issues/5 and https://github.com/rubygems/rubygems/issues/3174)

This instead replaces `mini_racer` example with `loofah`. That gem depends on `nokogiri` which provides different binary variants, like `libv8`/`libv8-node` did.

But this one builds properly on macOS and does not provide `linux-musl` variant so it should not cause any issues on CI.
2022-07-30 10:44:26 +02:00
Jon Ruskin 1423d8e236 remove more custom logic, rely on bundler internals
This removes more custom logic from the bundler
source, and relies more on bundler internals to
the appropriate files

There are two significant changes here
1. Using ::Bundler.load after ::Bundler.reset!
   reconfigures the local bundler runtime.  This
   forces bundler to pick up any changes to the
   available platforms
2. Monkeypatching ::Bundler::Definition in order
   to remove as much custom logic as possible.  As
   bundler changes, it's become increasingly brittle
   to use custom behaviors outside of how Bundler
   normally operates.  This move is intended to focus
   the source more on configuring Bundler to operate
   over multiple directories similar to how Bundler
   configures RubyGems to operate over multiple
   projects.
2021-09-03 21:00:21 -07:00
Jon Ruskin 9ef4e2c6fe reset bundle gemfile env after tests
seems like this might be the cause of the test flakiness
2021-06-19 18:31:29 -07:00
Jon Ruskin 224b243d76 do not reset bundler environment if unneeded 2021-06-15 17:47:18 -07:00
Jon Ruskin da13854d66 remove direct tests of include_bundler?
the scenario is exercised without these methods
and they can be flaky due to not running under
the context of `with_local_configuration`
2021-05-16 21:14:18 -07:00
Jon Ruskin 8c244d1d69 get rid of search root usage
not sure why this was added in the first place.
from what I've seen, bundler doesn't really do dependency nesting.
additionally, what was returned from spec_root
looks an awful lot like the specifications gem_dir
2021-05-16 21:12:13 -07:00
Jon Ruskin 644457a537 validate git sourced gems work 2021-05-16 17:14:33 -07:00
Jon Ruskin bed9ba620e add missing end statement 2021-04-18 15:29:41 -07:00
Jon Ruskin 11d8d2061b simplify bundler source
now that this source doesn't need compatibility
with the ruby packer runtime it can go back to
using Bundler's available public API... mostly

there is no way to easily specify that bundler
should not raise an error without using a
private method, so I ended up monkey patching
specification materialization
2021-04-17 23:14:46 -07:00
Jon Ruskin 66c9131d37 disable bundler source in ruby packer runtime 2021-04-17 15:43:05 -07:00
Jon Ruskin 541a55ac7b fix lock filename for gems.rb 2020-08-04 12:41:37 -07:00
Jon Ruskin ca70e1fb21 fix source tests 2020-02-17 12:33:01 -07:00
Jon Ruskin f4c1595061 use bundler for tests
not installed to vendor directory
2019-08-20 17:33:21 -07:00
Jon Ruskin e37eadf87a add version to gem spec cli call 2019-08-20 15:43:01 -07:00
Jon Ruskin 58d65b9186 provide a backup to find a specification file 2019-03-24 19:49:41 -07:00
Jon Ruskin 6e59b28e66 add test for failure scenario 2019-03-24 17:53:53 -07:00
Jon Ruskin 64689598f5 handle errors for bundler source 2019-02-04 20:36:09 -07:00
Jon Ruskin 9ab4e95ae1 make version a required dependency arg 2019-01-03 14:29:15 -07:00
Jon Ruskin ac78d09e23 update other sources 2019-01-03 14:11:48 -07:00
Jon Ruskin aa0fc90615 set bundler source type as bundler 2018-12-31 12:18:13 -07:00
Jon Ruskin 040a2b8628 Merge branch 'master' into source-refactor 2018-11-02 20:12:11 -07:00
Jon Ruskin 0902240e35 move sources tests 2018-10-28 17:23:56 -07:00