Skip to content

Commit

Permalink
Add .liquid suffix to all Cargo.toml in the project template (#170)
Browse files Browse the repository at this point in the history
Some users reported that `cargo` complains about the Cargo.toml files in
the project template when installing the `pavexc` or `pavex` CLI from
source:

```rust
error: invalid character `{` in package name: `{{crate_name}}_server_sdk`, the first character must be a Unicode XID start character (most letters or `_`)
 --> ../../../../../../../home/[...]/.cargo/git/checkouts/pavex-a9d3253b1c659390/2155773/template/template/{{crate_name}}_server_sdk/Cargo.toml:2:8
  |
2 | name = "{{crate_name}}_server_sdk"
  |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
error: invalid inline table
expected `}`
  --> ../../../../../../../home/[...]/.cargo/git/checkouts/pavex-a9d3253b1c659390/2155773/template/template/{{crate_name}}/Cargo.toml:12:11
   |
12 | pavex = { {{pavex_package_spec}} }
   |           ^
   |
error: invalid inline table
expected `}`
  --> ../../../../../../../home/[...]/.cargo/git/checkouts/pavex-a9d3253b1c659390/2155773/template/template/{{crate_name}}_server/Cargo.toml:12:11
   |
12 | pavex = { {{pavex_package_spec}} }
```

These are warnings, they don't cause the installation to fail.  

Based on my investigation, it might related to `cargo`'s behaviour when
installing from a `git` source: it doesn't let you specify the relative
path to the Cargo.toml of the package you want to install; it scans the
entire repository until it finds a package that matches. Those warnings
might be a byproduct of that scan.
I haven't checked `cargo`'s source code to confirm my theory, but this
is an easy change to make and we can verify if it works.
  • Loading branch information
LukeMathWalker authored Jan 18, 2024
1 parent 27da98b commit ae3dee6
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 0 deletions.
File renamed without changes.
File renamed without changes.

0 comments on commit ae3dee6

Please sign in to comment.