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

GCC plugin compilation should be an explicit dependency of make task #3

Open
akbertram opened this issue Aug 16, 2020 · 0 comments
Open

Comments

@akbertram
Copy link
Member

The GCC-Bridge plugin, a native shared library, is produced by the compilePlugin task of the GCC-Bridge compiler module.

Renjin's gradle-plugin, in turn provides a MakeTask which uses this plugin to 'make' a package's native sources.

Currently, however, the MakeTask consumes the plugin via a project property "gccBridgePlugin" which must be hardcoded by the developer, either in their gradle.properties file, or via a command-line argument -PgccBridgePlugin=/path/to/plugin.so.

This property provides the absolute path to the output of the compilePlugin task, but does not establish any explicit dependency between the two. This means:

  1. Changes to plugin.c do not automatically invalidate the results of package make tasks.
  2. The make task can fail if the compilePlugin task was not previously run.

Ideally, the bridge.so library would be treated as an explicit output of the compilePlugin task, and consumed by the make task an explicit input.

This mechanism should also work if renjin-gradle-plugin is used independently and the renjin project is not part of the composite build. In this case the shared library would need to be downloaded from a repository, or compiled on demand from source. Note that our experience is that bridge.so is not super portable: minor differences in the compilation environment and the runtime environment can lead to segfaults.

What's most important is that the make task should not depend on the gcc-bridge-compiler java library in any way. To do so would require re-running the C/C++/Fortran compilation step every time any change is made to gcc-bridge-runtime or gcc-bridge-compiler, which would frustrate iterative development/testing.

I'm not sure of how best to do this, but the following links may provide ideas:

@akbertram akbertram changed the title GCC plugin should be made an explicit Gradle artifact GCC plugin compilation should be made an explicit dependency of make task Aug 16, 2020
@akbertram akbertram changed the title GCC plugin compilation should be made an explicit dependency of make task GCC plugin compilation should be an explicit dependency of make task Aug 16, 2020
akbertram added a commit that referenced this issue Aug 16, 2020
@akbertram akbertram mentioned this issue Aug 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant