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

Ruby3 Updates #438

Merged
merged 40 commits into from
May 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
530703f
Some initial "get it working with ruby 3"
pderouen Apr 21, 2022
58a6def
tested with ruby 3.0.2
priyavadan Apr 21, 2022
547a4b8
remove Gemfile.lock to avoid bundler errors
pderouen Apr 22, 2022
cbd0ab3
try again to remove gemfile.lock
pderouen Apr 22, 2022
bb510bc
use supported ruby setup
pderouen Apr 22, 2022
e0dd16c
doc_helpers broken again for windows GA, disable for now
pderouen Apr 22, 2022
3b903c0
GA setup not working with ruby 3
pderouen Apr 22, 2022
3fde407
to see what happens
pderouen Apr 23, 2022
ca8985d
try with whatever bundler version
pderouen Apr 23, 2022
877bd2b
try to get a non-ancient origen version to install
pderouen Apr 23, 2022
898ae80
install bundler
pderouen Apr 23, 2022
8b5d1a8
think a merge release is needed first
pderouen Apr 23, 2022
2b2533d
revert debug changes
pderouen Apr 23, 2022
3cc830a
Revert "revert debug changes"
pderouen Apr 23, 2022
b07d7e0
Revert "think a merge release is needed first"
pderouen Apr 23, 2022
054a4a4
Revert "install bundler"
pderouen Apr 23, 2022
b76e9b6
Revert "try to get a non-ancient origen version to install"
pderouen Apr 23, 2022
c5c354d
Revert "try with whatever bundler version"
pderouen Apr 23, 2022
c05c481
Revert "to see what happens"
pderouen Apr 23, 2022
69f395e
try build and install local origen gem
pderouen Apr 28, 2022
390a53c
try again
pderouen Apr 28, 2022
3b858e1
remove ruby 2.5
pderouen Apr 28, 2022
acf63fc
undo updates
pderouen Apr 28, 2022
16f5bdf
split out tests
pderouen Apr 28, 2022
ab386f4
fix names
pderouen Apr 28, 2022
3d144c3
disable lint in ruby 3 tests
pderouen Apr 28, 2022
a14b5db
update kramdown
pderouen Apr 28, 2022
9304307
put back kramdown runtime dependency, no web compile ruby3
pderouen Apr 28, 2022
e83f51d
attempt to restrict to ruby 3.0
pderouen Apr 30, 2022
e8c723d
add lint back to ruby3 checks
pderouen Apr 30, 2022
8f761f2
Merging GA workflows
pderouen May 10, 2022
0e0975b
Revert "Merging GA workflows"
pderouen May 10, 2022
84a93b5
try adding back web compile
pderouen May 10, 2022
a005e12
add binstub setup
pderouen May 10, 2022
502d7b9
will come back to windows web compile with GA in another PR
pderouen May 10, 2022
cf8892c
trial with if-conditional in workflow
pderouen May 11, 2022
80554da
again
pderouen May 11, 2022
321a9b6
again
pderouen May 11, 2022
6f1ba62
recombine workflows with if conditionals
pderouen May 11, 2022
775f46b
enable Ruby 3.1 checks (minus lint)
pderouen May 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions .github/workflows/regression_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,51 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
ruby-version: [2.5, 2.6, 2.7]
ruby-version: [2.5, 2.6, 2.7, 3.0.4, 3.1]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: actions/setup-ruby@v1
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- name: Update Env
run: echo "ACTIONS_ALLOW_UNSECURE_COMMANDS=true" >> $GITHUB_ENV
- name: Install Bundler
run: gem install bundler -v '> 2'
- name: Remove Gemfile.lock
run: rm Gemfile.lock
- name: Install dependencies
run: bundle install
- name: Gem Install Origen

# Work around Ruby 3 gem install issue
- name: Build Origen Gem - Ruby 3 work around
if: matrix.ruby-version == '3.0.4' || matrix.ruby-version == '3.1'
run: gem build origen.gemspec --output origen.gem
- name: Gem Install Origen - Ruby 3 work around
if: matrix.ruby-version == '3.0.4' || matrix.ruby-version == '3.1'
run: gem install origen.gem

# Normal way of installing origen
- name: Gem Install Origen Ruby 2
if: matrix.ruby-version == '2.5' || matrix.ruby-version == '2.6' || matrix.ruby-version == '2.7'
run: gem install origen

- name: Setup Dependencies
run: origen -v

# Rubocop 0.30.0 is not compatible with Ruby 3.1
- name: Run Origen Lint
if: matrix.ruby-version == '2.5' || matrix.ruby-version == '2.6' || matrix.ruby-version == '2.7' || matrix.ruby-version == '3.0.4'
run: origen lint --no-correct
- name: Set Origen to debug mode
run: origen m debug
- name: Run Spec tests
run: origen test -c

# Temporarily disable web compile check in windows
- name: Verify Building website
if: matrix.os == 'ubuntu-latest'
run: origen web compile --no-serve
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ gem "loco"
#gem "origen_testers", "~> 0.7"
gem 'origen_debuggers', '~> 0'
gem 'ripper-tags'
gem 'nokogiri', '1.10.10' # Lock to this version to enable testing in Ruby 2.2
# gem 'nokogiri', '1.10.10' # Lock to this version to enable testing in Ruby 2.2
gem 'nokogiri'

# Plugins that provide guide pages
gem "origen_testers", git: "https://github.com/Origen-SDK/origen_testers.git"
Expand Down
83 changes: 41 additions & 42 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ GIT

GIT
remote: https://github.com/Origen-SDK/origen_testers.git
revision: 27537eb1bcc39b6995bc28c4f2ead4187e26c7b9
revision: 48cd797b5003cebe02bbae6175a1e3ca9bb6aa1f
specs:
origen_testers (0.48.2)
origen_testers (0.49.4)
ast (~> 2)
atp (~> 1.1, >= 1.1.3)
dentaku (~> 3)
origen (>= 0.57.1)
origen_stil (>= 0.2.1)
require_all (~> 1)
Expand All @@ -47,15 +48,14 @@ PATH
colored (~> 1.2)
colorize (~> 0.8.1)
concurrent-ruby
cri (~> 2.10.0)
dentaku (~> 3)
gems (~> 0.8)
highline (~> 1.7)
httparty (~> 0.13)
kramdown (~> 1.5)
nanoc (~> 3.7.0)
net-ldap (~> 0.13)
nokogiri (>= 1.7.2)
nokogiri (>= 1.11.0)
pry (~> 0.10)
rake (~> 10)
rspec (~> 3)
Expand All @@ -75,7 +75,7 @@ GEM
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
ast (2.4.1)
ast (2.4.2)
astrolabe (1.3.1)
parser (~> 2.2)
atp (1.1.3)
Expand All @@ -87,53 +87,50 @@ GEM
coderay (1.1.3)
colored (1.2)
colorize (0.8.1)
concurrent-ruby (1.1.9)
concurrent-ruby (1.1.10)
coveralls (0.7.1)
multi_json (~> 1.3)
rest-client
simplecov (>= 0.7)
term-ansicolor
thor
cri (2.10.1)
colored (~> 1.2)
dentaku (3.4.2)
cri (2.15.11)
dentaku (3.5.0)
concurrent-ruby
diff-lcs (1.4.4)
docile (1.3.5)
diff-lcs (1.5.0)
docile (1.4.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dry-inflector (0.2.0)
gems (0.8.3)
highline (1.7.10)
http-accept (1.7.0)
http-cookie (1.0.3)
http-cookie (1.0.4)
domain_name (~> 0.5)
httparty (0.20.0)
mime-types (~> 3.0)
multi_xml (>= 0.5.2)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
json (2.5.1)
json (2.6.1)
kramdown (1.17.0)
loco (0.0.7)
method_source (1.0.0)
mime-types (3.3.1)
mime-types (3.4.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2020.1104)
mini_portile2 (2.4.0)
minitest (5.14.4)
mime-types-data (3.2022.0105)
minitest (5.15.0)
multi_json (1.15.0)
multi_xml (0.6.0)
nanoc (3.7.5)
cri (~> 2.3)
net-ldap (0.17.0)
netrc (0.11.0)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
nokogiri (1.13.4-x86_64-linux)
racc (~> 1.4)
origen_debuggers (0.6.1)
origen (>= 0.2.6)
origen_testers (>= 0.5.0)
origen_doc_helpers (0.8.3)
origen_doc_helpers (0.8.6)
origen (>= 0.7.15)
origen_jtag (0.22.1)
origen (~> 0.7, >= 0.7.35)
Expand All @@ -153,6 +150,7 @@ GEM
pry (0.14.1)
coderay (~> 1.1)
method_source (~> 1.0)
racc (1.6.0)
rainbow (2.2.2)
rake
rake (10.5.0)
Expand All @@ -163,35 +161,34 @@ GEM
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
ripper-tags (0.9.0)
rodf (1.1.1)
rodf (1.2.0)
builder (>= 3.0)
dry-inflector (~> 0.1)
rubyzip (>= 1.0)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
rspec-mocks (~> 3.10.0)
rspec-core (3.10.1)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.1)
rspec (3.11.0)
rspec-core (~> 3.11.0)
rspec-expectations (~> 3.11.0)
rspec-mocks (~> 3.11.0)
rspec-core (3.11.0)
rspec-support (~> 3.11.0)
rspec-expectations (3.11.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (~> 3.11.0)
rspec-legacy_formatters (1.0.2)
rspec (~> 3.0)
rspec-mocks (3.10.2)
rspec-mocks (3.11.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (3.10.3)
rspec-support (~> 3.11.0)
rspec-support (3.11.0)
rubocop (0.30.0)
astrolabe (~> 1.3)
parser (>= 2.2.0.1, < 3.0)
powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.4)
ruby-progressbar (1.11.0)
rubyzip (2.3.0)
rubyzip (2.3.2)
scrub_rb (1.0.1)
sexpistol (0.0.7)
sexpistol (0.1.2)
simplecov (0.17.1)
docile (~> 1.1)
json (>= 1.8, < 3)
Expand All @@ -202,25 +199,27 @@ GEM
tins (~> 1.0)
thor (0.20.3)
thread_safe (0.3.6)
tins (1.26.0)
tins (1.31.0)
sync
treetop (1.6.11)
polyglot (~> 0.3)
tzinfo (1.2.9)
thread_safe (~> 0.1)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.7)
yard (0.9.26)
unf_ext (0.0.8.1)
webrick (1.7.0)
yard (0.9.27)
webrick (~> 1.7.0)

PLATFORMS
ruby
x86_64-linux

DEPENDENCIES
byebug (~> 10)
coveralls
loco
nokogiri (= 1.10.10)
nokogiri
origen!
origen_app_generators!
origen_core_support!
Expand All @@ -232,4 +231,4 @@ DEPENDENCIES
ripper-tags

BUNDLED WITH
2.1.4
2.3.7
8 changes: 7 additions & 1 deletion lib/origen/pins.rb
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,13 @@ def virtual_pin_groups(id = nil, options = {}, &_block)
end
alias_method :virtual_pin_group, :virtual_pin_groups

def all_pin_ids(type: nil, **options)
def all_pin_ids(*options)
type = nil
if options.first.is_a?(Hash)
options = options.first
type = options[:type]
end

case type
when :power_pin, :power_pins
dut.pins(power_pin: true).map { |n, p| [n, *p.aliases.keys] }.flatten.map { |n| [n, dut.power_pin(n)] }.to_h
Expand Down
15 changes: 10 additions & 5 deletions lib/origen/pins/pin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1090,11 +1090,12 @@ def ext_pulldown=(value)
end
end

def index?(context: nil)
!!index(context: context).nil?
def index?(options = { context: nil })
!!index(options).nil?
end

def index(context: nil)
def index(options = { context: nil })
context = options[:context]
if context.is_a?(Symbol)
# Context pin group provided
group = groups[context].instance_variable_get(:@store)
Expand All @@ -1114,7 +1115,8 @@ def index(context: nil)
end
end

def mask(context: nil)
def mask(options = { context: nil })
context = options[:context]
index = context.is_a?(Integer) ? context : self.index(context: context)

if index.nil? && context.nil?
Expand All @@ -1130,7 +1132,10 @@ def mask(context: nil)
alias_method :set_mask, :mask
alias_method :smask, :mask

def clear_mask(context: nil, size: nil)
def clear_mask(options = { context: nil, size: nil })
context = options[:context]
size = options[:size]

index = context.is_a?(Integer) ? context : self.index(context: context)

if index.nil? && context.nil?
Expand Down
2 changes: 1 addition & 1 deletion lib/origen/version_string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def pre
alias_method :dev, :pre

def latest?
downcase.orig_equal?('trunk') || downcase.orig_equal?('latest')
downcase.to_s.eql?('trunk') || downcase.to_s.eql?('latest')
end

# Returns true if the version is a timestamp format version number
Expand Down
7 changes: 4 additions & 3 deletions origen.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency "rspec-legacy_formatters", "~>1"
spec.add_runtime_dependency "thor", "~>0.19"
spec.add_runtime_dependency "nanoc", "~>3.7.0"
spec.add_runtime_dependency "kramdown", "~>1.5"
spec.add_runtime_dependency "kramdown", "~>2.4"
spec.add_runtime_dependency "rubocop", "0.30"
# spec.add_runtime_dependency "rubocop"
spec.add_runtime_dependency "coderay", "~>1.1"
spec.add_runtime_dependency "rake", "~>10"
spec.add_runtime_dependency "pry", "~>0.10"
Expand All @@ -50,7 +51,7 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency "highline", "~>1.7"
spec.add_runtime_dependency "dentaku", "~>3"
spec.add_runtime_dependency "colorize", "~> 0.8.1"
spec.add_runtime_dependency 'nokogiri', '>= 1.7.2'
spec.add_runtime_dependency 'cri', '~>2.10.0' # Not required by Origen, but add constrain to avoid Ruby 2.3 requirement
spec.add_runtime_dependency 'nokogiri', '>= 1.11.0'
#spec.add_runtime_dependency 'cri', '~>2.10.0' # Not required by Origen, but add constrain to avoid Ruby 2.3 requirement
spec.add_runtime_dependency 'concurrent-ruby'
end