Skip to content

Commit 5cf9152

Browse files
authored
Merge pull request #787 from interscript/feat/sweep-ci-gate
ci: enable the ISC corpus sweep as the conformance gate
2 parents 048cca6 + 42ec659 commit 5cf9152

3 files changed

Lines changed: 33 additions & 16 deletions

File tree

‎.github/workflows/rake.yml‎

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@ jobs:
1818
env:
1919
BUNDLE_WITHOUT: "secryst"
2020
SKIP_JS: "1"
21-
# The ISC corpus sweep (ISC_SWEEP=1) stays opt-in until the
22-
# conformance gap it measures is closed: it currently exposes real
23-
# per-map mismatches across the corpus. Run it locally with
24-
# ISC_SWEEP=1 INTERSCRIPT_MAPS_PATH=../maps/maps \
25-
# rspec spec/interscript_spec.rb
26-
# to track that gap; flip it on here once it goes green.
21+
SKIP_PYTHON: "1"
22+
ISC_SWEEP: "1"
23+
# The ISC corpus sweep: every map's own tests through every
24+
# supported compiler (Interpreter, Compiler::Ruby), against the
25+
# ../maps sibling from the monorepo checkout. The conformance gap
26+
# it measured is closed (16,482 examples, 0 failures —
27+
# interscript-ruby#779..#786); this is now the CI conformance
28+
# gate for the corpus. The experimental Python bridge is excluded
29+
# (SKIP_PYTHON) until its own corpus conformance work lands.
2730

2831
steps:
2932
- name: Checkout monorepo
@@ -43,14 +46,26 @@ jobs:
4346

4447
- name: Install Python helper and gems
4548
working-directory: ruby
49+
# bash everywhere: the PYBIN substitution is POSIX shell, which
50+
# PowerShell (the windows default) cannot parse. --break-system-
51+
# packages rides out PEP 668 on Homebrew-managed macos Pythons.
52+
shell: bash
4653
run: |
4754
bundle config set --local with jsexec
4855
bundle install
49-
# PyCall binds whichever libpython it was built against, which
50-
# is not necessarily the python that bare `pip` targets —
51-
# install the regex helper into that interpreter.
52-
PYBIN=$(bundle exec ruby -e 'require "pycall"; v = PyCall.sys.version[/\d+\.\d+/]; puts "python#{v}"')
53-
"$PYBIN" -m pip install regex
56+
if bundle exec ruby -e 'require "pycall"' >/dev/null 2>&1; then
57+
# PyCall binds whichever libpython it was built against, which
58+
# is not necessarily the python that bare `pip` targets —
59+
# install the regex helper into that interpreter.
60+
PYBIN=$(bundle exec ruby -e 'require "pycall"; v = PyCall.sys.version[/\d+\.\d+/]; puts "python#{v}"')
61+
if command -v "$PYBIN" >/dev/null 2>&1; then
62+
"$PYBIN" -m pip install --break-system-packages regex || "$PYBIN" -m pip install regex
63+
else
64+
echo "$PYBIN not on PATH — python helper not installed"
65+
fi
66+
else
67+
echo "pycall not bundled (SKIP_PYTHON) — python helper not installed"
68+
fi
5469
5570
- name: RSpec
5671
working-directory: ruby

‎lib/interscript/stdlib/functions/rababa_adapter.rb‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
class Interscript::Stdlib
22
module Functions
33
class RababaAdapter
4-
@rababa_diacritizer = nil
4+
@rababa_diacritizers = {}
55
@mutex = Mutex.new
66

77
class << self
@@ -18,15 +18,15 @@ def reverse(output, config: nil)
1818
end
1919

2020
def reset_cache
21-
@mutex.synchronize { @rababa_diacritizer = nil }
21+
@mutex.synchronize { @rababa_diacritizers.clear }
2222
end
2323

2424
private
2525

2626
def diacritizer_for(config_key)
2727
require_rababa!
2828
@mutex.synchronize do
29-
@rababa_diacritizer ||= build_diacritizer(config_key)
29+
@rababa_diacritizers[config_key] ||= build_diacritizer(config_key)
3030
end
3131
end
3232

‎spec/stdlib_functions_spec.rb‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@
5656

5757
describe ".rababa (without registered config)" do
5858
it "raises ExternalUtilError naming the missing config" do
59-
expect { described_class.rababa("كتب", config: "default") }.to raise_error(
59+
# A name that cannot be registered: the sweep's load path puts the
60+
# monorepo's rababa-configs in scope, where "default" exists.
61+
expect { described_class.rababa("كتب", config: "no-such-config") }.to raise_error(
6062
Interscript::ExternalUtilError,
61-
/No rababa config registered under 'default'/
63+
/No rababa config registered under 'no-such-config'/
6264
)
6365
end
6466
end

0 commit comments

Comments
 (0)