Skip to content

Conversation

SuperCuber
Copy link
Owner

Reverts #118

@SuperCuber SuperCuber changed the title Revert "Generate completions at compile-time" Revert completions with build.rs, generate in CI instead Apr 28, 2023
@SuperCuber
Copy link
Owner Author

@TD-Sky wdyt?

@TD-Sky
Copy link
Contributor

TD-Sky commented Apr 28, 2023

We discussed the following about shell completions:

  1. You don't like tracking generated files,
  2. But newly generated files will break the check of cargo publish
  3. And you wish to keep the check step.

May be Generating shell completions in CI better than doing it in the package building step of various Linux distributions? I'm not so sure. It seems that now it is one of the few answers.

@SuperCuber SuperCuber merged commit d48fba7 into master Apr 28, 2023
@SuperCuber SuperCuber deleted the revert-118-build-completions branch April 28, 2023 17:16
@TD-Sky
Copy link
Contributor

TD-Sky commented Oct 23, 2023

Here is a help for everyone traps into the same problem like us.

As we've seen, the reverted PR failed finally cause build.rs affects the crate publication.

To be honest, I was haunted by this failure until I found the cargo include field which can specify the published files in crate.

I do it in my own crate dagtoc and it runs pretty much perfectly.

You need tow steps:

  1. Ignore completions/ in .gitignore.
  2. Include the files you want to publish in your Cargo.toml.

Then the completions generation won't impact publishing to crates.io .

(@SuperCuber I sent an email to you but it seems that it entered into your recycle bin, so here I am.)

@SuperCuber
Copy link
Owner Author

If we're ignoring completions anyways then it's still done in CI, so might as well keep what works 🤷

Cool that this is possible though :)

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.

2 participants