-
Notifications
You must be signed in to change notification settings - Fork 2
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
Support non binary files inside rust target directory #3
Comments
what about having something like this? completions:
bash:
- $OUT_DIR/completions/kanidmd.bash
- $OUT_DIR/completions/kanidm_badlist_preprocess.bash
- $OUT_DIR/completions/kanidm.bash I don't think this env var would be available directly for use, but it should be derivable similar to how the edit: or maybe |
This is one of the two ideas that I have considered doing. I actually went the other way around, taken from the changelog: For rust packages, all the files will be searched inside of the output directory (usually target) and, if they don't exist, inside the project directory. This allows rinstall to correctly get files generated by build.rs without adding too much clutter in the install.yml. To force rinstall to get a file in the project directory, use the $PROJECTDIR placeholder. However I had some problems with cargo directory structure and I wasn't able to made upstream change their mind, this is way the development of rinstall have been slowed down in the last months. While OUT_DIR is a good solution, the disadvantage is that the |
what kind of problems? |
The issues have been described here by kanidm developer (@Firstyear): I have also opened a thread in the official Rust Zulip instance: |
ok wow, that sounds impossible to work around on rinstall's side. what about going through another option might be to require printing the value of OUT_DIR in build.rs but that seems bad to require devs to do something |
The issue here is that there could be multiple crates and we don't know their names.
Agreed, advocating in favor of rinstall would be harder with this. |
This is the current setting of outdir in let outdir = PathBuf::from(std::env::var("OUT_DIR").unwrap())
.ancestors()
.nth(3)
.unwrap()
.to_path_buf(); And this is the current
With this configuration, the generated files (completions and man page) are correctly handled by rinstall:
One possible disadvantage is that there could be files or directories with the same name as the the generated files. Since rinstall allows to rename later, temporary names can be used in the I will try again with kanidm, and if it works fine I'd propose to close this issue as fixed. Let me know your thoughts, I am sure that there is something I am missing. |
seems reasonable to me 👍 |
Yeah, cargo really isn't setup to output files for anything 3rd party like shell completions. Which is a bit annoying since cargo is very baked-into rust. |
kanidm is correctly putting completions inside the target directory (
OUT_DIR
), asbuild.rs
shouldn't modify any file outside this directory:rinstall should automatically search for this files inside the
OUT_DIR
. I think it could never happen that the same file is inside both the project target directory and theOUT_DIR
.The text was updated successfully, but these errors were encountered: