Skip to content

cargo vendor misses some files #14034

Open
@Samasaur1

Description

Problem

I'm trying to build this Cargo project with vendored deps. I'm able to build it normally (cargo build), and running cargo vendor exits without an error, but building using the vendored deps fails (cargo build after modifying .cargo/config.toml).

It's pretty clear why it fails to build — cargo vendor hasn't copied the src/generate/templates directory of the tree-sitter-cli dependency, so I see a bunch of errors due to include_str! trying to include nonexistent files.

I'm not a Cargo expert, so I might be missing something, but I didn't see any reason why vendoring the dependencies would
miss this subfolder. Hopefully you can point me in the right direction if there's something obvious I missed.

Steps

  1. git clone https://github.com/andrewtbiehl/kramdown-syntax_tree_sitter
  2. cd kramdown-syntax_tree_sitter/ext/tree_sitter_adapter
  3. RUBY=/path/to/bin/ruby cargo build (observe that this succeeds)
  4. cargo vendor (observe that this appears to succeed)
  5. Modify .cargo/config.toml as directed by the output of cargo vendor
  6. cargo build (observe that this fails)
  7. There will also be no folder vendor/tree-sitter-cli/src/generate/templates, although it does exist in the upstream repo

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.76.0 (c84b36747 2024-01-18)
release: 1.76.0
commit-hash: c84b367471a2db61d2c2c6aab605b14130b8a31b
commit-date: 2024-01-18
host: aarch64-apple-darwin
libgit2: 1.7.1 (sys:0.18.1 vendored)
libcurl: 8.6.0 (sys:0.4.70+curl-8.5.0 system ssl:(SecureTransport) LibreSSL/3.3.6)
ssl: OpenSSL 1.1.1w  11 Sep 2023
os: Mac OS 14.5.0 [64-bit]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bugCommand-vendorE-mediumExperience: MediumS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions