Skip to content

task template: import sqlite3 before pandas so pytest starts in images with an old system libstdc++ - #41

Open
ArjunS07 wants to merge 1 commit into
fix/diff-against-baselinefrom
fix/sqlite-before-pandas
Open

ArjunS07 wants to merge 1 commit into
fix/diff-against-baselinefrom
fix/sqlite-before-pandas

Conversation

@ArjunS07

@ArjunS07 ArjunS07 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Purpose: In some task images, pytest.main raises ImportError: ... libstdc++.so.6: version 'CXXABI_1.3.15' not found (required by .../libicui18n.so.78). The runner then records no tests, and the trial is graded unverified unless snapshots ran. This PR loads sqlite3 before pandas, so the env's libstdc++ is the one in the process.

How it works:

flowchart LR
    A["-p jinja_patch_plugin_pandas"] --> B["import sqlite3: libicu loads the env's libstdc++"]
    B --> C["import pandas"]
    C --> D["pytest-cov imports coverage, which imports sqlite3"]
Loading

Changes:

  1. template/tests/jinja_patch_plugin_pandas.py imports sqlite3 first, inside try.
    • Effect: pytest starts in these images, and the selected tests run.
    • Before: pandas loaded /lib/x86_64-linux-gnu/libstdc++.so.6. The pytest-cov plugin then imported coverage, then sqlite3, and _sqlite3 failed to load. main() caught the exception and wrote strategy: null, changed_files: [].

Verification:

Real image fc-task/geopandas__geopandas__3151:d7542f43e0f2, no network, the oracle patch applied, pytest_runner.py --base <sha> --extra-args "-p jinja_patch_plugin_pandas":

plugin result
before ImportError from _sqlite3, 0 tests (the message is from the runner in #40, which writes it to note)
after strategy: changed-files->tests, 4 test files, 383 passed and 4 skipped with the patch, 382 pass at base, 0 regressed

Notes:

  • Phase 1 oracle records with this symptom: geopandas 3151, 3282, 3296, 3314, 3322 and UXARRAY 877, 1112. Only geopandas 3151 was run here. The others have the same output (strategy: null, no pytest output).
  • Base: #38.

In some task images pandas loads the system libstdc++ first, and the env's libicu (needed by sqlite3, which coverage imports) then fails with CXXABI_1.3.15 not found. pytest.main raised, and the runner recorded no tests.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant