Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vendor path #353

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

vendor path #353

wants to merge 6 commits into from

Conversation

pachadotdev
Copy link
Contributor

A tidy (as in less noise and just 1 commit) version of #340

As @krlmlr suggested, it might be better to vendor to src/vendor instead of inst

This PR implements that and also a better handling and messages about Makevars

Copy link
Member

@krlmlr krlmlr left a comment

Choose a reason for hiding this comment

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

@DavisVaughan: Any chance you'd consider vendoring into a different directory, perhaps by default? I think the current practice is somewhat dangerous because this makes cpp11 available for all dependants of the package it is vendored into. What's the reasoning behind choosing this path for vendoring?

tests/testthat/test-vendor.R Outdated Show resolved Hide resolved
R/vendor.R Outdated
@@ -9,13 +9,14 @@
#' cpp11 currently installed on your machine.
#'
#' If you choose to vendor the headers you should _remove_ `LinkingTo:
#' cpp11` from your DESCRIPTION.
#' cpp11` from your DESCRIPTION. This is done automatically by this function.
Copy link
Member

Choose a reason for hiding this comment

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

Is this true?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes! I added the changes for that, because I am a dummy


message(paste(
"Makevars and/or Makevars.win should have a line such as",
"'PKG_CPPFLAGS = -I../inst/include'"
Copy link
Member

Choose a reason for hiding this comment

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

Does this now need to show the new path?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that line is added automatically, and uses the path the user wants

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i reallize i never pushed that change, done now

@DavisVaughan
Copy link
Member

DavisVaughan commented Apr 2, 2024

I don't currently have the resources to spend much time on cpp11, but I don't love vendoring in general because it doesn't actually 100% insulate you from cpp11 changes. Previous versions of cpp11 relied on a global R option for the precious list, and that ends up getting shared between, say:

  • Pkg A using vendored cpp11 0.4.5
  • Pkg B using CRAN cpp11 0.4.7

So they aren't fully independent, and if there are changes made to the structure of the thing that gets stored in the global option (which has happened) then whoever sets up the global option first "wins" and can cause the other package to break

@krlmlr
Copy link
Member

krlmlr commented Apr 2, 2024

Interesting. Do you think problems like this are going to resurface?

I've seen very weird behaviors when two cpp11 packages (one of them being duckdb) were used in the same R session. Could have been that.

For duckdb, I don't see a good alternative to vendoring. But if this isn't going to be widely supported, I'm fine with hacking my own solution to move from inst/cpp11 .

@pachadotdev
Copy link
Contributor Author

@krlmlr hi, I re-made the part that edits the DESCRIPTION

1 similar comment
@pachadotdev
Copy link
Contributor Author

@krlmlr hi, I re-made the part that edits the DESCRIPTION

@pachadotdev
Copy link
Contributor Author

pachadotdev commented May 13, 2024

hi @DavisVaughan @krlmlr
I made a small change because I sent another package to CRAN (cpp11armadillo), which was rejected for using path = ".". That issue may eventually affect cpp11.
I have used dir and subdir now :)

@pachadotdev
Copy link
Contributor Author

btw, the only CI that fails is gcc 4.8 because of a bug with the compiler itself

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.

3 participants