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

Is there a way to re-use Servo's Cargo.lock and rustc version from a third party project? #15634

Open
paulrouget opened this issue Feb 19, 2017 · 10 comments

Comments

@paulrouget
Copy link
Contributor

@paulrouget paulrouget commented Feb 19, 2017

This issue is part of an effort to improve Servo's embedding story. See https://github.com/paulrouget/servoshell/projects/2

Using libservo in another project requires copying Cargo.lock from Servo, and also make sure we use the same rustc version.

Is there a Cargo mechanism that would improve this?

@paulrouget
Copy link
Contributor Author

@paulrouget paulrouget commented Apr 29, 2017

/cc @metajack

@metajack
Copy link
Contributor

@metajack metajack commented May 2, 2017

cc @aturon

I think rustc and cargo can be solved by rust-lang/rustup#460. I seem to recall there was agreement to do this, but noone had time to implement it yet. The bugs paint a more complicated picture.

As for copying Cargo.lock (or inheriting or whatever) for a library dependency, this is a non-goal of Cargo, but it seems like we need some kind of tooling for this.

@tschneidereit
Copy link
Contributor

@tschneidereit tschneidereit commented Jun 26, 2017

rust-lang/rustup#460 is resolved, so that should only leave the Cargo.lock issue to deal with. @paulrouget Can you confirm that we can now do the rustc override in a useful manner?

@paulrouget
Copy link
Contributor Author

@paulrouget paulrouget commented Jul 4, 2017

Can you confirm that we can now do the rustc override in a useful manner?

Not yet. The override uses rustup. But afaik, servo doesn't use rustup or local cargo.

See #11361 (comment)

@shinglyu
Copy link
Member

@shinglyu shinglyu commented Jul 26, 2017

So what are our alternatives for the Cargo.lock issue?

  • Extend cargo to "inherit" Cargo.lock in sub-directories?
  • Create a script/tool in servo to setup the building environment for a project using it, copying the Cargo.lock and make sure rustup is using same rustc version?

Anything else?

@metajack
Copy link
Contributor

@metajack metajack commented Jul 26, 2017

At the All Hands, @wycats and @aturon seemed willing to add something to Cargo to help with this. I believe the core idea was to extend cargo update with a --lockfile argument.

@shinglyu
Copy link
Member

@shinglyu shinglyu commented Jul 31, 2017

Sound good, is there a meta bug for that? Or should we open one?

@metajack
Copy link
Contributor

@metajack metajack commented Aug 2, 2017

@shinglyu I don't think there is a bug yet. I'll file one.

@paulrouget
Copy link
Contributor Author

@paulrouget paulrouget commented Aug 10, 2017

Things are moving toward the right direction. We will get to a point where libservo can share its lock file and libservo can require a rustup toolchain.

Question: when a third party project wants to use the rustc version of libservo, how do we tell cargo to use libservo's rust toolchain? Would that work automatically? As in, when cargo is called, it will check the dependencies, find the libservo's .rust-toolchain file and make sure it uses that toolchain?

@paulrouget
Copy link
Contributor Author

@paulrouget paulrouget commented Aug 10, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.