-
Notifications
You must be signed in to change notification settings - Fork 5
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
Fix slow load time of metanorma
command without use of bundler
#81
Comments
This file is generated by RubyGems:
#!/Users/me/.rbenv/versions/2.5.1/bin/ruby
#
# This file was generated by RubyGems.
#
# The application 'metanorma-cli' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'rubygems'
version = ">= 0.a"
str = ARGV.first
if str
str = str.b[/\A_(.*)_\z/, 1]
if str and Gem::Version.correct?(str)
version = str
ARGV.shift
end
end
if Gem.respond_to?(:activate_bin_path)
load Gem.activate_bin_path('metanorma-cli', 'metanorma', version) # <=== This is the line that loads for a long time
else
gem "metanorma-cli", version
load Gem.bin_path("metanorma-cli", "metanorma", version)
end |
This apparently only appears in 2.5.x, not 2.6 (works fine in 2.6, with a short lag). |
According to my research, we fall into a problem which described here https://www.sitepoint.com/rubygems-slow/ I did As far as I understood the only solution for this is 'cleanup' installed gems and remove unused versions of gem @ronaldtse @abunashir let me know wht do you think about this? |
@CAMOBAP795 I believe this is also due to our laxness in gemspec version specification. We need to ensure each metanorma gem has a tight version dependency. This is related to https://github.com/metanorma/metanorma-release. |
@ronaldtse: by any chance do you have |
Of course not 😉 |
I tried a clean installation in Trying to reproduce the issue, could you please sent me your |
|
I believe the problem is more pronounced due to this issue (posted by sorah , a Ruby committer): And there is a problem where the |
@ronaldtse: Yap, what's your suggestion to resolve this issue? |
The suggested fix is: "Resolve gem versions early on": From aws/aws-sdk-ruby#1811 (comment)
|
@ronaldtse: I don't have an exact idea to fix this one yet, is it something major and worth spending the time now or should we postponed this until it become a big problem? |
@abunashir this is actually quite a significant problem for people who have upgraded the metanorma gem several times without using bundler. Can you help us resolve this? Thanks! |
Ping @abunashir. |
As mentioned in aws/aws-sdk-ruby#1811 (comment):
I think we should:
|
Here what happens when I require $ irb -rmetanorma-cli
/Users/me/.rbenv/versions/2.6.6/lib/ruby/2.6.0/irb/init.rb:280: warning: Gem::ConflictError: Unable to activate asciimath2unitsml-0.1.3, because nokogiri-1.11.1-x86_64-darwin conflicts with nokogiri (~> 1.10.4)
irb(main):001:0> Gem::Specification.unresolved_deps
=>
{"thor"=>
Gem::Dependency.new("thor", Gem::Requirement.new(["~> 1.0"]), :runtime),
"metanorma-iso"=>
Gem::Dependency.new("metanorma-iso",
Gem::Requirement.new(["~> 1.7.0"]),
:runtime),
"metanorma-ietf"=>
Gem::Dependency.new("metanorma-ietf",
Gem::Requirement.new(["~> 2.2.0"]),
:runtime),
"metanorma-iec"=>
Gem::Dependency.new("metanorma-iec",
Gem::Requirement.new(["~> 1.2.0"]),
:runtime),
"metanorma-cc"=>
Gem::Dependency.new("metanorma-cc",
Gem::Requirement.new(["~> 1.6.0"]),
:runtime),
"metanorma-csa"=>
Gem::Dependency.new("metanorma-csa",
Gem::Requirement.new(["~> 1.7.0"]),
:runtime),
"metanorma-m3aawg"=>
Gem::Dependency.new("metanorma-m3aawg",
Gem::Requirement.new(["~> 1.6.0"]),
:runtime),
"metanorma-bipm"=>
Gem::Dependency.new("metanorma-bipm",
Gem::Requirement.new(["~> 1.0.0"]),
:runtime),
"metanorma-standoc"=>
Gem::Dependency.new("metanorma-standoc",
Gem::Requirement.new(["~> 1.8.0"]),
:runtime),
"isodoc"=>
Gem::Dependency.new("isodoc",
Gem::Requirement.new([">= 1.5.0", "~> 1.5.0"]),
:runtime),
"metanorma-un"=>
Gem::Dependency.new("metanorma-un",
Gem::Requirement.new(["~> 0.5.0"]),
:runtime),
"metanorma-ogc"=>
Gem::Dependency.new("metanorma-ogc",
Gem::Requirement.new(["~> 1.2.0"]),
:runtime),
"metanorma-nist"=>
Gem::Dependency.new("metanorma-nist",
Gem::Requirement.new(["~> 1.2.0"]),
:runtime),
"metanorma-itu"=>
Gem::Dependency.new("metanorma-itu",
Gem::Requirement.new(["~> 1.2.0"]),
:runtime),
"metanorma-iho"=>
Gem::Dependency.new("metanorma-iho",
Gem::Requirement.new(["~> 0.2.0"]),
:runtime),
"git"=>Gem::Dependency.new("git", Gem::Requirement.new(["~> 1.5"]), :runtime),
"metanorma-utils"=>
Gem::Dependency.new("metanorma-utils",
Gem::Requirement.new(["~> 1.0.2", "~> 1.0.3"]),
:runtime),
"pry"=>Gem::Dependency.new("pry", Gem::Requirement.new([">= 0"]), :runtime),
"fontist"=>
Gem::Dependency.new("fontist", Gem::Requirement.new(["~> 1.8"]), :runtime),
"liquid"=>
Gem::Dependency.new("liquid", Gem::Requirement.new([">= 0"]), :runtime),
"metanorma-plugin-lutaml"=>
Gem::Dependency.new("metanorma-plugin-lutaml",
Gem::Requirement.new(["~> 0.2.1"]),
:runtime),
"relaton"=>
Gem::Dependency.new("relaton",
Gem::Requirement.new([">= 1.6", "~> 1.7.0"]),
:runtime),
"concurrent-ruby"=>
Gem::Dependency.new("concurrent-ruby",
Gem::Requirement.new([">= 0"]),
:runtime),
"unicode2latex"=>
Gem::Dependency.new("unicode2latex",
Gem::Requirement.new(["~> 0.0.1"]),
:runtime),
"ox"=>Gem::Dependency.new("ox", Gem::Requirement.new(["~> 2.13"]), :runtime)} |
The 'unresolved_deps' occur when a gemspec contains this dependency, but has not been "require"d in Ruby (e.g. |
From @ronaldtse:
|
@ronaldtse @abunashir should |
That would definitely help, and I would personally prefer that but @ronaldtse had some valid point about the user, trying to see if we can somehow fix this without a user having to cleanup their system. |
@ronaldtse: I've created a PR that explicitly activates the flavours on load, I'm not super confident that it would fix the issue but that's the best I can think at the moment. On a positive site - it would fix the issue we've seen earlier related to private gem loading issue. Let me know if that helps :) |
After installing metanorma (without using
bundle
), running the metanorma command is super slow. Notice that the slow code is atbin/metanorma:23
.This urgently needs fixing.
The text was updated successfully, but these errors were encountered: