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

create src/init.c for skeleton #692

Merged
merged 1 commit into from May 10, 2017

Conversation

Projects
None yet
4 participants
@eddelbuettel
Member

eddelbuettel commented May 9, 2017

This lets Rcpp.package.skeleton() create src/init.c (by making the required call).

Should compileAttributes() do that too?

@jjallaire

This comment has been minimized.

Show comment
Hide comment
@jjallaire

jjallaire May 9, 2017

Member

Yes I think compileAttributes should do this as well, however I think it should also insert a preamble (similar to it's other auto-generated files) so that if the user creates their own src/init.c then we don't overwrite it.

Member

jjallaire commented May 9, 2017

Yes I think compileAttributes should do this as well, however I think it should also insert a preamble (similar to it's other auto-generated files) so that if the user creates their own src/init.c then we don't overwrite it.

@eddelbuettel

This comment has been minimized.

Show comment
Hide comment
@eddelbuettel

eddelbuettel May 9, 2017

Member

I think I agree. And if/when it does, we need to remove it from here as well.

Also need to add .registration=TRUE to NAMESPACE as this PR does.

Member

eddelbuettel commented May 9, 2017

I think I agree. And if/when it does, we need to remove it from here as well.

Also need to add .registration=TRUE to NAMESPACE as this PR does.

@codecov-io

This comment has been minimized.

Show comment
Hide comment
@codecov-io

codecov-io May 9, 2017

Codecov Report

Merging #692 into master will decrease coverage by 0.05%.
The diff coverage is 73.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #692      +/-   ##
==========================================
- Coverage   89.77%   89.72%   -0.06%     
==========================================
  Files          66       66              
  Lines        3511     3523      +12     
==========================================
+ Hits         3152     3161       +9     
- Misses        359      362       +3
Impacted Files Coverage Δ
R/Rcpp.package.skeleton.R 83.73% <73.33%> (-0.04%) ⬇️
R/RcppClass.R 77.01% <0%> (-1.15%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update abea6f2...fb27ed3. Read the comment docs.

Codecov Report

Merging #692 into master will decrease coverage by 0.05%.
The diff coverage is 73.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #692      +/-   ##
==========================================
- Coverage   89.77%   89.72%   -0.06%     
==========================================
  Files          66       66              
  Lines        3511     3523      +12     
==========================================
+ Hits         3152     3161       +9     
- Misses        359      362       +3
Impacted Files Coverage Δ
R/Rcpp.package.skeleton.R 83.73% <73.33%> (-0.04%) ⬇️
R/RcppClass.R 77.01% <0%> (-1.15%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update abea6f2...fb27ed3. Read the comment docs.

@eddelbuettel

This comment has been minimized.

Show comment
Hide comment
@eddelbuettel

eddelbuettel May 10, 2017

Member

@jjallaire I only glanced at src/attributes.cpp and R/Attributes.R and I am not sure how we can reuse.
Or should we just duplicate as

 looking for token 
 if not found
      abort 
 else 
      write token 
      append output from `tools::package_native_....()` 
Member

eddelbuettel commented May 10, 2017

@jjallaire I only glanced at src/attributes.cpp and R/Attributes.R and I am not sure how we can reuse.
Or should we just duplicate as

 looking for token 
 if not found
      abort 
 else 
      write token 
      append output from `tools::package_native_....()` 
@jjallaire

This comment has been minimized.

Show comment
Hide comment
@jjallaire

jjallaire May 10, 2017

Member

I can take a look sometime later this week or next. The biggest issue I see is that if users have a file other than init.c which includes a package initialization function we'll be adding another one (which will break their compilation). Note this will happen on their local system rather than on CRAN so it's recoverable, but still ugly. Another possibility would be to scan for package init functions as part of our normal scanning and then only write init.c if there is no package init function.

Member

jjallaire commented May 10, 2017

I can take a look sometime later this week or next. The biggest issue I see is that if users have a file other than init.c which includes a package initialization function we'll be adding another one (which will break their compilation). Note this will happen on their local system rather than on CRAN so it's recoverable, but still ugly. Another possibility would be to scan for package init functions as part of our normal scanning and then only write init.c if there is no package init function.

@eddelbuettel

This comment has been minimized.

Show comment
Hide comment
@eddelbuettel

eddelbuettel May 10, 2017

Member

Point well taken on files not-named init.c. We may well have to scan then. OTOH the good news is that I have been relying on the tools::package_native_routine_registration_skeleton() function for several months now with many uploads, and it just works. So this doesn't seem unsurmountable. Wish I had thought of this fairly clean way of integrating things earlier.

Member

eddelbuettel commented May 10, 2017

Point well taken on files not-named init.c. We may well have to scan then. OTOH the good news is that I have been relying on the tools::package_native_routine_registration_skeleton() function for several months now with many uploads, and it just works. So this doesn't seem unsurmountable. Wish I had thought of this fairly clean way of integrating things earlier.

@eddelbuettel

This comment has been minimized.

Show comment
Hide comment
@eddelbuettel

eddelbuettel May 10, 2017

Member

I'll fold this to tick off another micro-issue.

Member

eddelbuettel commented May 10, 2017

I'll fold this to tick off another micro-issue.

@eddelbuettel eddelbuettel merged commit 4e0f79c into master May 10, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@eddelbuettel eddelbuettel deleted the feature/init_c_in_skeleton branch May 10, 2017

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