Skip to content
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

Add .liquid suffix to all Cargo.toml in the project template #170

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

LukeMathWalker
Copy link
Owner

Some users reported that cargo complains about the Cargo.toml files in the project template when installing the pavexc or pavex CLI from source:

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.

@LukeMathWalker LukeMathWalker merged commit ae3dee6 into main Jan 18, 2024
17 checks passed
@LukeMathWalker LukeMathWalker deleted the fix-liquid branch January 18, 2024 20:25
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.

1 participant