Hello community,
here is the log from the commit of package rubygem-bootsnap for
openSUSE:Factory checked in at 2020-11-11 20:47:08
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-bootsnap (Old)
and /work/SRC/openSUSE:Factory/.rubygem-bootsnap.new.26437 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-bootsnap"
Wed Nov 11 20:47:08 2020 rev:8 rq:847611 version:1.5.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-bootsnap/rubygem-bootsnap.changes
2020-11-02 10:36:37.947306548 +0100
+++
/work/SRC/openSUSE:Factory/.rubygem-bootsnap.new.26437/rubygem-bootsnap.changes
2020-11-11 20:47:11.787692314 +0100
@@ -1,0 +2,7 @@
+Tue Nov 10 21:00:10 UTC 2020 - Manuel Schnitzer <[email protected]>
+
+- updated to version 1.5.1
+
+ * Workaround a Ruby bug in InstructionSequence.compile_file. (#332)
+
+-------------------------------------------------------------------
Old:
----
bootsnap-1.4.9.gem
New:
----
bootsnap-1.5.1.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-bootsnap.spec ++++++
--- /var/tmp/diff_new_pack.bBbe2g/_old 2020-11-11 20:47:12.527693009 +0100
+++ /var/tmp/diff_new_pack.bBbe2g/_new 2020-11-11 20:47:12.531693012 +0100
@@ -24,7 +24,7 @@
#
Name: rubygem-bootsnap
-Version: 1.4.9
+Version: 1.5.1
Release: 0
%define mod_name bootsnap
%define mod_full_name %{mod_name}-%{version}
@@ -32,12 +32,14 @@
BuildRequires: %{rubydevel >= 2.3.0}
BuildRequires: %{rubygem gem2rpm}
BuildRequires: ruby-macros >= 5
+BuildRequires: update-alternatives
URL: https://github.com/Shopify/bootsnap
Source: https://rubygems.org/gems/%{mod_full_name}.gem
Source1: gem2rpm.yml
Summary: Boot large ruby/rails apps faster
License: MIT
Group: Development/Languages/Ruby
+PreReq: update-alternatives
%description
Boot large ruby/rails apps faster.
@@ -48,6 +50,7 @@
%install
%gem_install \
+ --symlink-binaries \
--doc-files="CHANGELOG.md LICENSE.txt README.md" \
-f
%gem_cleanup
++++++ bootsnap-1.4.9.gem -> bootsnap-1.5.1.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md
--- old/CHANGELOG.md 2020-10-26 19:22:04.000000000 +0100
+++ new/CHANGELOG.md 2020-11-10 10:17:27.000000000 +0100
@@ -1,3 +1,11 @@
+# 1.5.1
+
+* Workaround a Ruby bug in InstructionSequence.compile_file. (#332)
+
+# 1.5.0
+
+* Add a command line to statically precompile the ISeq cache. (#326)
+
# 1.4.9
* [Windows support](https://github.com/Shopify/bootsnap/pull/319)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md 2020-10-26 19:22:04.000000000 +0100
+++ new/README.md 2020-11-10 10:17:27.000000000 +0100
@@ -1,4 +1,4 @@
-# Bootsnap [](https://travis-ci.org/Shopify/bootsnap)
+# Bootsnap [](https://github.com/Shopify/bootsnap/actions)
Bootsnap is a library that plugs into Ruby, with optional support for
`ActiveSupport` and `YAML`,
to optimize and cache expensive computations. See [How Does This
Work](#how-does-this-work).
@@ -294,6 +294,19 @@
# (nothing!)
```
+## Precompilation
+
+In development environments the bootsnap compilation cache is generated on the
fly when source files are loaded.
+But in production environments, such as docker images, you might need to
precompile the cache.
+
+To do so you can use the `bootsnap precompile` command.
+
+Example:
+
+```bash
+$ bundle exec bootsnap precompile --gemfile app/ lib/
+```
+
## When not to use Bootsnap
*Alternative engines*: Bootsnap is pretty reliant on MRI features, and parts
are disabled entirely on alternative ruby
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/exe/bootsnap new/exe/bootsnap
--- old/exe/bootsnap 1970-01-01 01:00:00.000000000 +0100
+++ new/exe/bootsnap 2020-11-10 10:17:27.000000000 +0100
@@ -0,0 +1,5 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+require 'bootsnap/cli'
+exit Bootsnap::CLI.new(ARGV).run
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/bootsnap/cli.rb new/lib/bootsnap/cli.rb
--- old/lib/bootsnap/cli.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/lib/bootsnap/cli.rb 2020-11-10 10:17:27.000000000 +0100
@@ -0,0 +1,151 @@
+# frozen_string_literal: true
+
+require 'bootsnap'
+require 'optparse'
+require 'fileutils'
+
+module Bootsnap
+ class CLI
+ unless Regexp.method_defined?(:match?)
+ module RegexpMatchBackport
+ refine Regexp do
+ def match?(string)
+ !!match(string)
+ end
+ end
+ end
+ using RegexpMatchBackport
+ end
+
+ attr_reader :cache_dir, :argv
+
+ attr_accessor :compile_gemfile, :exclude
+
+ def initialize(argv)
+ @argv = argv
+ self.cache_dir = ENV.fetch('BOOTSNAP_CACHE_DIR', 'tmp/cache')
+ self.compile_gemfile = false
+ self.exclude = nil
+ end
+
+ def precompile_command(*sources)
+ require 'bootsnap/compile_cache/iseq'
+
+ fix_default_encoding do
+ Bootsnap::CompileCache::ISeq.cache_dir = self.cache_dir
+
+ if compile_gemfile
+ sources += $LOAD_PATH
+ end
+
+ sources.map { |d| File.expand_path(d) }.each do |path|
+ if !exclude || !exclude.match?(path)
+ list_ruby_files(path).each do |ruby_file|
+ if !exclude || !exclude.match?(ruby_file)
+ CompileCache::ISeq.fetch(ruby_file, cache_dir: cache_dir)
+ end
+ end
+ end
+ end
+ end
+ 0
+ end
+
+ dir_sort = begin
+ Dir['.', sort: false]
+ true
+ rescue ArgumentError, TypeError
+ false
+ end
+
+ if dir_sort
+ def list_ruby_files(path)
+ if File.directory?(path)
+ Dir[File.join(path, '**/*.rb'), sort: false]
+ elsif File.exist?(path)
+ [path]
+ else
+ []
+ end
+ end
+ else
+ def list_ruby_files(path)
+ if File.directory?(path)
+ Dir[File.join(path, '**/*.rb')]
+ elsif File.exist?(path)
+ [path]
+ else
+ []
+ end
+ end
+ end
+
+ def run
+ parser.parse!(argv)
+ command = argv.shift
+ method = "#{command}_command"
+ if respond_to?(method)
+ public_send(method, *argv)
+ else
+ invalid_usage!("Unknown command: #{command}")
+ end
+ end
+
+ private
+
+ def fix_default_encoding
+ if Encoding.default_external == Encoding::US_ASCII
+ Encoding.default_external = Encoding::UTF_8
+ begin
+ yield
+ ensure
+ Encoding.default_external = Encoding::US_ASCII
+ end
+ else
+ yield
+ end
+ end
+
+ def invalid_usage!(message)
+ STDERR.puts message
+ STDERR.puts
+ STDERR.puts parser
+ 1
+ end
+
+ def cache_dir=(dir)
+ @cache_dir = File.expand_path(File.join(dir, 'bootsnap-compile-cache'))
+ end
+
+ def parser
+ @parser ||= OptionParser.new do |opts|
+ opts.banner = "Usage: bootsnap COMMAND [ARGS]"
+ opts.separator ""
+ opts.separator "GLOBAL OPTIONS"
+ opts.separator ""
+
+ help = <<~EOS
+ Path to the bootsnap cache directory. Defaults to tmp/cache
+ EOS
+ opts.on('--cache-dir DIR', help.strip) do |dir|
+ self.cache_dir = dir
+ end
+
+ opts.separator ""
+ opts.separator "COMMANDS"
+ opts.separator ""
+ opts.separator " precompile [DIRECTORIES...]: Precompile all .rb
files in the passed directories"
+
+ help = <<~EOS
+ Precompile the gems in Gemfile
+ EOS
+ opts.on('--gemfile', help) { self.compile_gemfile = true }
+
+ help = <<~EOS
+ Path pattern to not precompile. e.g. --exclude 'aws-sdk|google-api'
+ EOS
+ opts.on('--exclude PATTERN', help) { |pattern| self.exclude =
Regexp.new(pattern) }
+ end
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/bootsnap/compile_cache/iseq.rb
new/lib/bootsnap/compile_cache/iseq.rb
--- old/lib/bootsnap/compile_cache/iseq.rb 2020-10-26 19:22:04.000000000
+0100
+++ new/lib/bootsnap/compile_cache/iseq.rb 2020-11-10 10:17:27.000000000
+0100
@@ -26,7 +26,16 @@
end
end
- def self.input_to_output(_, _)
+ def self.fetch(path, cache_dir: ISeq.cache_dir)
+ Bootsnap::CompileCache::Native.fetch(
+ cache_dir,
+ path.to_s,
+ Bootsnap::CompileCache::ISeq,
+ nil,
+ )
+ end
+
+ def self.input_to_output(_data, _kwargs)
nil # ruby handles this
end
@@ -35,12 +44,7 @@
# Having coverage enabled prevents iseq dumping/loading.
return nil if defined?(Coverage) &&
Bootsnap::CompileCache::Native.coverage_running?
- Bootsnap::CompileCache::Native.fetch(
- Bootsnap::CompileCache::ISeq.cache_dir,
- path.to_s,
- Bootsnap::CompileCache::ISeq,
- nil,
- )
+ Bootsnap::CompileCache::ISeq.fetch(path.to_s)
rescue Errno::EACCES
Bootsnap::CompileCache.permission_error(path)
rescue RuntimeError => e
@@ -61,6 +65,7 @@
crc = Zlib.crc32(option.inspect)
Bootsnap::CompileCache::Native.compile_option_crc32 = crc
end
+ compile_option_updated
def self.install!(cache_dir)
Bootsnap::CompileCache::ISeq.cache_dir = cache_dir
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/bootsnap/version.rb new/lib/bootsnap/version.rb
--- old/lib/bootsnap/version.rb 2020-10-26 19:22:04.000000000 +0100
+++ new/lib/bootsnap/version.rb 2020-11-10 10:17:28.000000000 +0100
@@ -1,4 +1,4 @@
# frozen_string_literal: true
module Bootsnap
- VERSION = "1.4.9"
+ VERSION = "1.5.1"
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2020-10-26 19:22:04.000000000 +0100
+++ new/metadata 2020-11-10 10:17:27.000000000 +0100
@@ -1,14 +1,14 @@
--- !ruby/object:Gem::Specification
name: bootsnap
version: !ruby/object:Gem::Version
- version: 1.4.9
+ version: 1.5.1
platform: ruby
authors:
- Burke Libbey
autorequire:
-bindir: bin
+bindir: exe
cert_chain: []
-date: 2020-10-26 00:00:00.000000000 Z
+date: 2020-11-10 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: bundler
@@ -97,7 +97,8 @@
description: Boot large ruby/rails apps faster
email:
- [email protected]
-executables: []
+executables:
+- bootsnap
extensions:
- ext/bootsnap/extconf.rb
extra_rdoc_files: []
@@ -105,11 +106,13 @@
- CHANGELOG.md
- LICENSE.txt
- README.md
+- exe/bootsnap
- ext/bootsnap/bootsnap.c
- ext/bootsnap/bootsnap.h
- ext/bootsnap/extconf.rb
- lib/bootsnap.rb
- lib/bootsnap/bundler.rb
+- lib/bootsnap/cli.rb
- lib/bootsnap/compile_cache.rb
- lib/bootsnap/compile_cache/iseq.rb
- lib/bootsnap/compile_cache/yaml.rb
_______________________________________________
openSUSE Commits mailing list -- [email protected]
To unsubscribe, email [email protected]
List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette
List Archives:
https://lists.opensuse.org/archives/list/[email protected]