-
Notifications
You must be signed in to change notification settings - Fork 32
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
Build error when using depencies during cargo publish
for lack of Cargo.lock
#32
Comments
As far as I can see this is expected behavior, as |
The particular crate itself is more of an application practically, but the ecosystem (WASM) for which it is built practically requires it to be declared as a library. When a library (I only tested it with verdigris being used nonsentically included into a bin crate, but should be all the same) requests to see depenencies, one of two things can happen:
The steps I'd like to take (but check with you first) are:
|
Hm, doing the second is a lot harder than anticipated -- during build time, the working directory is the crate-being-built (be it in its specified path, or if downloaded in ~/.cargo/registry/src/...). The only way to Cargo.lock would be taking OUT_PATH and stripping it down to above its On the other hand, this really only seems to affect library crates (or those which Cargo treats as such). Given one can get the impression during testing that dependencies work for them, it may be a good idea to break the dependencies feature deliberately in such situations, as it will break later on anyway (when publishing or when used from a different crate that uses it without a local path); I don't know yet how that would be detected reliably. (That would also break things for my actual use case -- not sure yet how to best deal with that). |
Contributes-To: lukaslueg#32
When a built-dependent crate that uses
.set_dependencies(true)
is published, thecargo publish
process builds it in an environment where the Cargo.lock file is not found. This produces mysterious-looking output like:Enabling the backtrace doesn't help -- the information where inside the
write_built_file_with_opts
function the error occurred gets lost; it took me astrace -o .. -ff
to find out which system call in the build script caused the failure.I'm not done with this, still looking into where the file is more precisely; will keep this updated and possibly provide a patch.
The text was updated successfully, but these errors were encountered: