summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* eclass: canonicalize debug-print-function callsDavid Seifert2024-10-081-27/+27
| | | | | Closes: https://github.com/gentoo/gentoo/pull/37652 Signed-off-by: David Seifert <soap@gentoo.org>
* ruby-ng.eclass: drop support for EAPI 6David Seifert2024-10-081-64/+17
| | | | Signed-off-by: David Seifert <soap@gentoo.org>
* ruby-ng.eclass: add global-scope ewarn for deprecated < EAPI 7Sam James2024-09-081-2/+6
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* eclass/ruby-ng.eclass: add ruby30 to removed implementationsHans de Graaff2023-09-231-1/+1
| | | | Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* ruby-ng.eclass: add _ruby_get_use_targets commentSam James2023-06-151-0/+3
| | | | | | | I don't see us adding a non-ruby* target any time soon so this should be fine. Closes: https://github.com/gentoo/gentoo/pull/31428 Signed-off-by: Sam James <sam@gentoo.org>
* ruby-ng.eclass: use shopt directly, not via estack.eclassSam James2023-06-151-3/+4
| | | | | | | | | | | ulm points out that estack.eclass is particularly inefficient (although it'll get slightly better once https://github.com/gentoo/gentoo/pull/31437 is fixed). Let's just manually roll it like llvm.eclass does. Bug: https://bugs.gentoo.org/908465 Signed-off-by: Sam James <sam@gentoo.org>
* ruby-ng.eclass: cater to USE_RUBY conditional callsSam James2023-06-151-4/+36
| | | | | | | | | | | | | | | | | | | Packages may try to restrict their test dependencies to ease bootstrapping/porting if they're not yet available for a newer Ruby implementation by setting USE_RUBY="<some subset of original USE_RUBY>" ruby_add_bdepend ... For example, dev-ruby/parallel does: ``` # Rails isn't yet ruby32-ready in Gentoo USE_RUBY="ruby27 ruby30 ruby31" ruby_add_bdepend " test? ( dev-ruby/activerecord[sqlite] ) ``` This isn't ideal, but we don't have a ruby_gen_cond_dep right now, so cater to this usecase by invalidating the caches we've previously added if we've detected USE_RUBY changed. Signed-off-by: Sam James <sam@gentoo.org>
* ruby-ng.eclass: drop no-op RDEPEND assignmentSam James2023-06-151-1/+0
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* ruby-ng.eclass: use bash testsSam James2023-06-151-2/+2
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* ruby-ng.eclass: use bash +=Sam James2023-06-151-9/+9
| | | | | | Easier to read. Signed-off-by: Sam James <sam@gentoo.org>
* ruby-ng.eclass: optimize: avoid subshells for ruby_implementations_depend, ↵Sam James2023-06-151-8/+28
| | | | | | | | | ruby_get_use_targets We go from 2.5s -> 1.9s to source dev-ruby/*. Bug: https://bugs.gentoo.org/908465 Signed-off-by: Sam James <sam@gentoo.org>
* ruby-ng.eclass: optimize: avoid subshells for _ruby_atoms_samelib*Sam James2023-06-151-28/+29
| | | | | | | | | | | | | - Inline ruby_atoms_samelib (only used by one caller) - Avoid repeated (subshell) calls to _ruby_atoms_samelib_generic by using a result variable instead. We go from 3.5s -> 2.5s to source dev-ruby/*. Thanks to mgorny for the ideas here. Bug: https://bugs.gentoo.org/908465 Signed-off-by: Sam James <sam@gentoo.org>
* ruby-ng.eclass: optimize: avoid subshell for ruby_get_all_implsSam James2023-06-151-10/+13
| | | | | | | | | | | | | | | | | | | | | | | We go from ~4s -> ~3.5s for sourcing dev-ruby/*. For sinatra: ``` $ pk pkg source $(pkg) --repo ~/g/ --bench 5s # before dev-ruby/sinatra-2.2.3::/home/sam/g/: mean: 66.68ms, min: 56.938ms, max: 74.248ms, σ = 4.832ms, N = 75 dev-ruby/sinatra-3.0.6::/home/sam/g/: mean: 73.618ms, min: 60.153ms, max: 77.978ms, σ = 3.195ms, N = 68 dev-ruby/sinatra-3.0.5::/home/sam/g/: mean: 72.069ms, min: 58.736ms, max: 78.223ms, σ = 3.277ms, N = 70 dev-ruby/sinatra-3.0.5-r1::/home/sam/g/: mean: 73.265ms, min: 60.738ms, max: 81.06ms, σ = 3.227ms, N = 69 $ pk pkg source $(pkg) --repo ~/g/ --bench 5s # after dev-ruby/sinatra-3.0.5-r1::/home/sam/g/: mean: 59.677ms, min: 49.141ms, max: 63.282ms, σ = 2.511ms, N = 84 dev-ruby/sinatra-3.0.6::/home/sam/g/: mean: 59.693ms, min: 48.637ms, max: 62.862ms, σ = 2.628ms, N = 84 dev-ruby/sinatra-3.0.5::/home/sam/g/: mean: 56.697ms, min: 46.782ms, max: 60.367ms, σ = 2.822ms, N = 89 dev-ruby/sinatra-2.2.3::/home/sam/g/: mean: 54.915ms, min: 45.832ms, max: 59.513ms, σ = 3.52ms, N = 92 ``` Bug: https://bugs.gentoo.org/908465 Signed-off-by: Sam James <sam@gentoo.org>
* ruby-ng.eclass: optimize: use pattern substitutionSam James2023-06-151-7/+5
| | | | | | | | | | | | | | | | | | | | | | | We can save a little bit (consistently a few ms) by using patsubs in some obvious cases. Not really any difference globally, but for sinatra: ``` $ pk pkg source $(pkg) --repo ~/g/ --bench 5s # before dev-ruby/sinatra-3.0.5::/home/sam/g/: mean: 76.25ms, min: 59.23ms, max: 83.674ms, σ = 4.247ms, N = 66 dev-ruby/sinatra-3.0.5-r1::/home/sam/g/: mean: 77.465ms, min: 61.782ms, max: 85.127ms, σ = 3.592ms, N = 65 dev-ruby/sinatra-3.0.6::/home/sam/g/: mean: 80.192ms, min: 60.922ms, max: 84.951ms, σ = 3.899ms, N = 63 dev-ruby/sinatra-2.2.3::/home/sam/g/: mean: 80.389ms, min: 56.818ms, max: 86.915ms, σ = 4.508ms, N = 63 $ pk pkg source $(pkg) --repo ~/g/ --bench 5s # after dev-ruby/sinatra-2.2.3::/home/sam/g/: mean: 66.68ms, min: 56.938ms, max: 74.248ms, σ = 4.832ms, N = 75 dev-ruby/sinatra-3.0.6::/home/sam/g/: mean: 73.618ms, min: 60.153ms, max: 77.978ms, σ = 3.195ms, N = 68 dev-ruby/sinatra-3.0.5::/home/sam/g/: mean: 72.069ms, min: 58.736ms, max: 78.223ms, σ = 3.277ms, N = 70 dev-ruby/sinatra-3.0.5-r1::/home/sam/g/: mean: 73.265ms, min: 60.738ms, max: 81.06ms, σ = 3.227ms, N = 69 ``` Bug: https://bugs.gentoo.org/908465 Signed-off-by: Sam James <sam@gentoo.org>
* ruby-ng.eclass: optimize: use pattern for old ruby implsSam James2023-06-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Not much improvement on a grand scale, but for dev-ruby/sinatra at least, we get: ``` $ pk pkg source $(pkg) --repo ~/g/ --bench 5s # before dev-ruby/sinatra-3.0.5::/home/sam/g/: mean: 76.25ms, min: 59.23ms, max: 83.674ms, σ = 4.247ms, N = 66 dev-ruby/sinatra-3.0.5-r1::/home/sam/g/: mean: 77.465ms, min: 61.782ms, max: 85.127ms, σ = 3.592ms, N = 65 dev-ruby/sinatra-3.0.6::/home/sam/g/: mean: 80.192ms, min: 60.922ms, max: 84.951ms, σ = 3.899ms, N = 63 dev-ruby/sinatra-2.2.3::/home/sam/g/: mean: 80.389ms, min: 56.818ms, max: 86.915ms, σ = 4.508ms, N = 63 $ pk pkg source $(pkg) --repo ~/g/ --bench 5s # after dev-ruby/sinatra-3.0.6::/home/sam/g/: mean: 72.761ms, min: 58.627ms, max: 76.161ms, σ = 3.276ms, N = 69 dev-ruby/sinatra-3.0.5-r1::/home/sam/g/: mean: 72.967ms, min: 60.127ms, max: 76.75ms, σ = 3.176ms, N = 69 dev-ruby/sinatra-3.0.5::/home/sam/g/: mean: 69.004ms, min: 58.344ms, max: 73.661ms, σ = 3.3ms, N = 73 dev-ruby/sinatra-2.2.3::/home/sam/g/: mean: 71.061ms, min: 55.144ms, max: 74.563ms, σ = 3.848ms, N = 71 ``` A tiny, but seemingly consistent improvement. Thanks to mgorny for the idea. Bug: https://bugs.gentoo.org/908465 Signed-off-by: Sam James <sam@gentoo.org>
* eclass/ruby-ng.eclass: mark ruby27 as removedHans de Graaff2023-05-151-1/+1
| | | | Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* ruby-ng.eclass: error out earlier if RUBY is unsetSam James2023-04-101-0/+7
| | | | | | | | | | | | | | | | This might prevent an ebuild installing no files, but the main aim here is to give a better error message earlier on rather than the classic "Unable to generate gemspec file". The output looks like: ``` * Failed to determine a path for ${RUBY} for USE=ruby_targets_ruby31: * ruby_implementation_command returned an empty RUBY for ruby31 * ERROR: dev-ruby/mercenary-0.4.0-r1::gentoo failed (setup phase): * Could not find RUBY for ruby31. Is dev-lang/ruby:3.1 installed? ``` Signed-off-by: Sam James <sam@gentoo.org>
* ruby-ng.eclass: improve error when no valid Ruby in USE_RUBYSam James2023-03-311-1/+6
| | | | | | | | This means we don't get confusing *DEPEND/REQUIRED_USE errors about it being unparseable and instead just get a straightforward die message indicating the problem. Signed-off-by: Sam James <sam@gentoo.org>
* eclass/ruby-fakegem.eclass: add support for sus test runnerHans de Graaff2023-03-261-0/+25
| | | | Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* ruby-ng.eclass: use eqawarn for test dependency warningSam James2023-03-221-1/+1
| | | | | | | | We already inherit the eqawarn eclass and use it elsewhere in this eclass, so it's available & this then fits the rest of our use. Signed-off-by: Sam James <sam@gentoo.org>
* ruby-ng.eclass: allow non-fatal use of test functionsSam James2023-03-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | die -n will make die become non-fatal if run under 'nonfatal', this is useful if e.g. need to do cleanup. For example, in an ebuild, I need to setup a database, run tests, then always cleanup, which looks like: ``` db_setup nonfatal each_fakegem_test || tests_failed=1 db_cleanup if [[ ${tests_failed} == 1 ]] ; then die "Tests failed! Please see ..." fi ``` Just like we do with e.g. virtualx. This also brings us into line with the Python eclasses. Signed-off-by: Sam James <sam@gentoo.org>
* eclass: standardize prologue/epilogueDavid Seifert2023-03-171-14/+11
| | | | | Closes: https://github.com/gentoo/gentoo/pull/30061 Signed-off-by: David Seifert <soap@gentoo.org>
* ruby-ng.eclass: fix UnquotedVariable of EPREFIXArthur Zamarin2022-09-121-1/+1
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* ruby-ng.eclass: add ruby26 to the list of removed implementationsHans de Graaff2022-08-271-1/+1
| | | | Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* ruby-ng.eclass: Add missing inherit for eqawarnUlrich Müller2022-07-241-1/+1
| | | | Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* ruby-ng.eclass: Drop support for EAPI 5Ulrich Müller2022-07-241-29/+9
| | | | Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* ruby-ng.eclass: replace ebegin with einfo in _ruby_invoke_environmentMike Gilbert2022-07-091-2/+1
| | | | | | | | | | | | | Calling ebegin here makes no sense because it is likely that the called function will also generate output. This will lead to the "[ ok ]" potentially appearing many lines later. It also leads to nested ebegin calls, which make no sense for the same reason. Closes: https://bugs.gentoo.org/839585 Closes: https://bugs.gentoo.org/839588 Signed-off-by: Mike Gilbert <floppym@gentoo.org>
* ruby-ng.eclass: fgrep -> grep -FSam James2022-05-161-1/+1
| | | | | | Deprecated for a while but newer grep emits deprecation warnings. Signed-off-by: Sam James <sam@gentoo.org>
* eclass/ruby-ng.eclass: add missing eendHans de Graaff2022-04-181-0/+1
| | | | Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* ruby-ng.eclass: avoid false-positive for EclassDocMissingVar (inherits)Sam James2022-03-251-5/+4
| | | | | | | It's fine to call inherit multiple times and this avoids a EclassDocMissingVar warning for the variable 'inherits'. Signed-off-by: Sam James <sam@gentoo.org>
* *.eclass: @ECLASS-VARIABLE renamed to @ECLASS_VARIABLEUlrich Müller2022-03-241-5/+5
| | | | | Bug: https://bugs.gentoo.org/835396 Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* ruby-ng.eclass: add debug-print-function callsAnna Vyalkova2022-03-151-1/+51
| | | | | Signed-off-by: Anna Vyalkova <cyber+gentoo@sysrq.in> Signed-off-by: Joonas Niilola <juippis@gentoo.org>
* eclass/ruby-ng.eclass: turn off loud publication banner in cucumberHans de Graaff2021-11-241-1/+1
| | | | | | | Use the environment variable rather than the command-line option for easy backward compatibility with cucumber < 7. Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* eclass/ruby-ng.eclass: ruby25 is no longer availableHans de Graaff2021-09-121-1/+1
| | | | Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* eclass/ruby-ng.eclass: remove EAPI 4 supportHans de Graaff2021-07-181-11/+11
| | | | Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* eclass/ruby-ng.eclass: add EAPI 8 supportHans de Graaff2021-07-181-9/+6
| | | | Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* ruby-ng.eclass: die on errors in ruby_rbconfig_valueHans de Graaff2021-05-011-1/+1
| | | | | | | | | | Die on errors in ruby_rbconfig_value, so that any issues with it cause an immediate stop, rather than returning a nil value which may propagate into installed ebuilds and cause hard-to-diagnose issues. Closes: https://bugs.gentoo.org/776322 Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* eclass/ruby-{ng,fakegem}.eclass: fix did_you_mean issuesHans de Graaff2021-04-281-1/+1
| | | | | | | | | | | | | | | | | | The default gem did_you_mean was unbundled in 2e225cca1aa95b8a5e54cbd855f17dbaf88940d9 to fix bug 758464. Unfortunately ruby 2.7 fails when did_you_mean is not present at all, making it impossible to install this ruby version. 2.6 and 3.0 are not affected by this. With this change we explicitly disable the did_you_mean gem when invoking ruby in the eclasses. Thanks to naota for diagnosing the issue and coming up with a solution. Closes: https://bugs.gentoo.org/705346 Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* ruby-ng.eclass: add @DESCRIPTION as extension of @RETURNSam James2021-03-311-1/+2
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* eclass: [QA] Revert multiple meaningless doc changesMichał Górny2020-12-281-1/+0
| | | | | | | | | | | Revert multiple meaningless eclass documentation changes, notably adding a lot of placeholders and documenting implementation details. These changes were aimed at silencing (valid) documentation warnings without actually providing valuable documentation to the end users. While some of these changes were beneficial, it would take a lot of effort to review them all and the author is unwilling to fix his mistakes. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* eclass/ruby-ng: fixup EclassDocErrorAaron Bauman2020-12-161-0/+1
| | | | Signed-off-by: Aaron Bauman <bman@gentoo.org>
* eclass/ruby-{ng,utils}.eclass: mark ruby24 as removedHans de Graaff2020-08-071-1/+1
| | | | Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* ruby-ng.eclass: Include (-) in RUBY_TARGETS USE-dependenciesMichał Górny2020-01-051-4/+4
| | | | | | | Using 2-style USE dependencies on packages not having the flag in question is forbidden by PMS. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* ruby-ng.eclass: Add RESTRICT="!test? ( test )"Michał Górny2019-11-041-1/+4
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* ruby-ng.eclass: remove emtpy line in documentationHans de Graaff2019-07-281-1/+0
| | | | | | | | This was breaking man page generation. Fixes: https://bugs.gentoo.org/690868 Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* ruby-ng.eclass: remove 2-arg calling of depend methods in EAPI 7Hans de Graaff2019-07-251-6/+20
| | | | | | | No longer allow the deprecated 2 argument calls to the ruby*depend methods in EAPI 7. These are already deprecated for a long time. Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* ruby-ng.eclass: handle BDEPEND for EAPI 7Hans de Graaff2019-07-251-15/+47
| | | | | | | | | | | | | | | | | | | | | | Add support for BDEPEND in EAPI 7. It is not clear how to handle test dependencies since the test framework will need to run on the CBUILD host but the code that needs to run is already cross-compiled for the CHOST. Most likely tests won't work at all in this case. Add test dependencies to BDEPEND in EAPI 7 since this matches most closely to how the test will be executed. Adjust `ruby_add_bdepend` to add to BDEPEND on EAPI 7. This also allows us to keep the name for this method. Add a new `ruby_add_depend` to add to DEPEND in EAPI 7 and newer only. This allows for the rare case where gems need to link to other gem code (e.g. dev-ruby/nokogumbo). Add ruby itself to RDEPEND, BDEPEND, and DEPEND since it is expected to be present in all three cases. Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* ruby-ng.eclass: use ruby_rbconfig_valueHans de Graaff2019-07-251-3/+3
| | | | | | | Consistently use ruby_rbconfig_value to get ruby configuration information. Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* ruby-ng.eclass: make presence of RUBY_PATCHES fatalHans de Graaff2019-07-251-1/+6
| | | | | | | | The eqawarn in EAPI 6 is easy to mis and may lead to patches "silently" not being applied. die on this in EAPI 7 to make this situation more explicit. Signed-off-by: Hans de Graaff <graaff@gentoo.org>
* ruby-ng.eclass: stop inheriting toolchain-funcsHans de Graaff2019-07-251-2/+5
| | | | | | | | Stop inheriting toolchain-funcs in EAPI 7. The eclass does not use this eclass and any ebuild that requires it should inherit it directly instead. Signed-off-by: Hans de Graaff <graaff@gentoo.org>