4706 Commits

Author SHA1 Message Date
Aleksey Kladov
d11a429ded Add CONTRIBUTING.md 2017-09-03 12:47:49 +03:00
bors
8ee43410be Auto merge of #4462 - behnam:book-fixes, r=alexcrichton
[doc/book] Drop reference/policies.md and small fixes

We don't need to put `policies.md` in the book. See
<https://github.com/rust-lang/crates.io/issues/1030> for more.

Renaming `introduction.md` to `index.md` prevents creating two html
files (and URL) for one source.

The rest are small styling issues.

Tracker: <https://github.com/rust-lang/cargo/issues/4040>
2017-09-02 03:02:48 +00:00
Behnam Esfahbod
ff6cbadee6 [doc/book] Drop reference/policies.md and small fixes
We don't need to put `policies.md` in the book. See
<https://github.com/rust-lang/crates.io/issues/1030> for more.

Renaming `introduction.md` to `index.md` prevents creating two html
files (and URL) for one source.

The rest are small styling issues.

Tracker: <https://github.com/rust-lang/cargo/issues/4040>
2017-09-01 18:36:23 -07:00
bors
34c0674a25 Auto merge of #4457 - behnam:book-pub, r=alexcrichton
[doc] Publish book to gh-pages

Export mdBook into `target/doc/book/`, to make it accessible at <http://doc.crates.io/book/>

I have tested the changes on my repo (but when I had this commit on top of the other PR) locally. The result is at <http://code.behnam.es/rust-cargo/book/>.

Tracker: <https://github.com/rust-lang/cargo/issues/4040>
2017-09-01 19:27:55 +00:00
Behnam Esfahbod
b57b66a398 [doc/book] Rename crates-io.md to publishing.md 2017-09-01 10:19:51 -07:00
Behnam Esfahbod
11f144392d [doc] Add back heading to index.md 2017-09-01 10:08:34 -07:00
Behnam Esfahbod
102ab97f80 [doc] Publish book to gh-pages 2017-09-01 10:02:29 -07:00
bors
61ca3022bc Auto merge of #4455 - behnam:book-enh, r=alexcrichton
[doc/book] Add introduction page and other enhancements

Preview: http://code.behnam.es/rust-cargo/book/

* Reorganize files to use folders instead of numbered files. This will allow us to add new sections and pages without breaking a numbering system or the URLs.

* Rename "Cargo In Depth" to "Cargo Reference", as those pages are considered *the* reference for cargo behaviors.

* Add `introduction.md`, as the landing page with the book title and Cargo logo on top.

* Expand `installation.md`: Import install text and links from <https://crates.io/install>, as we
want to drop that page and redirect it to here. (See <https://github.com/rust-lang/crates.io/issues/1029>)

* Sync `SUMMARY.md` titles (and sub-pages lists in section pages) with page titles and fix some wordings and casings.

* Expand Introduction and section pages with some intro text.

* Set lang for some of the code blocks.

* Add `book.toml` to get the title in HTML head title, etc.

Tracker: <https://github.com/rust-lang/cargo/issues/4040>
2017-09-01 16:30:25 +00:00
Behnam Esfahbod
2ad45a563e [doc] Sync back doc/book changes into old docs 2017-08-31 23:52:48 -07:00
Behnam Esfahbod
664f5a1841 [doc/book] Add book.toml 2017-08-31 14:49:30 -07:00
Behnam Esfahbod
21ffd59970 [doc/book] Final touches to introduction.md 2017-08-31 14:49:30 -07:00
Behnam Esfahbod
4c535b65d9 [doc/book] Assign langs to more code blocks 2017-08-31 14:49:30 -07:00
Behnam Esfahbod
3f2d93e3b0 [doc/book] Create dir for book sections 2017-08-31 14:49:30 -07:00
Behnam Esfahbod
79d10021e7 [doc/book] Improve page titles 2017-08-31 14:49:30 -07:00
Behnam Esfahbod
63f37e3f17 [src/doc/book] Add introduction page 2017-08-31 14:49:30 -07:00
Behnam Esfahbod
9ef7b2f4aa [doc/book] Expand installation.md
Import install text and links from <https://crates.io/install>, as we
want to drop that page and redirect it to here.

See <https://github.com/rust-lang/crates.io/issues/1029>
2017-08-31 14:49:30 -07:00
bors
97452de95b Auto merge of #4453 - behnam:book, r=alexcrichton
Import mdBook-based docs and sync

Since we decided to keep the mdBook-based docs in-repo, I have imported the existing converted docs from <https://github.com/istankovic/cargo-book> under `/src/doc/book/` here, and have synced the current docs and the mdBook-based ones manually, file-by-file.

I have created a `MIGRATION_MAP` file, which shows the relationship between old docs and new ones. The first column is the old file, the second column is the canonical location in mdBook, and the rest of columns are globs of other files in mdBook containing content from the old file.

The first and second column of `MIGRATION_MAP` shall later be used to create redirect rules from `doc.crates.io/` to `doc.rust-lang.org/cargo/`.

I will also add a README file to remind everyone to keep these files in sync during the migration.

There are also two or three small wording fixes here, which I'll note inline.

This is a retry of <https://github.com/rust-lang/cargo/pull/4220>.

First step for <https://github.com/rust-lang/cargo/issues/4040>.
2017-08-31 21:08:09 +00:00
bors
f519d3de31 Auto merge of #4447 - lucaskolstad:proc-macro-crates-host-deps-linkage, r=alexcrichton
Add host dependency path via -L for cargo_test.

Proc-macro crates' dependencies in the host dependency directory cannot
be found when running `cargo test` with the `--target {target}` flag
set as reported in #4224. This adds the host dependency directory to the
search path to find those missing dependencies with -L when building tests
and adds a test case that fails before and passes after this patch.

A new function `find_host_deps(..)` is added to accomplish this which can
determine the path of the host dependencies directory from within
`run_doc_tests(..)` where the missing library search path is needed.

Fixes #4224
Fixes #4254

Modeled after a similar patch: a298346d6e8862992be3fd93dd8a6c833cc72719

**Concerns**

The test case seems to require a non-local crate from crates.io to example the failure before this patch. Couldn't make it fail with simply another local subcrate, but if others think it's possible that'd be great. This means that during tests for the cargo project itself that this test case actually downloads and compiles a crate, which I don't think any other tests do and is obviously not ideal and is perhaps even unacceptable. I've used the base64 crate pretty arbitrarily, but which crate it is really doesn't matter to test the case's content. So if anyone knows a tiny or empty crate on crates.io to use instead that'd speed this up and if someone can figure out how to make it fail before this patch is applied without downloading an external crate that would help as well.

Also, I'm not 100% confident about the `find_host_deps(..)` style and whether it's the best way to find the host dependencies directory with just the `TestOptions` and `Compilation` structs available since I'm new to this project. Any comments are appreciated.
2017-08-31 20:26:56 +00:00
Lucas Kolstad
95c6e68f9e Tweak proc_macro test to correctly test case.
Minor change causes the test to actually test the case instead of always
passing regardless of the fix that adds the host dependency directory to
the library search path.
2017-08-31 10:55:19 -07:00
Behnam Esfahbod
bd5ecd43fc [src/doc/book] Use package registry for crates.io 2017-08-31 01:36:04 -07:00
Behnam Esfahbod
3fac7b2f27 [src/doc/book] Fix header casings 2017-08-31 01:35:47 -07:00
Behnam Esfahbod
01aa9e3c7d [src/doc/book] Move a paragraph to cargo-in-depth.md 2017-08-31 01:26:30 -07:00
Behnam Esfahbod
afe693df2e [src/doc/book] Add all sub-chapters to cargo-in-depth.md 2017-08-31 01:07:35 -07:00
Behnam Esfahbod
e6841b9188 [src/doc/book] Drop unused images 2017-08-31 00:53:36 -07:00
Behnam Esfahbod
ec25b8b450 [src/doc] Add README.md 2017-08-30 18:33:32 -07:00
Behnam Esfahbod
0fdd599e87 [src/doc/book] Update SUMMARY.md 2017-08-30 18:19:18 -07:00
Behnam Esfahbod
d7c5a6b626 [src/doc/book] Update 03-01-specifying-dependencies.md from specifying-dependencies.md 2017-08-30 18:16:52 -07:00
Behnam Esfahbod
d431fa271f [src/doc/book] Check 03-08-source-replacement.md 2017-08-30 18:15:26 -07:00
Behnam Esfahbod
055147f900 [src/doc/book] Update 03-10-policies.md from policies.md 2017-08-30 18:14:29 -07:00
Behnam Esfahbod
51be221ed0 [src/doc/book] Check 03-07-pkgid-spec.md 2017-08-30 18:12:51 -07:00
Behnam Esfahbod
917c363416 [src/doc/book] Update 03-02-manifest.md from manifest.md 2017-08-30 18:10:13 -07:00
Behnam Esfahbod
53d549542b [src/doc/book] Apply 01-*.md changes into index.md 2017-08-30 18:09:34 -07:00
Lucas Kolstad
a5d829862e Replace plugins_dylib_path with host_deps_output.
The plugins_dylib_path field on Compilation is removed because it is
identical to host_deps_output, it is only used in one easily replaced
location, and because host_deps_output is a more general name that
includes its new usage location in cargo_test.rs as well while better
matching the corresponding deps_output field.

Also de-indents erroneously indented lines in a test case.
2017-08-30 17:59:23 -07:00
Behnam Esfahbod
582f46c5c3 [src/doc/book] Update guide.md and 02-*.md from guide.md 2017-08-30 17:58:51 -07:00
Behnam Esfahbod
72590a38f2 [src/doc/book] Check faq.md 2017-08-30 17:26:34 -07:00
Behnam Esfahbod
ae7889aa76 [src/doc/book] Update 03-09-external-tools.md from external-tools.md 2017-08-30 17:13:49 -07:00
Behnam Esfahbod
93baf1e5cc [src/doc/book] Update 03-04-environment-variables.md from environment-variables.md 2017-08-30 17:12:06 -07:00
Behnam Esfahbod
0776699ab1 [src/doc/book] Update 03-06-crates-io.md from crates-io.md 2017-08-30 17:09:13 -07:00
Behnam Esfahbod
b8820dec74 [src/doc/book] Update 03-05-build-scripts.md from build-script.md 2017-08-30 17:05:21 -07:00
Behnam Esfahbod
e62845c173 [src/doc/book] Update 03-03-config.md from config.md 2017-08-30 17:00:04 -07:00
Behnam Esfahbod
a442f853db [src/doc/book] Add .gitignore
Using `mdbook init` command.

Also, update `.gitignore` file manually and add a leading slash.
(Upstream fix for mdBook: <https://github.com/azerupi/mdBook/pull/413>)
2017-08-30 16:04:04 -07:00
Behnam Esfahbod
4d590f9543 [src/doc/book] Import from cargo-book repo 2017-08-30 15:38:51 -07:00
Lucas Kolstad
3b5ec888ff Remove find_host_deps and use Compilation field.
This patch removes the addition of the find_host_deps() function by
adding a host_deps_output field to the Compilation struct instead. The
test case is altered to not use an external crate from crates.io but
instead use the Package.publish(..) method.
2017-08-30 15:16:52 -07:00
bors
62f800fd87 Auto merge of #4451 - steveklabnik:relax-rustdoc-tests, r=alexcrichton
relax rustdoc tests

This was asserting on the output directly, rather than just what it contains.

In https://github.com/rust-lang/rust/pull/44138 we are adding deprecations, and so it
breaks these tests.
2017-08-30 15:40:20 +00:00
steveklabnik
b1e8298bc6 Don't use deprecated rustdoc flags in tests
In rust-lang/rust#44138 we are adding deprecations, and so it
breaks these tests.
2017-08-30 11:02:09 -04:00
bors
b52468241e Auto merge of #4440 - nisargthakkar:publish_target, r=alexcrichton
Adding target support to cargo package and cargo publish

Fixing Issue #4012

Same as #4077 but couldn't reopen the PR due to force push after rebasing from master
2017-08-29 17:40:45 +00:00
Nisarg Thakkar
0a4e04ca57 Removing redundant extern 2017-08-29 20:38:02 +05:30
Nisarg Thakkar
ba804bb528 Adding tests for --target with cargo publish and cargo package 2017-08-29 20:17:55 +05:30
Nisarg Thakkar
1c59387983 Adding target support to cargo package and cargo publish 2017-08-29 20:17:55 +05:30
Lucas Kolstad
2b7f37b5a2 Add host dependency path via -L for cargo_test.
Proc-macro crates' dependencies in the host dependency directory cannot
be found when running `cargo test` with the `--target {target}` flag
set. This adds the host dependency directory with -L when building tests
and a test case that fails before and passes after this patch.

A new function find_host_deps(..) is added to accomplish this which can
determine the path of the host dependencies directory from within
run_doc_tests(..) where the missing library search path is needed.

Fixes #4224
Fixes #4254
2017-08-29 04:18:32 -07:00