extendr: doctest fails on Windows with "LINK : fatal error LNK1181: cannot open input file 'R.lib'" when proc_macro = true

(From https://github.com/extendr/extendr/pull/347#issuecomment-1030119516)

Here’s the minimal reproducible example. Note that, if I change proc_macro to false, no error happens.

Cargo.toml

[package]
name = "foo"
version = "0.1.0"
edition = "2021"

[lib]
proc_macro = true

[dependencies]

[dev-dependencies]
extendr-api = { path = "../extendr-api" }

src/lib.rs

/// ```
/// use extendr_api::prelude::*;
/// ```
fn foo() {}

command

cargo test --manifest-path foo/Cargo.toml --target=x86_64-pc-windows-gnu --doc -- --nocapture

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (19 by maintainers)

Most upvoted comments

I agree that we should keep extendr-macros lightweight. The only reason we have extendr-macros is that the system of the crate requires us to do so; it’s never intended to be used solely. So, if a test needs extendr-api, it should be moved to extendr-api.