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

include Cargo.{toml,lock} in rust-src tarball #44076

Merged
merged 2 commits into from
Aug 30, 2017
Merged

Conversation

RalfJung
Copy link
Member

The lock file is interesting because e.g. xargo could use it to build libstd against the same dependencies that were used for the main build. More generally speaking, just documenting in this form which exact dependencies should be used IMHO makes lots of sense.

I added the Cargo.toml mostly because having the lock without the toml feels odd. Of course, the toml contains references to paths that don't actually exist in the rust-src tarball. Not sure if that is considered a problem.

@ishitatsuyuki
Copy link
Contributor

I think the -src tarball is really intended for RLS/racer only, and you should use the full tarball instead if you want to compile something.

@RalfJung
Copy link
Member Author

That's currently not an option, only rust-src is available via rustup.

@eddyb
Copy link
Member

eddyb commented Aug 25, 2017

r? @alexcrichton

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Aug 25, 2017

📌 Commit 8cd4cac has been approved by alexcrichton

@shepmaster shepmaster added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Aug 25, 2017
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Aug 26, 2017
include Cargo.{toml,lock} in rust-src tarball

The lock file is interesting because e.g. xargo could use it to build libstd against the same dependencies that were used for the main build. More generally speaking, just documenting in this form which exact dependencies should be used IMHO makes lots of sense.

I added the Cargo.toml mostly because having the lock without the toml feels odd. Of course, the toml contains references to paths that don't actually exist in the rust-src tarball. Not sure if that is considered a problem.
@ishitatsuyuki
Copy link
Contributor

I think this failed rollup with distcheck.

@RalfJung
Copy link
Member Author

Failure of #44093 seems to be

------------------------------------------
stderr:
------------------------------------------
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
Assertion failed!
Program: C:\projects\rust\build\x86_64-pc-windows-gnu\test\run-make\extern-fn-struct-passing-abi.stage2-x86_64-pc-windows-gnu\test.exe
File: test.c, Line 310
Expression: f1.x == 7.
make: *** [Makefile:5: all] Error 1
------------------------------------------
thread '[run-make] run-make\extern-fn-struct-passing-abi' panicked at 'explicit panic', src\tools\compiletest\src\runtest.rs:2435:8
note: Run with `RUST_BACKTRACE=1` for a backtrace.
failures:
    [run-make] run-make\extern-fn-struct-passing-abi
test result: FAILED. 158 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
thread 'main' panicked at 'Some tests failed', src\tools\compiletest\src\main.rs:322:21

Doesn't look like this one could be the culprit?

@bors
Copy link
Contributor

bors commented Aug 26, 2017

⌛ Testing commit 8cd4cac with merge 5bcdb1635fc49be3b52a462481ab05fe456e4885...

@bors
Copy link
Contributor

bors commented Aug 26, 2017

💔 Test failed - status-travis

@RalfJung
Copy link
Member Author

You are right, there's a distcheck failure:

[01:32:48] Build completed successfully in 1:21:57
[01:32:48] Distcheck rust-src
[01:32:49] error: failed to read `/checkout/obj/build/tmp/distcheck-src/rust-src/lib/rustlib/src/rust/src/bootstrap/Cargo.toml`
[01:32:49] 
[01:32:49] Caused by:
[01:32:49]   No such file or directory (os error 2)

I am not sure why it looks for that file. Is it smart enough to notice that the Cargo.toml I ship contains references to projects that are not included? That would be impressive.

I will restrict this to just ship the lock file, then.

distcheck complains that this file references projects not cotnained in the tarball
@alexcrichton
Copy link
Member

I fear this is taking a turn if we're just shipping a standalone cargo.lock file, how does that even get used? (Cargo has virtually no support for this)

@RalfJung
Copy link
Member Author

I thought what we could do is for Xargo to copy that lock file into the directory it creates for building libstd, next to the Cargo.toml that it puts there. Would that work?

@eddyb
Copy link
Member

eddyb commented Aug 27, 2017

A better question I suppose is why the full source tarball isn't available through rustup, it only has rust-src which is more or less rust-std's debugsource.

EDIT: Can rustup provide enough information to let Xargo download that tarball itself?

@carols10cents carols10cents added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 28, 2017
@alexcrichton
Copy link
Member

@RalfJung yeah I think that'd work, it's just sort of... nonstandard? This is similar to rust-lang/cargo#4353 though, and it at least works for now so seems fine to land!

@bors: r+

@eddyb you may wish to see #41546

@bors
Copy link
Contributor

bors commented Aug 28, 2017

📌 Commit bd24325 has been approved by alexcrichton

@frewsxcv
Copy link
Member

@bors rollup

frewsxcv added a commit to frewsxcv/rust that referenced this pull request Aug 29, 2017
include Cargo.{toml,lock} in rust-src tarball

The lock file is interesting because e.g. xargo could use it to build libstd against the same dependencies that were used for the main build. More generally speaking, just documenting in this form which exact dependencies should be used IMHO makes lots of sense.

I added the Cargo.toml mostly because having the lock without the toml feels odd. Of course, the toml contains references to paths that don't actually exist in the rust-src tarball. Not sure if that is considered a problem.
@frewsxcv
Copy link
Member

I think this caused a failure in the rollup:

@bors r-

@RalfJung
Copy link
Member Author

In the log you linked to, I see

00:06:56] error[E0600]: cannot apply unary operator `!` to type `()`

[00:06:56]    --> /checkout/src/librustc/traits/coherence.rs:143:8

[00:06:56]     |

[00:06:56] 143 |     if !trait_ref_is_local_or_fundamental(tcx, trait_ref) {

[00:06:56]     |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

[00:06:56] 

[00:06:56] error[E0308]: mismatched types

[00:06:56]    --> /checkout/src/librustc/traits/coherence.rs:159:5

[00:06:56]     |

[00:06:56] 158 |                                                          trait_ref: &ty::TraitRef<'tcx>) {

[00:06:56]     |                                                                                          - help: possibly return type missing here?: `-> bool `

[00:06:56] 159 |     trait_ref.def_id.krate == LOCAL_CRATE || tcx.has_attr(trait_ref.def_id, "fundamental")

[00:06:56]     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found bool

[00:06:56]     |

[00:06:56]     = note: expected type `()`

[00:06:56]                found type `bool`

[00:06:56] 

[00:06:56] error[E0308]: mismatched types

[00:06:56]     --> /checkout/src/librustc/traits/select.rs:1097:78

[00:06:56]      |

[00:06:56] 1097 |                                                                              trait_ref) {

[00:06:56]      |                                                                              ^^^^^^^^^ expected reference, found struct `ty::sty::TraitRef`

[00:06:56]      |

[00:06:56]      = note: expected type `&ty::sty::TraitRef<'_>`

[00:06:56]                 found type `ty::sty::TraitRef<'_>`

[00:06:56]      = help: try with `&trait_ref`

[00:06:56] 

[00:06:56] error[E0600]: cannot apply unary operator `!` to type `()`

[00:06:56]     --> /checkout/src/librustc/traits/select.rs:1096:32

[00:06:56]      |

[00:06:56] 1096 |                   let cause = if !coherence::trait_ref_is_local_or_fundamental(self.tcx(),

[00:06:56]      |  ________________________________^

[00:06:56] 1097 | |                                                                              trait_ref) {

[00:06:56]      | |_______________________________________________________________________________________^

[00:06:56] 

[00:07:00] error: aborting due to 4 previous errors

[00:07:00] 

[00:07:00] error: Could not compile `rustc`.

How is that at all related to this PR...?

The rollup PR you mentioned has this failing CI: https://travis-ci.org/rust-lang/rust/jobs/269407559.
The error here is

[00:02:16] test_stamp_path_does_not_exists (__main__.ProgramOutOfDate)

[00:02:16] Return True when the stamp file does not exists ... ok

[00:02:16] 

[00:02:16] ======================================================================

[00:02:16] FAIL: program_config (bootstrap.RustBuild)

[00:02:16] Doctest: bootstrap.RustBuild.program_config

[00:02:16] ----------------------------------------------------------------------

[00:02:16] Traceback (most recent call last):

[00:02:16]   File "/usr/lib/python2.7/doctest.py", line 2226, in runTest

[00:02:16]     raise self.failureException(self.format_failure(new.getvalue()))

[00:02:16] AssertionError: Failed doctest test for bootstrap.RustBuild.program_config

[00:02:16]   File "/checkout/src/bootstrap/bootstrap.py", line 519, in program_config

[00:02:16] 

[00:02:16] ----------------------------------------------------------------------

[00:02:16] File "/checkout/src/bootstrap/bootstrap.py", line 527, in bootstrap.RustBuild.program_config

[00:02:16] Failed example:

[00:02:16]     cargo_path.rstrip(".exe") == os.path.join("/tmp/rust",

[00:02:16]     "bin", "cargo")

[00:02:16] Expected:

[00:02:16]     True

[00:02:16] Got:

[00:02:16]     False

That is in bootstrap, which this PR touches, but that doctest doesn't seem to have to do anything with what I changed.

@RalfJung
Copy link
Member Author

RalfJung commented Aug 29, 2017

Notice that #44149, which does not contain this PR, failed with the same error. #44126 touches doc comments, so maybe that's the one causing the failure? That would not make any sense though...

@frewsxcv
Copy link
Member

Sorry @RalfJung, looks like you're right! I was too focused on the bootstrap section of the Travis log. I'll reapprove this

@bors r=alexcrichton

@bors
Copy link
Contributor

bors commented Aug 29, 2017

📌 Commit bd24325 has been approved by alexcrichton

@RalfJung
Copy link
Member Author

It's all right, and thanks :)

@arielb1 arielb1 added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 29, 2017
arielb1 pushed a commit to arielb1/rust that referenced this pull request Aug 29, 2017
include Cargo.{toml,lock} in rust-src tarball

The lock file is interesting because e.g. xargo could use it to build libstd against the same dependencies that were used for the main build. More generally speaking, just documenting in this form which exact dependencies should be used IMHO makes lots of sense.

I added the Cargo.toml mostly because having the lock without the toml feels odd. Of course, the toml contains references to paths that don't actually exist in the rust-src tarball. Not sure if that is considered a problem.
arielb1 pushed a commit to arielb1/rust that referenced this pull request Aug 29, 2017
include Cargo.{toml,lock} in rust-src tarball

The lock file is interesting because e.g. xargo could use it to build libstd against the same dependencies that were used for the main build. More generally speaking, just documenting in this form which exact dependencies should be used IMHO makes lots of sense.

I added the Cargo.toml mostly because having the lock without the toml feels odd. Of course, the toml contains references to paths that don't actually exist in the rust-src tarball. Not sure if that is considered a problem.
bors added a commit that referenced this pull request Aug 29, 2017
Rollup of 12 pull requests

- Successful merges: #43705, #43778, #43918, #44076, #44117, #44121, #44126, #44134, #44135, #44141, #44144, #44158
- Failed merges:
@bors bors merged commit bd24325 into rust-lang:master Aug 30, 2017
@RalfJung RalfJung deleted the src branch July 10, 2018 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants