Skip to content

Conversation

Copy link

Copilot AI commented Dec 17, 2025

In R 4.2, Rf_GetOption1 doesn't correctly reflect changes to the scipen option, causing test_format_options_state_change to fail when format options are queried after options(scipen = 10) is called.

Changes

  • Replace get_option("scipen") with parse_eval_global("getOption('scipen')") in current_format_options()
  • Use R interpreter's getOption() instead of C API to retrieve scipen value

Technical Context

R 4.2 lacks special handling for scipen in Rf_GetOption1 that was added in later versions (r-source@7f20c19). The digits option works correctly via C API and doesn't require changes.

// Before
let scipen: i64 = get_option("scipen").try_into().unwrap_or(0);

// After - use R interpreter for R 4.2 compatibility
let scipen: i64 = harp::parse_eval_global("getOption('scipen')")
    .ok()
    .and_then(|obj| obj.try_into().ok())
    .unwrap_or(0);

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/posit-dev/ark/pulls/987
    • Triggering command: /usr/bin/curl curl -s REDACTED /home/REDACTED/.rustup/toolchains/stable-x86_64-REDACTED-linux-gnu/lib/rustlib/x86_64-REDACTED-linux-gnu/lib/libmemchr-ff20d9e744b5ce29.rlib /home/REDACTED/.rustup/toolchains/stable-x86_64-REDACTED-linux-gnu/lib/rustlib/x86_64-REDACTED-linux-gnu/lib/libaddr2line-05ff42d0bb8bc056.rlib /home/REDACTED/.rustup/toolchains/stable-x86_64-REDACTED-linux-gnu/lib/rustlib/x86_64-REDACTED-linux-gnu/lib/libgimli-9e30a03d9a87a46b.rlib /home/REDACTED/.rustup/toolchains/stable-x86_64-REDACTED-linux-gnu/lib/rustlib/x86_64-REDACTED-linux-gnu/lib/libcfg_if-ca532f729409e986.rlib .5/src/lib.rs /home/REDACTED/.rustup/toolchains/stable-x86_64-REDACTED-linux-gnu/lib/rustlib/x86_64-REDACTED-linux-gnu/lib/libstd_detect-866c9680e50cd51f.rlib /home/REDACTED/.rustup/toolchains/stable-x86_64-REDACTED-linux-gnu/lib/rustlib/x86_64-u�� /home/REDACTED/.rustup/toolchains/stable-x86_64-REDACTED-linux-gnu/lib/rustlib/x86_64-REDACTED-linux-gnu/lib/librustc_std_workspace_alloc-2fb855ef27dbee02.rlib /home/REDACTED/.rustup/toolchains/stable-x86_64-REDACTED-linux-gnu/lib/rustlib/x86_64-REDACTED-linux-gnu/lib/libminiz_oxide-9b8400ec28816bfd.rlib /out�� known-linux-gnu/-D known-linux-gnu/XXH_PRIVATE_API= lib/rustlib/x86_64-REDACTED-linux-gnu/bin/gcc-ld/ld.lld hr-ff20d9e744b5ccc 2line-05ff42d0bb-m64 i-9e30a03d9a87a4/tmp/rustcSv7Q76/symbols.o lib/rustlib/x86_/tmp/cargo-installaZt5wy/release/build/cargo-nextest-2b9e5868b7b210db/build_script_build-2b9e5868b7b210db.build_script_build.68f1b9d09b5679f0-cgu.0.rcgu.o (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Please can you investigate why the test only fails for R 4.2.2 but works fine for later versions? dfalbel seems to point to scipen in the thread: posit-dev#987


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 17, 2025 02:57
Co-authored-by: kv9898 <105025148+kv9898@users.noreply.github.com>
Co-authored-by: kv9898 <105025148+kv9898@users.noreply.github.com>
Copilot AI changed the title [WIP] Investigate test failures in R 4.2.2 Fix scipen option not updating in R 4.2 via Rf_GetOption1 Dec 17, 2025
Copilot AI requested a review from kv9898 December 17, 2025 03:04
@kv9898 kv9898 marked this pull request as ready for review December 17, 2025 03:13
Copy link
Owner

@kv9898 kv9898 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Works on my machine.

@kv9898 kv9898 merged commit c596754 into scipen Dec 17, 2025
@kv9898 kv9898 deleted the copilot/investigate-test-failures branch December 17, 2025 03:14
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.

2 participants