-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
Architecture independent install files support #184
Comments
This change adds support for installing read-only architecture-independent data files.
This should be discussed with cargo upstream see rust-lang/cargo#2729 and rust-lang/cargo#2386 |
I think cargo upstream have consensus that the original cargo doesn't want to install things on system-wide, and puts everything under C ABI libraries typically uses As a owner of the project, it's your call. Feel free to close the issue if this wasn't scope of this project. |
I have no problems in adding Can you provide more information on which are your use-cases? |
Sorry but I might be missing something. Could you elaborate what My usage of |
There is a postponed rfc about it, I might add something along those lines to give enough flexibility. I guess much depends on how early you'd need it. |
It is just a personal project that no public user exists yet so it's not in hurry at all. And also I'm hesitant to touch the upstream cargo project since I'm not so used to Rust yet and probably cannot help much. |
I'll try to get something in place that is more or or less along the lines of the rfc. So something called |
@naokiri |
I'll try to get a prototype ready once I have other internal rework landing :) |
The workspace support seems working so I'd start considering supporting installing arbitrary information. We could add a Example: [package.metadata.capi.install]
# install assets/some_data in in ${prefix}/share/${crate_name}
# install ${OUTDIR}/data/generated_data in ${prefix}/share/${crate_name}
data = {assets=["some_data"], generated="generated_data"}
# install pre-generated headers or headers generated by a non-bindgen generator
include = {assets=["some.h", "header.h"]}
# man pages
man = {...} @naokiri would that work for your purpose? |
My use case is Wasmtime C API, which has pre-generated headers located in |
Yes, it is an open question if it is more ergonomic having While letting you override everything and using the default paths from from the root of the [package.metadata.capi.install]
include = {assets=[{src="{path from the root of the crate}", dst="{path to be appended to ${includedir}}"}]}
I do not see problems in that.
With [package.metadata.capi.install]
include = {assets=[{src="include/*"}, {src="wasm-c-api/include/*"}]} You'd end up with
Does it sound good to you? |
I really like it 👍 In your example, you also include the Just to be sure:
|
That's correct, the |
If everything goes well it could land before or after the workspaces support, depending on when cargo 0.56 gets releases.
I would copy everything in the paths by default. |
Sure, of course! |
The default patterns are: - pre-generated in: `{root_dir}/assets/capi/include/**/*` - generated in: `{out_dir}/capi/include/**/*` See #184
You may try #212 and tell me if it is ergonomic enough see |
The default patterns are: - pre-generated in: `{root_dir}/assets/capi/include/**/*` - generated in: `{out_dir}/capi/include/**/*` See #184
I guess I can add the documentation bits and if @federicomenaquintero is also happy with it cut a release. @naokiri I'd add the support for other files (e.g. data) after some refactor in a following release, help is welcome :) |
@olivierlemasle cargo-c 0.9.0 is out, once wasmtime has support for it please send a PR to update the readme :) |
I want support for installing architecture independent files. For instance, I have a usecase to install configuration file under /usr/local/share/myproject/.
Once datadir is supported, it should be easy to add infodir, mandir, localedir etc other common shared files support.
c.f. https://www.gnu.org/software/make/manual/html_node/Directory-Variables.html
The text was updated successfully, but these errors were encountered: