Skip to content

Conversation

@matthewhaynesonline
Copy link
Contributor

@matthewhaynesonline matthewhaynesonline commented Oct 12, 2025

Follow up of #3104 (comment)

Use cargo:: syntax for build instructions per https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script.

Notes

  • This just simply replaces any of the existing cargo: build commands with cargo::.
  • candle-examples/* passes $ cargo check
  • candle-flash-attn and candle-kernels seem to rely on having NVIDIA drivers installed, so I couldn't run $ cargo check (I use a m4 macbook)

Questions

  1. I see a cargo::info build command used (and passes check in candle-examples) but couldn't find reference to it in the docs. When I tried updating the bert binary example to use it instead of cargo::warn that seemed to fail. Should cargo::info be used instead of cargo::warn in the bert binary builder?
Compiling bert-single-file-binary-builder v0.9.1 (/Users/matt/Code/matthewhaynes/candle/candle-examples/bert_single_file_binary_builder)
error: invalid output in build script of `bert-single-file-binary-builder v0.9.1 (/Users/matt/Code/matthewhaynes/candle/candle-examples/bert_single_file_binary_builder)`: `cargo::info=All bert-single-file-binary-builder files already exist, skipping download`
Unknown key: `info`.
See https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script for more information about build script outputs.
  1. I don't think I can build / check candle-flash-attn and candle-kernels on my mac, but CI should ensure I didn't break anything build wise for CUDA - is that right?

@matthewhaynesonline matthewhaynesonline changed the title Update cargo build instructions syntax to use double colon syntax Update cargo build instructions to use double colon syntax Oct 12, 2025
@ivarflakstad
Copy link
Member

  1. I see a cargo::info ...

No documentation because it doesn't exist. Should be cargo::warning if you actually want to display a warning. For example I wouldn't show a warning for downloading files when that is the expected behaviour.

  1. I don't think I can build

I don't think you will be able to break it by just using the correct amount of : in the build script instructions. When the PR is ready I can check on a cuda machine.

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