Skip to content

New .cargo format forces me to remove .cargo to run cargo generate-lockfile in sources/ #486

Closed
@mikn

Description

@mikn

I recently tried to upgrade to Twoliter 0.8.0 where you changed the format of how you vendor dependencies into the .cargo folder to make it more robust against version changes. Inherently great! But sadly if you've built a kit or a variant that has resulted in a .cargo folder this gets picked up by cargo (I am unsure how to disable it):
https://internals.rust-lang.org/t/problems-of-cargo-config-files-and-possible-solutions/12987/14
rust-lang/cargo#12738

And for me it creates a recursive loop that gives an error like this:

mikn@hal8999 ~/d/m/s/p/b/b/sources ((72abfc6e))> cargo generate-lockfile
error: failed to get `bottlerocket-defaults-helper` as a dependency of package `settings-defaults-metal-dev v0.3.0 (/home/mikn/devel/molnett/src/platform/base/bottlerocket/sources/settings-defaults/metal-dev)`

Caused by:
  failed to load source for dependency `bottlerocket-defaults-helper`

Caused by:
  Unable to update https://github.com/bottlerocket-os/bottlerocket-settings-sdk?tag=bottlerocket-defaults-helper-v0.1.1

Caused by:
  the source git+https://github.com/bottlerocket-os/bottlerocket-settings-sdk?tag=bottlerocket-defaults-helper-v0.1.1 requires a lock file to be present first before it can be
  used against vendored source code

  remove the source replacement configuration, generate a lock file, and then
  restore the source replacement configuration to continue the build
mikn@hal8999 ~/d/m/s/p/b/b/sources ((72abfc6e)) [101]> 

I can fix this by removing the .cargo folder, but I do need to do that every time which feels a bit crufty.

The secondary problem is that it is also a lot more sensitive to races, as now it seems to expect to be allowed to do more in this folder than it was previously. For now I am downgrading to 0.7.3 again.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions