Commit Graph

1468 Commits

Author SHA1 Message Date
Brian Anderson 84e9c0692a mk: distcheck --uninstall 2014-03-30 21:23:43 -07:00
Brian Anderson 45f2d83d3c dist: Add libbacktrace to source tarballs 2014-03-30 21:13:25 -07:00
Brian Anderson cfb52a5d35 mk: Don't touch config.tmp or tmp/dist as root. Closes #13190
When running `make install` we are touching these files that can't
then be removed later.
2014-03-30 20:15:27 -07:00
Brian Anderson 4aa7a8a5c8 mk: Fix 'make dist' on Mac 2014-03-30 19:14:39 -07:00
bors 02d186ad9b auto merge of #13185 : alexcrichton/rust/osx-pkg, r=brson
This performs a few touch-ups to the OSX installer:

* A rust logo is shown during installation
* The installation happens to /usr/local by default (instead of /)
* A new welcome screen is shown that's slightly more relevant
2014-03-29 01:41:42 -07:00
bors 8610e4a7a0 auto merge of #13168 : jankobler/rust/verify-grammar-02, r=brson
This fixes some problems  with

     make verify-grammar

llnextgen still reports a lot of errors

FYI: My build directory /my-test/build is different from the source directory /my-test/rust.
cd  /my-test/build
/my-test/rust/configure --prefix=/my-test/bin
make
make install
make verify-grammar
2014-03-28 23:01:43 -07:00
Brian Anderson 21617190f2 mk: Restore DESTDIR 2014-03-28 20:55:45 -07:00
Alex Crichton bec333c4bc dist: Tweak the OSX pkg installer
This performs a few touch-ups to the OSX installer:

* A rust logo is shown during installation
* The installation happens to /usr/local by default (instead of /)
* A new welcome screen is shown that's slightly more relevant
2014-03-28 18:29:29 -07:00
Brian Anderson 01d823b4de install: Verify that installed compiler runs
Another sanity check. Can be disabled in `install.sh` via `--disable-verify`
and `configure` with `--disable-verify-install`.
2014-03-28 15:50:32 -07:00
bors 22a04ce286 auto merge of #13174 : brson/rust/dist, r=alexcrichton,huonw 2014-03-27 21:21:56 -07:00
Brian Anderson 476f0e36f0 mk: Fix syntax error in installation target 2014-03-27 20:21:57 -07:00
bors 29436d54ee auto merge of #13142 : alexcrichton/rust/issue-13118, r=brson
The previous dependency calculation was based on an arbitrary set of asterisks
at an arbitrary depth, but using the recursive version should be much more
robust in figuring out what's dependent.
2014-03-27 17:11:58 -07:00
Brian Anderson 080d2104ff mk: Always touch libuv.a
libuv.a always looks out of date to the makefile, causing make to
always descend into the libuv makefile, even when there's nothing
to build.
2014-03-27 14:29:07 -07:00
Jan Kobler e91115feed verify-grammar path to rust.md
When calling

   make verify-grammar

rust.md cannot be found, because the
path to rust.md is missing.

The path is set to:

   $(D)/rust.md

This can only be tested, when llnextgen is installed.

Signed-off-by: Jan Kobler <eng1@koblersystems.de>
2014-03-27 10:20:30 +01:00
Brian Anderson 0f4f786b62 mk: Use 'find' invocation that works on mac 2014-03-26 21:28:56 -07:00
Brian Anderson c060e2e515 install: Don't allow installation over the install files 2014-03-26 18:52:23 -07:00
Brian Anderson 92d0ec2ec7 install: name the bundled manifest 'manifest.in'. Cleanup
The installed manifest is a different file, so they should have
different names. This should prevent various wierd conflicts in the future.
2014-03-26 14:59:08 -07:00
Brian Anderson ce1e48a52b install: Support --libdir and --mandir correctly
This adds a hack to rustc to make it find the library directory
regardless of whether it is named lib/lib64/lib32.
2014-03-25 23:57:39 -07:00
Brian Anderson 380fe976c8 mk: Fix deps for prepare host tools 2014-03-25 21:35:10 -07:00
Brian Anderson 00f7776daa mk: Make nightlyism a configure option 2014-03-25 21:35:10 -07:00
Brian Anderson d252539990 mk: Rename CFG_COMPILER to CFG_COMPILER_HOST_TRIPLE
Much clearer
2014-03-25 21:35:10 -07:00
Brian Anderson 6f9b30c6c1 configure: Make rustlibdir non-configurable
Trying to reduce the complexity of installation
2014-03-25 21:35:10 -07:00
Brian Anderson e509cd6e2b Revert "Revert "mk: Run 'make install' through install.sh""
This reverts commit d62163188a.

Conflicts:
	mk/install.mk
2014-03-25 21:35:10 -07:00
Brian Anderson ff17b7c099 mk: Remove leading './' from manifest entries 2014-03-25 21:35:10 -07:00
Alex Crichton 47093648a7 mk: Use rwildcard to calculate dependent files
The previous dependency calculation was based on an arbitrary set of asterisks
at an arbitrary depth, but using the recursive version should be much more
robust in figuring out what's dependent.

Closes #13118
2014-03-25 15:50:36 -07:00
Brian Anderson 1f35f834be mk: Fix 'make install'. Closes #13128 2014-03-25 15:27:47 -07:00
Brian Anderson 39b48fb883 mk: Make distcheck depend on dist-docs 2014-03-24 14:29:23 -07:00
Brian Anderson d62163188a Revert "mk: Run 'make install' through install.sh"
This reverts commit e93709a911637194835268420e67d768ee19b5df.
2014-03-24 14:29:22 -07:00
Brian Anderson c796f89dbc mk: Fix prepare.mk
The way it was formulated you could only 'prepare' one directory per build.
2014-03-24 14:29:20 -07:00
Brian Anderson 70a10758de mk: Fix a minor UI bug 2014-03-24 14:29:19 -07:00
Brian Anderson a2e8e30b11 mk: Don't rm 'dist' during clean, just its contents
This is not for temporaries now
2014-03-24 14:29:19 -07:00
Brian Anderson ba98689f09 mk: Remove some debug logging 2014-03-24 14:29:19 -07:00
Brian Anderson 169f08dd59 mk: Cleanup dist.mk yet more 2014-03-24 14:29:18 -07:00
Brian Anderson c2e5e62135 mk: Fix some dist deps for parallel builds 2014-03-24 14:29:18 -07:00
Brian Anderson 8694c28762 mk: Run 'make install' through install.sh 2014-03-24 14:29:17 -07:00
Brian Anderson 805d0e53fd mk: Fix location of man pages in prepare.mk 2014-03-24 14:29:17 -07:00
Brian Anderson b8138e0cf2 mk: Wire up everything to dist and distcheck
Fix some misc bugs
2014-03-24 14:29:17 -07:00
Brian Anderson dd7a60e0c3 mk: Fix distcheck
Also, add more distcheck tests
2014-03-24 14:29:17 -07:00
Brian Anderson ae0e47a6eb mk: Add FIXME about making windows installer support all hosts 2014-03-24 14:29:17 -07:00
Brian Anderson 116ebe5af8 mk: Add docs to dist prep
For integrating doc upload into the dist-snap process
2014-03-24 14:29:16 -07:00
Brian Anderson 44842db533 mk: Cleanup version handling and add support for nightly dists 2014-03-24 14:29:16 -07:00
Brian Anderson 669a0554da mk: Make OS X .pkg for all arches 2014-03-24 14:29:16 -07:00
Brian Anderson 4176cf47df mk: Cleanup 2014-03-24 14:29:15 -07:00
Brian Anderson df141e624d mk: Reorder definitions in dist.mk
Just to be more logical, put big headers between different installers
2014-03-24 14:29:15 -07:00
Brian Anderson e30ab71e08 mk: Stop building OS X .pkg as part of 'make dist'
This doesn't work quite right yet (we need to build packages for all hosts)
and I'm not ready to turn on new dist artifacts yet, but I want to start doing
dry runs for 0.10, so I'm turning this off for now.
2014-03-24 14:29:15 -07:00
Brian Anderson 9b7751761b mk: Simplify how prepare.mk, install.mk, and dist.mk deal with stages
The only stage that can be installed from is 2 everywhere but windows,
3 on windows.

Closes #12799
2014-03-19 22:51:12 -07:00
bors d956975e7d auto merge of #12899 : brson/rust/cleanbacktrace, r=alexcrichton
After `make clean` I'm seeing the build break with

```
cp: cannot stat ‘x86_64-unknown-linux-gnu/rt/libbacktrace/.libs/libbacktrace.a’: No such file or directory
```

Deleteing the libbacktrace dir entirely on clean fixes.
2014-03-16 01:36:21 -07:00
Alex Crichton 0015cab1fd Test fixes and rebase conflicts
This commit switches over the backtrace infrastructure from piggy-backing off
the RUST_LOG environment variable to using the RUST_BACKTRACE environment
variable (logging is now disabled in libstd).
2014-03-15 22:56:46 -07:00
Alex Crichton cc6ec8df95 log: Introduce liblog, the old std::logging
This commit moves all logging out of the standard library into an external
crate. This crate is the new crate which is responsible for all logging macros
and logging implementation. A few reasons for this change are:

* The crate map has always been a bit of a code smell among rust programs. It
  has difficulty being loaded on almost all platforms, and it's used almost
  exclusively for logging and only logging. Removing the crate map is one of the
  end goals of this movement.

* The compiler has a fair bit of special support for logging. It has the
  __log_level() expression as well as generating a global word per module
  specifying the log level. This is unfairly favoring the built-in logging
  system, and is much better done purely in libraries instead of the compiler
  itself.

* Initialization of logging is much easier to do if there is no reliance on a
  magical crate map being available to set module log levels.

* If the logging library can be written outside of the standard library, there's
  no reason that it shouldn't be. It's likely that we're not going to build the
  highest quality logging library of all time, so third-party libraries should
  be able to provide just as high-quality logging systems as the default one
  provided in the rust distribution.

With a migration such as this, the change does not come for free. There are some
subtle changes in the behavior of liblog vs the previous logging macros:

* The core change of this migration is that there is no longer a physical
  log-level per module. This concept is still emulated (it is quite useful), but
  there is now only a global log level, not a local one. This global log level
  is a reflection of the maximum of all log levels specified. The previously
  generated logging code looked like:

    if specified_level <= __module_log_level() {
        println!(...)
    }

  The newly generated code looks like:

    if specified_level <= ::log::LOG_LEVEL {
        if ::log::module_enabled(module_path!()) {
            println!(...)
        }
    }

  Notably, the first layer of checking is still intended to be "super fast" in
  that it's just a load of a global word and a compare. The second layer of
  checking is executed to determine if the current module does indeed have
  logging turned on.

  This means that if any module has a debug log level turned on, all modules
  with debug log levels get a little bit slower (they all do more expensive
  dynamic checks to determine if they're turned on or not).

  Semantically, this migration brings no change in this respect, but
  runtime-wise, this will have a perf impact on some code.

* A `RUST_LOG=::help` directive will no longer print out a list of all modules
  that can be logged. This is because the crate map will no longer specify the
  log levels of all modules, so the list of modules is not known. Additionally,
  warnings can no longer be provided if a malformed logging directive was
  supplied.

The new "hello world" for logging looks like:

    #[phase(syntax, link)]
    extern crate log;

    fn main() {
        debug!("Hello, world!");
    }
2014-03-15 22:26:36 -07:00
Brian Anderson 94078f750a mk: Clean libbacktrace w/ gusto
After `make clean' I'm seeing the build break with

```
cp: cannot stat ‘x86_64-unknown-linux-gnu/rt/libbacktrace/.libs/libbacktrace.a’: No such file or directory
```

Deleteing the libbacktrace dir entirely on clean fixes.
2014-03-15 17:48:04 -07:00
bors fc7a112808 auto merge of #12896 : alexcrichton/rust/goodbye-extra, r=brson
This commit shreds all remnants of libextra from the compiler and standard
distribution. Two modules, c_vec/tempfile, were moved into libstd after some
cleanup, and the other modules were moved to separate crates as seen fit.

Closes #8784
Closes #12413
Closes #12576
2014-03-14 23:11:31 -07:00
Huon Wilson 3d6c28acd0 docs: begin a "low-level & unsafe code" guide.
This aims to cover the basics of writing safe unsafe code. At the moment
it is just designed to be a better place for the `asm!()` docs than the
detailed release notes wiki page, and I took the time to write up some
other things.

More examples are needed, especially of things that can subtly go wrong;
and vast areas of `unsafe`-ty aren't covered, e.g. `static mut`s and
thread-safety in general.
2014-03-15 13:51:53 +11:00
Alex Crichton 58e4ab2b33 extra: Put the nail in the coffin, delete libextra
This commit shreds all remnants of libextra from the compiler and standard
distribution. Two modules, c_vec/tempfile, were moved into libstd after some
cleanup, and the other modules were moved to separate crates as seen fit.

Closes #8784
Closes #12413
Closes #12576
2014-03-14 13:59:02 -07:00
bors 6ca57736cc auto merge of #12852 : itdaniher/rust/master, r=alexcrichton
This enables the lowering of llvm 64b intrinsics to hardware ops, resolving issues around `__kernel_cmpxchg64` on older kernels on ARM devices, and also enables use of the hardware floating point unit, resolving https://github.com/mozilla/rust/issues/10482.
2014-03-13 08:26:40 -07:00
bors 12b2607572 auto merge of #12602 : alexcrichton/rust/backtrace, r=brson
Whenever a failure happens, if a program is run with
`RUST_LOG=std::rt::backtrace` a backtrace will be printed to the task's stderr
handle. Stack traces are uncondtionally printed on double-failure and
rtabort!().

This ended up having a nontrivial implementation, and here's some highlights of
it:

* We're bundling libbacktrace for everything but OSX and Windows
* We use libgcc_s and its libunwind apis to get a backtrace of instruction
  pointers
* On OSX we use dladdr() to go from an instruction pointer to a symbol
* On unix that isn't OSX, we use libbacktrace to get symbols
* Windows, as usual, has an entirely separate implementation

Lots more fun details and comments can be found in the source itself.

Closes #10128
2014-03-13 01:11:39 -07:00
Alex Crichton 829df69f9f Add basic backtrace functionality
Whenever a failure happens, if a program is run with
`RUST_LOG=std::rt::backtrace` a backtrace will be printed to the task's stderr
handle. Stack traces are uncondtionally printed on double-failure and
rtabort!().

This ended up having a nontrivial implementation, and here's some highlights of
it:

* We're bundling libbacktrace for everything but OSX and Windows
* We use libgcc_s and its libunwind apis to get a backtrace of instruction
  pointers
* On OSX we use dladdr() to go from an instruction pointer to a symbol
* On unix that isn't OSX, we use libbacktrace to get symbols
* Windows, as usual, has an entirely separate implementation

Lots more fun details and comments can be found in the source itself.

Closes #10128
2014-03-13 00:24:20 -07:00
Alex Crichton 3f2434eee3 Test fixes from rolling up PRs
Closes #12803 (std: Relax an assertion in oneshot selection) r=brson
Closes #12818 (green: Fix a scheduler assertion on yielding) r=brson
Closes #12819 (doc: discuss try! in std::io) r=alexcrichton
Closes #12820 (Use generic impls for `Hash`) r=alexcrichton
Closes #12826 (Remove remaining nolink usages) r=alexcrichton
Closes #12835 (Emacs: always jump the cursor if needed on indent) r=brson
Closes #12838 (Json method cleanup) r=alexcrichton
Closes #12843 (rustdoc: whitelist the headers that get a § on hover) r=alexcrichton
Closes #12844 (docs: add two unlisted libraries to the index page) r=pnkfelix
Closes #12846 (Added a test that checks that unary structs can be mutably borrowed) r=sfackler
Closes #12847 (mk: Fix warnings about duplicated rules) r=nmatsakis
2014-03-12 15:01:27 -07:00
Alex Crichton 1a7e55f4f5 mk: Fix warnings about duplicated rules
The footer.tex rule didn't depend on $(1) of the macro it was being defined in,
so it was getting duplicated, causing many warnings.
2014-03-12 15:01:25 -07:00
Ian Daniher f568720c99 enable mutex lowering and hardware floating point on gnueabihf. closes #10482 2014-03-12 16:55:28 -04:00
Huon Wilson 6fa4bbeed4 std: Move rand to librand.
This functionality is not super-core and so doesn't need to be included
in std. It's possible that std may need rand (it does a little bit now,
for io::test) in which case the functionality required could be moved to
a secret hidden module and reexposed by librand.

Unfortunately, using #[deprecated] here is hard: there's too much to
mock to make it feasible, since we have to ensure that programs still
typecheck to reach the linting phase.
2014-03-12 11:31:05 +11:00
bors 74bfa7108a auto merge of #12783 : adrientetar/rust/more-docs, r=alexcrichton
- remove `node.js` dep., it has no effect as of #12747 (1)
- switch between LaTeX compilers, some cleanups
- CSS: fixup the print stylesheet, refactor highlighting code (2)

(1): `prep.js` outputs its own HTML directives, which `pandoc` cannot recognize when converting the document into LaTeX (this is why the PDF docs have never been highlighted as of now).

Note that if we were to add the `.rust` class to snippets, we could probably use pandoc's native highlighting capatibilities i.e. Kate ([here is](http://adrientetar.github.io/rust-tuts/tutorial/tutorial.pdf) an example of that).

(2): the only real highlighting change is for lifetimes which are now brown instead of red, the rest is just refactor of twos shades of red that look the same.
Also I made numbers highlighting for src in rustdoc a tint more clear so that it is less bothering.

@alexcrichton, @huonw

Closes #9873. Closes #12788.
2014-03-11 12:36:58 -07:00
Adrien Tétar 840a2701ac doc: remove outdated tutorial entry, restore removed Makefile entries 2014-03-11 17:56:40 +01:00
Adrien Tétar 7ec1eb8ab3 doc: auto-generate LaTeX includes 2014-03-11 17:56:32 +01:00
bors b63cd004fc auto merge of #12793 : brson/rust/installer, r=alexcrichton
Work towards #9876.

Several minor things here:
  * Fix the `need_ok` function in `configure`
  * Install man pages with non-executable permissions
  * Use the correct directory for man pages when installing (this was a recent regression)
  * Put all distributables in a new `dist/` directory in the build directory (there are soon to be significantly more of these)

Finally, this also creates a new, more precise way to install and uninstall Rust's files, the `install.sh` script, and creates a build target (currently `dist-tar-bins`) that creates a binary tarball containing all the installable files, boilerplate and license docs, and `install.sh`.

This binary tarball is the lowest-common denominator way to install Rust on Unix. We'll use it as the default installer on Linux (OS X will use .pkg).

## How `install.sh` works

* First, the makefiles (`prepare.mk` and `dist.mk`) put all the stuff that needs to be installed in a new directory in `dist/`.
* Then it puts `install.sh` in that same directory and a list of all the files to install at `rustlib/manifest`.
* Then the directory can be packaged and distributed.
* When `install.sh` runs it does some sanity checking then copies everything in the manifest to the install prefix, then copies the manifest as well.
* When `install.sh` runs again in the future it first looks for the existing manifest at the install prefix, and if it exists deletes everything in it. This is how the core distribution is upgraded - cargo is responsible for the rest.
* `install.sh --uninstall` will uninstall Rust

## Future work:

  * Modify `install.sh` to accept `--man-dir` etc
  * Rewrite `install.mk` to delegate to `install.sh`
  * Investigate how `install.sh` does or doesn't work with .pkg on Mac
  * Modify `dist.mk` to create `.pkg` files for all hosts
  * Possibly use [makeself](http://www.megastep.org/makeself/) to create self-extracting installers
  * Modify dist-snap bots run on mac as well, uploading binary tarballs and .pkg files for the four combos of linux, mac, x86, and x86_64.
  * Adjust build system to be able to augment versions with '-nightly'
  * Adjust build system to name dist artifacts without version numbers e.g. `rust-nightly-...pkg`. This is so we don't leave a huge trail of old nightly binaries on S3 - they just get overwritten.
  * Create new dist-nightly builder
  * Give the build master a new cron job to push to dist-nightly every night
  * Add docs to distributables
  * Update README.md to reflect the new reality
  * Modernize the website to promote new installers
2014-03-10 22:42:02 -07:00
Douglas Young a38e14871a Implement hexadecimal floating point literals via a syntax extension
closes #1433
2014-03-10 22:36:56 +00:00
Brian Anderson 364d4ad1e5 mk: Put all distribution artifacts in dist/
Also, add license docs to installers
2014-03-09 14:17:27 -07:00
Brian Anderson 5e66af6bcc mk: forcibly delete dest dir when PREPARE_CLEAN 2014-03-09 14:17:27 -07:00
Brian Anderson b2eef52ce3 mk: Tweak the status messages for prepare.mk to say 'prepare', not 'install' 2014-03-09 14:17:27 -07:00
Brian Anderson e302bbe635 mk: Use the correct permissions for man pages 2014-03-09 14:17:27 -07:00
Brian Anderson 67ebf8abdf mk: dist-installer builds a binary installer 2014-03-09 14:17:26 -07:00
Brian Anderson 111137b5f5 mk: Optionally clean the destination when preparing install image 2014-03-09 14:17:26 -07:00
Brian Anderson c8bc65f19f mk: Put man pages in correct directory 2014-03-09 14:17:26 -07:00
Adrien Tétar 9eadcacdd7 doc: have a real switch b/w LaTeX compilers 2014-03-09 18:44:59 +01:00
Adrien Tétar 862acedf51 doc: remove node.js dependency
`prep.js` outputs its own HTML directives, which `pandoc` cannot
recognize when converting the document into LaTeX (this is why the
PDF docs have never been highlighted as of now).

Note that if we were to add the `.rust` class to snippets, we could
probably use pandoc's native highlighting capatibilities i.e. Kate.
2014-03-09 13:45:36 +01:00
Huon Wilson b4815ad1ba mk: only build PDFs of the manual and tutorial.
This restores the old behaviour (as compared to building PDF versions of
all standalone docs), because some of the guides use unicode characters,
which seems to make pdftex unhappy.
2014-03-09 20:59:43 +11:00
Huon Wilson bb8ac2159f docs: render rustdoc docs with rustdoc, hack around sundown code-fence
parsing limitations.

Sundown parses

    ```
    ~~~

as a valid codeblock (i.e. mismatching delimiters), which made using
rustdoc on its own documentation impossible (since it used nested
codeblocks to demonstrate how testable codesnippets worked).

This modifies those snippets so that they're delimited by indentation,
but this then means they're tested by `rustdoc --test` & rendered as
Rust code (because there's no way to add `notrust` to
indentation-delimited code blocks). A comment is added to stop the
compiler reading the text too closely, but this unfortunately has to be
visible in the final docs, since that's the text on which the
highlighting happens.
2014-03-09 20:59:43 +11:00
Huon Wilson 3c4ff1b872 mk: rename `check-...-doc-<crate>` to `check-...-doc-crate-<crate>`.
E.g. this stops check-...-doc rules for `rustdoc.md` and `librustdoc`
from stamping on each other, so that they are correctly built and
tested. (Previously only the rustdoc crate was tested.)
2014-03-09 19:34:40 +11:00
Huon Wilson f7833215b0 mk: rewrite the documentation handling.
This converts it to be very similar to crates.mk, with a single list of
the documentation items creating all the necessary bits and pieces.

Changes include:
- rustdoc is used to render HTML & test standalone docs
- documentation building now obeys NO_REBUILD=1
- testing standalone docs now obeys NO_REBUILD=1
- L10N is slightly less broken (in particular, it shares dependencies
  and code with the rest of the code)
- PDFs can be built for all documentation items, not just tutorial and
  manual
- removes the obsolete & unused extract-tests.py script
- adjust the CSS for standalone docs to use the rustdoc syntax
  highlighting
2014-03-09 19:34:40 +11:00
Kang Seonghoon 1c52c81846 fix typos with with repeated words, just like this sentence. 2014-03-06 20:19:14 +09:00
Alex Crichton ec57db083f rustc: Add the concept of a Strict Version Hash
This new SVH is used to uniquely identify all crates as a snapshot in time of
their ABI/API/publicly reachable state. This current calculation is just a hash
of the entire crate's AST. This is obviously incorrect, but it is currently the
reality for today.

This change threads through the new Svh structure which originates from crate
dependencies. The concept of crate id hash is preserved to provide efficient
matching on filenames for crate loading. The inspected hash once crate metadata
is opened has been changed to use the new Svh.

The goal of this hash is to identify when upstream crates have changed but
downstream crates have not been recompiled. This will prevent the def-id drift
problem where upstream crates were recompiled, thereby changing their metadata,
but downstream crates were not recompiled.

In the future this hash can be expanded to exclude contents of the AST like doc
comments, but limitations in the compiler prevent this change from being made at
this time.

Closes #10207
2014-02-28 10:48:04 -08:00
Brian Leibig 4d4ccb5d81 Make OS X installer build from /tmp/dist/pkgroot, and have it be part of the 'make dist' target 2014-02-27 19:59:02 -08:00
Brian Leibig bbec2c54ed Add new target 'make dist-osx' to create a .pkg installer for OS X 2014-02-27 19:59:02 -08:00
Alex Crichton 40ab198356 rustc: Use libnative for the compiler
The compiler itself doesn't necessarily need any features of green threading
such as spawning tasks and lots of I/O, so libnative is slightly more
appropriate for rustc to use itself.

This should also help the rusti bot which is currently incompatible with libuv.
2014-02-27 12:03:58 -08:00
bors 34a224f4a1 auto merge of #12530 : alexcrichton/rust/make-check-no-rpath, r=brson
This involves passing through LD_LIBRARY_PATH through more places, specifically
in the compiletest, run-make, and doctest runners.
2014-02-25 07:56:35 -08:00
bors 4bc7672335 auto merge of #12465 : huonw/rust/notidy, r=brson
tidy has some limitations (e.g. the "checked in binaries" check doesn't
and can't actually check git), and so it's useful to run tests without
running tidy occasionally.
2014-02-24 17:51:59 -08:00
bors 994b48cf52 auto merge of #12453 : alexcrichton/rust/move-json, r=brson
This also inverts the dependency between libserialize and libcollections.

cc #8784
2014-02-24 15:57:13 -08:00
Alex Crichton 6485917d7c Move extra::json to libserialize
This also inverts the dependency between libserialize and libcollections.

cc #8784
2014-02-24 09:51:39 -08:00
Huon Wilson 06e3e63c90 flate: return CVec<u8> rather than copying into a new vector.
This trades an O(n) allocation + memcpy for a O(1) proc allocation (for
the destructor). Most users only need &[u8] anyway (all of the users in
the main repo), and so this offers large gains.
2014-02-24 01:15:39 +11:00
Alex Crichton 2a14e084cf Move std::{trie, hashmap} to libcollections
These two containers are indeed collections, so their place is in
libcollections, not in libstd. There will always be a hash map as part of the
standard distribution of Rust, but by moving it out of the standard library it
makes libstd that much more portable to more platforms and environments.

This conveniently also removes the stuttering of 'std::hashmap::HashMap',
although 'collections::HashMap' is only one character shorter.
2014-02-23 00:35:11 -08:00
bors 4995a85f40 auto merge of #12448 : alexcrichton/rust/smaller-rust, r=brson
Two optimizations:

1. Compress `foo.bc` in each rlib with `flate`. These are just taking up space and are only used with LTO, no need for LTO to be speedy.
2. Stop install `librustc.rlib` and friends, this is a *huge* source of bloat. There's no need for us to install static libraries for these components.

cc #12440
2014-02-22 17:46:53 -08:00
bors f764d477eb auto merge of #12433 : alexcrichton/rust/fix-some-config-things, r=brson
These are mostly centered around using an external LLVM (notably 3.5)
2014-02-22 05:16:51 -08:00
Huon Wilson abde5ed011 mk: restore check-notidy.
tidy has some limitations (e.g. the "checked in binaries" check doesn't
and can't actually check git), and so it's useful to run tests without
running tidy occasionally.
2014-02-22 20:18:29 +11:00
Alex Crichton e26ba3605a mk: Get "make check" passing with --disable-rpath
This involves passing through LD_LIBRARY_PATH through more places, specifically
in the compiletest, run-make, and doctest runners.
2014-02-21 16:35:05 -08:00
Alex Crichton 3cf0b9bd11 mk: Don't install host rlibs
You rarely want to statically link against librustc and friends, so there's no
real reason to install the rlib version of these libraries, especially because
the rlibs are massive.
2014-02-21 10:55:30 -08:00
Arcterus 66f93291ec Move time out of extra (cc #8784) 2014-02-21 07:44:11 -08:00
Alex Crichton 6d79ed1915 mk: Fix --llvm-root finding tools
LLVM's tools are not contained in the local directory if --llvm-root is used by
the ./configure script. This fixes the installation path to be the root provided
by --llvm-root.
2014-02-20 18:07:33 -08:00
bors 882c25fa2d auto merge of #12398 : alexcrichton/rust/rlibs-and-dylibs-2, r=cmr
The new methodology can be found in the re-worded comment, but the gist of it is
that -C prefer-dynamic doesn't turn off static linkage. The error messages
should also be a little more sane now.

Closes #12133
2014-02-20 04:31:49 -08:00
Liigo Zhuang 53b9d1a324 move extra::test to libtest 2014-02-20 16:03:58 +08:00
Alex Crichton 35c6e22fab Tweak how preference factors into linkage
The new methodology can be found in the re-worded comment, but the gist of it is
that -C prefer-dynamic doesn't turn off static linkage. The error messages
should also be a little more sane now.

Closes #12133
2014-02-19 08:33:08 -08:00
Virgile Andreani ece12d8da6 mk: Fix the regexp of SHOW_DOCS
The tag marks were missing, and `make tips` didn't work.
2014-02-18 11:53:23 +01:00
Derek Guenther b609d57b02 Added more scripts to tidy check 2014-02-17 10:36:47 -06:00
bors 57d273f65e auto merge of #12284 : brson/rust/install, r=alexcrichton
Work toward #9876.

This adds `prepare.mk`, which is simply a more heavily-parameterized `install.mk`, then uses `prepare` to implement both `install` and the windows installer (`dist`). Smoke tested on both Linux and Windows.
2014-02-17 03:26:51 -08:00
Brian Anderson 2b64cb294c Address review feedback 2014-02-16 17:36:43 -08:00
Brian Anderson 58678dc229 mk: Fix typo, NO_MAKEFILE_DEPS -> NO_MKFILE_DEPS 2014-02-15 23:12:56 -08:00
Brian Anderson 109673f368 mk: Remove check-notidy, check-full, check-test
Mostly useless
2014-02-15 23:11:56 -08:00
Luqman Aden 615536a265 mk: Remove old flags to llc for arm. 2014-02-15 20:08:33 -05:00
Brian Anderson 508cb29dc4 mk: Base the windows dist target on prepare.mk 2014-02-15 14:18:00 -08:00
Brian Anderson 8f2bee2117 mk: Fix a dist bug
Fallout from moving doc/ to src/doc
2014-02-15 14:18:00 -08:00
Brian Anderson 9cd96e4f02 mk: Base the install target on prepare.mk 2014-02-15 14:18:00 -08:00
Brian Anderson 4cd8bdc969 mk: Add prepare.mk
This is a slightly more generic rewrite of install.mk. Currently
used for nothing, but we'll base all the binary distributables off it.
2014-02-15 14:17:57 -08:00
Brian Anderson 8d4b675ced mk: Address review feedback 2014-02-14 19:17:50 -08:00
Brian Anderson 24915c84e0 mk: Move version info to top of main.mk
Just so it's easier to find.
2014-02-14 17:45:54 -08:00
Brian Anderson 334af011f0 mk: Improve build system help commands 2014-02-14 17:45:54 -08:00
Brian Anderson ab17f445fe mk: Add NO_MKFILE_DEPS for turning off rebuild from makefile changes 2014-02-14 17:45:54 -08:00
Brian Anderson 2852fea61e mk: Move most of Makefile.in to .mk files
Because the build system treats Makefile.in and the .mk files slightly
differently (.in is copied, .mk are included), this makes the system
more uniform. Fewer build system changes will require a complete
reconfigure.
2014-02-14 17:45:54 -08:00
bors 3f717bbe96 auto merge of #12267 : alexcrichton/rust/rollup, r=alexcrichton
The last commit has the closed PRs
2014-02-14 12:21:51 -08:00
Alex Crichton 8694fd1e96 Add MKFILE_DEPS to compiler-rt target
Currently when you run `make -jN` it's likely that you'll remove compiler-rt and
then it won't get cp'd back into the right place. I believe the reason for this
is that the compiler-rt library target never got updated so make decided it
never needed to copy the files back into place. The files were all there at the
beginning of `make`, but then we may clean out the stage0 versions if we unzip
the snapshot again.
2014-02-14 10:46:19 -08:00
HeroesGrave 11b2515f0f Removed libextra dependency from libsyntax. 2014-02-14 07:47:31 -08:00
bors 92c5738aae auto merge of #12207 : alexcrichton/rust/up-llvm, r=sfackler
Includes an upstream commit by pcwalton to improve codegen of our enums getting
moved around.

This also introduces a new commit on top of our stack of patches to fix a mingw32 build issue. I have submitted the patch upstream: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140210/204653.html

I verified that this builds on the try bots, which amazes me because I think that c++11 is turned on now, but I guess we're still lucky!

Closes #10613 (pcwalton's patch landed)
Closes #11992 (llvm has removed these options)
2014-02-14 07:26:40 -08:00
Alex Crichton 804955f79a Upgrade LLVM
Includes an upstream commit by pcwalton to improve codegen of our enums getting
moved around.
2014-02-14 07:22:49 -08:00
bors d40b537405 auto merge of #12192 : luqmana/rust/fix-cross, r=alexcrichton
Fix some fall out from the big command line option changes.
2014-02-14 01:41:46 -08:00
Alex Crichton 301ff0c2df Remove two allocations from spawning a green task
Two unfortunate allocations were wrapping a proc() in a proc() with
GreenTask::build_start_wrapper, and then boxing this proc in a ~proc() inside of
Context::new(). Both of these allocations were a direct result from two
conditions:

1. The Context::new() function has a nice api of taking a procedure argument to
   start up a new context with. This inherently required an allocation by
   build_start_wrapper because extra code needed to be run around the edges of a
   user-provided proc() for a new task.

2. The initial bootstrap code only understood how to pass one argument to the
   next function. By modifying the assembly and entry points to understand more
   than one argument, more information is passed through in registers instead of
   allocating a pointer-sized context.

This is sadly where I end up throwing mips under a bus because I have no idea
what's going on in the mips context switching code and don't know how to modify
it.

Closes #7767
cc #11389
2014-02-13 20:31:17 -08:00
Luqman Aden ffdda22aa2 mk: Fix non-android cross builds. 2014-02-13 18:11:23 -05:00
Huon Wilson 44e6883d14 mk: make NO_REBUILD more forceful and more general.
Previously crates like `green` and `native` would still depend on their
parents when running `make check-stage2-green NO_REBUILD=1`, this
ensures that they only depend on their source files.

Also, apply NO_REBUILD to the crate doc tests, so, for example,
`check-stage2-doc-std` will use an already compiled `rustdoc` directly.
2014-02-13 12:54:01 -08:00
Alex Crichton 745aa7482a Include compiler-rt in the distribution tarballs 2014-02-13 12:50:25 -08:00
Vadim Chugunov b7651325eb Build compiler-rt and link it to all crates, similarly to morestack. 2014-02-11 15:59:59 -08:00
Florian Hahn f62460c1f5 Change `xfail` directives in compiletests to `ignore`, closes #11363 2014-02-11 18:23:20 +01:00
Felix S. Klock II d2d1129ad0 Factoring bigint, rational, and complex out of libextra into libnum.
Removed use of globs present in earlier versions of modules.

Fix tutorial.md to reflect `extra::rational` ==> `num::rational`.
2014-02-11 10:39:15 +01:00
Alex Crichton e25701132c Move fourcc to HOST_CRATES
It depends on libsyntax, which is a host crate, so it can't be in the target
crates section.
2014-02-10 11:51:06 -08:00
bors d440a569bb auto merge of #12084 : alexcrichton/rust/codegen-opts, r=cmr
Move them all behind a new -C switch. This migrates some -Z flags and some
top-level flags behind this -C codegen option.

The -C flag takes values of the form "-C name=value" where the "=value" is
optional for some flags.

Flags affected:

* --llvm-args           => -C llvm-args
* --passes              => -C passes
* --ar                  => -C ar
* --linker              => -C linker
* --link-args           => -C link-args
* --target-cpu          => -C target-cpu
* --target-feature      => -C target-fature
* --android-cross-path  => -C android-cross-path
* --save-temps          => -C save-temps
* --no-rpath            => -C no-rpath
* -Z no-prepopulate     => -C no-prepopulate-passes
* -Z no-vectorize-loops => -C no-vectorize-loops
* -Z no-vectorize-slp   => -C no-vectorize-slp
* -Z soft-float         => -C soft-float
* -Z gen-crate-map      => -C gen-crate-map
* -Z prefer-dynamic     => -C prefer-dynamic
* -Z no-integrated-as   => -C no-integrated-as

As a bonus, this also promotes the -Z extra-debug-info flag to a first class -g
or --debuginfo flag.

* -Z debug-info         => removed
* -Z extra-debug-info   => -g or --debuginfo

Closes #9770
Closes #12000
2014-02-10 01:26:24 -08:00
Alex Crichton 071ee96277 Consolidate codegen-related compiler flags
Move them all behind a new -C switch. This migrates some -Z flags and some
top-level flags behind this -C codegen option.

The -C flag takes values of the form "-C name=value" where the "=value" is
optional for some flags.

Flags affected:

* --llvm-args           => -C llvm-args
* --passes              => -C passes
* --ar                  => -C ar
* --linker              => -C linker
* --link-args           => -C link-args
* --target-cpu          => -C target-cpu
* --target-feature      => -C target-fature
* --android-cross-path  => -C android-cross-path
* --save-temps          => -C save-temps
* --no-rpath            => -C no-rpath
* -Z no-prepopulate     => -C no-prepopulate-passes
* -Z no-vectorize-loops => -C no-vectorize-loops
* -Z no-vectorize-slp   => -C no-vectorize-slp
* -Z soft-float         => -C soft-float
* -Z gen-crate-map      => -C gen-crate-map
* -Z prefer-dynamic     => -C prefer-dynamic
* -Z no-integrated-as   => -C no-integrated-as

As a bonus, this also promotes the -Z extra-debug-info flag to a first class -g
or --debuginfo flag.

* -Z debug-info         => removed
* -Z extra-debug-info   => -g or --debuginfo

Closes #9770
Closes #12000
2014-02-10 00:50:39 -08:00
Brian Anderson 3062d0f6bb mk: Replace 'compile_and_link' with 'oxidize' 2014-02-09 02:42:28 -08:00
Derek Guenther 97078d43b2 Converted fourcc! to loadable syntax extension 2014-02-08 23:40:17 -06:00
bors b66ec3483b auto merge of #12114 : brson/rust/faqs, r=cmr
These are ancient. I removed a bunch of questions that are less relevant - or completely unrelevant, updated other entries, and removed things that are already better expressed elsewhere.
2014-02-08 20:01:27 -08:00
Luca Bruno 51b74c41ff make: update dist target after libextra split
libextra is currently being split into several crates. This commit adds
them all to the dist target in order to have them in the final tarballs.

Signed-off-by: Luca Bruno <lucab@debian.org>
2014-02-08 21:32:43 +01:00
Luca Bruno 99cdabab00 make: update dist target for renamed files
src/README.txt has been renamed in a30d61b05a, make dist is
thus failing as unable to find it.
This commit makes the dist target working again.

Signed-off-by: Luca Bruno <lucab@debian.org>
2014-02-08 14:36:18 +01:00
Brian Anderson 30dcc8285b doc: Modernize FAQs just slightly 2014-02-08 00:38:00 -08:00
bors b2c1a81649 auto merge of #12099 : alexcrichton/rust/rpath-tests, r=thestinger
This way when you disable rpaths you can still run `make check`
2014-02-07 22:01:30 -08:00
bors 29e500db8a auto merge of #12094 : adridu59/rust/licensing, r=brson
Closes #12069.

cc @brson
2014-02-07 16:16:35 -08:00
Alex Crichton 28b72cdae4 Set the LD_LIBRARY_PATH when running tests
This way when you disable rpaths you can still run `make check`
2014-02-07 16:04:57 -08:00
Adrien Tétar ec2f047aa9 doc: add license information for gen. files 2014-02-07 20:50:15 +01:00
Derek Guenther 730bdb6403 Added tests to make tidy 2014-02-07 12:49:24 -06:00
bors 21b856d2dc auto merge of #12010 : HeroesGrave/rust/libcollection, r=alexcrichton
Part of #8784

Changes:
- Everything labeled under collections in libextra has been moved into a new crate 'libcollection'.
- Renamed container.rs to deque.rs, since it was no longer 'container traits for extra', just a deque trait.
- Crates that depend on the collections have been updated and dependencies sorted.
- I think I changed all the imports in the tests to make sure it works. I'm not entirely sure, as near the end of the tests there was yet another `use` that I forgot to change, and when I went to try again, it started rebuilding everything, which I don't currently have time for. 

There will probably be incompatibility between this and the other pull requests that are splitting up libextra. I'm happy to rebase once those have been merged.

The tests I didn't get to run should pass. But I can redo them another time if they don't.
2014-02-06 23:46:35 -08:00
HeroesGrave d81bb441da moved collections from libextra into libcollections 2014-02-07 19:49:26 +13:00
bors a27934c555 auto merge of #12076 : alexcrichton/rust/rpath-makefile-dep, r=thestinger
The rpath variable should only be used when executing commands, if it leaks into
a dependency list is causes havoc with the dependencies.
2014-02-06 19:16:34 -08:00
bors 87fe3ccf09 auto merge of #12039 : alexcrichton/rust/no-conditions, r=brson
This has been a long time coming. Conditions in rust were initially envisioned
as being a good alternative to error code return pattern. The idea is that all
errors are fatal-by-default, and you can opt-in to handling the error by
registering an error handler.

While sounding nice, conditions ended up having some unforseen shortcomings:

* Actually handling an error has some very awkward syntax:

        let mut result = None;                                        
        let mut answer = None;                                        
        io::io_error::cond.trap(|e| { result = Some(e) }).inside(|| { 
            answer = Some(some_io_operation());                       
        });                                                           
        match result {                                                
            Some(err) => { /* hit an I/O error */ }                   
            None => {                                                 
                let answer = answer.unwrap();                         
                /* deal with the result of I/O */                     
            }                                                         
        }                                                             

  This pattern can certainly use functions like io::result, but at its core
  actually handling conditions is fairly difficult

* The "zero value" of a function is often confusing. One of the main ideas
  behind using conditions was to change the signature of I/O functions. Instead
  of read_be_u32() returning a result, it returned a u32. Errors were notified
  via a condition, and if you caught the condition you understood that the "zero
  value" returned is actually a garbage value. These zero values are often
  difficult to understand, however.

  One case of this is the read_bytes() function. The function takes an integer
  length of the amount of bytes to read, and returns an array of that size. The
  array may actually be shorter, however, if an error occurred.

  Another case is fs::stat(). The theoretical "zero value" is a blank stat
  struct, but it's a little awkward to create and return a zero'd out stat
  struct on a call to stat().

  In general, the return value of functions that can raise error are much more
  natural when using a Result as opposed to an always-usable zero-value.

* Conditions impose a necessary runtime requirement on *all* I/O. In theory I/O
  is as simple as calling read() and write(), but using conditions imposed the
  restriction that a rust local task was required if you wanted to catch errors
  with I/O. While certainly an surmountable difficulty, this was always a bit of
  a thorn in the side of conditions.

* Functions raising conditions are not always clear that they are raising
  conditions. This suffers a similar problem to exceptions where you don't
  actually know whether a function raises a condition or not. The documentation
  likely explains, but if someone retroactively adds a condition to a function
  there's nothing forcing upstream users to acknowledge a new point of task
  failure.

* Libaries using I/O are not guaranteed to correctly raise on conditions when an
  error occurs. In developing various I/O libraries, it's much easier to just
  return `None` from a read rather than raising an error. The silent contract of
  "don't raise on EOF" was a little difficult to understand and threw a wrench
  into the answer of the question "when do I raise a condition?"

Many of these difficulties can be overcome through documentation, examples, and
general practice. In the end, all of these difficulties added together ended up
being too overwhelming and improving various aspects didn't end up helping that
much.

A result-based I/O error handling strategy also has shortcomings, but the
cognitive burden is much smaller. The tooling necessary to make this strategy as
usable as conditions were is much smaller than the tooling necessary for
conditions.

Perhaps conditions may manifest themselves as a future entity, but for now
we're going to remove them from the standard library.

Closes #9795
Closes #8968
2014-02-06 17:11:33 -08:00
Alex Crichton 80920da6b9 Don't include rpath lines in dependency lists
The rpath variable should only be used when executing commands, if it leaks into
a dependency list is causes havoc with the dependencies.
2014-02-06 16:33:41 -08:00
Alex Crichton 454882dcb7 Remove std::condition
This has been a long time coming. Conditions in rust were initially envisioned
as being a good alternative to error code return pattern. The idea is that all
errors are fatal-by-default, and you can opt-in to handling the error by
registering an error handler.

While sounding nice, conditions ended up having some unforseen shortcomings:

* Actually handling an error has some very awkward syntax:

    let mut result = None;
    let mut answer = None;
    io::io_error::cond.trap(|e| { result = Some(e) }).inside(|| {
        answer = Some(some_io_operation());
    });
    match result {
        Some(err) => { /* hit an I/O error */ }
        None => {
            let answer = answer.unwrap();
            /* deal with the result of I/O */
        }
    }

  This pattern can certainly use functions like io::result, but at its core
  actually handling conditions is fairly difficult

* The "zero value" of a function is often confusing. One of the main ideas
  behind using conditions was to change the signature of I/O functions. Instead
  of read_be_u32() returning a result, it returned a u32. Errors were notified
  via a condition, and if you caught the condition you understood that the "zero
  value" returned is actually a garbage value. These zero values are often
  difficult to understand, however.

  One case of this is the read_bytes() function. The function takes an integer
  length of the amount of bytes to read, and returns an array of that size. The
  array may actually be shorter, however, if an error occurred.

  Another case is fs::stat(). The theoretical "zero value" is a blank stat
  struct, but it's a little awkward to create and return a zero'd out stat
  struct on a call to stat().

  In general, the return value of functions that can raise error are much more
  natural when using a Result as opposed to an always-usable zero-value.

* Conditions impose a necessary runtime requirement on *all* I/O. In theory I/O
  is as simple as calling read() and write(), but using conditions imposed the
  restriction that a rust local task was required if you wanted to catch errors
  with I/O. While certainly an surmountable difficulty, this was always a bit of
  a thorn in the side of conditions.

* Functions raising conditions are not always clear that they are raising
  conditions. This suffers a similar problem to exceptions where you don't
  actually know whether a function raises a condition or not. The documentation
  likely explains, but if someone retroactively adds a condition to a function
  there's nothing forcing upstream users to acknowledge a new point of task
  failure.

* Libaries using I/O are not guaranteed to correctly raise on conditions when an
  error occurs. In developing various I/O libraries, it's much easier to just
  return `None` from a read rather than raising an error. The silent contract of
  "don't raise on EOF" was a little difficult to understand and threw a wrench
  into the answer of the question "when do I raise a condition?"

Many of these difficulties can be overcome through documentation, examples, and
general practice. In the end, all of these difficulties added together ended up
being too overwhelming and improving various aspects didn't end up helping that
much.

A result-based I/O error handling strategy also has shortcomings, but the
cognitive burden is much smaller. The tooling necessary to make this strategy as
usable as conditions were is much smaller than the tooling necessary for
conditions.

Perhaps conditions may manifest themselves as a future entity, but for now
we're going to remove them from the standard library.

Closes #9795
Closes #8968
2014-02-06 15:48:56 -08:00
bors c13a929d58 auto merge of #12020 : alexcrichton/rust/output-flags, r=brson
This commit removes the -c, --emit-llvm, -s, --rlib, --dylib, --staticlib,
--lib, and --bin flags from rustc, adding the following flags:

* --emit=[asm,ir,bc,obj,link]
* --crate-type=[dylib,rlib,staticlib,bin,lib]

The -o option has also been redefined to be used for *all* flavors of outputs.
This means that we no longer ignore it for libraries. The --out-dir remains the
same as before.

The new logic for files that rustc emits is as follows:

1. Output types are dictated by the --emit flag. The default value is
   --emit=link, and this option can be passed multiple times and have all options
   stacked on one another.
2. Crate types are dictated by the --crate-type flag and the #[crate_type]
   attribute. The flags can be passed many times and stack with the crate
   attribute.
3. If the -o flag is specified, and only one output type is specified, the
   output will be emitted at this location. If more than one output type is
   specified, then the filename of -o is ignored, and all output goes in the
   directory that -o specifies. The -o option always ignores the --out-dir
   option.
4. If the --out-dir flag is specified, all output goes in this directory.
5. If -o and --out-dir are both not present, all output goes in the directory of
   the crate file.
6. When multiple output types are specified, the filestem of all output is the
   same as the name of the CrateId (derived from a crate attribute or from the
   filestem of the crate file).

Closes #7791
Closes #11056
Closes #11667
2014-02-06 12:41:30 -08:00
Alex Crichton 6e7968b10a Redesign output flags for rustc
This commit removes the -c, --emit-llvm, -s, --rlib, --dylib, --staticlib,
--lib, and --bin flags from rustc, adding the following flags:

* --emit=[asm,ir,bc,obj,link]
* --crate-type=[dylib,rlib,staticlib,bin,lib]

The -o option has also been redefined to be used for *all* flavors of outputs.
This means that we no longer ignore it for libraries. The --out-dir remains the
same as before.

The new logic for files that rustc emits is as follows:

1. Output types are dictated by the --emit flag. The default value is
   --emit=link, and this option can be passed multiple times and have all
   options stacked on one another.
2. Crate types are dictated by the --crate-type flag and the #[crate_type]
   attribute. The flags can be passed many times and stack with the crate
   attribute.
3. If the -o flag is specified, and only one output type is specified, the
   output will be emitted at this location. If more than one output type is
   specified, then the filename of -o is ignored, and all output goes in the
   directory that -o specifies. The -o option always ignores the --out-dir
   option.
4. If the --out-dir flag is specified, all output goes in this directory.
5. If -o and --out-dir are both not present, all output goes in the current
   directory of the process.
6. When multiple output types are specified, the filestem of all output is the
   same as the name of the CrateId (derived from a crate attribute or from the
   filestem of the crate file).

Closes #7791
Closes #11056
Closes #11667
2014-02-06 11:14:13 -08:00
Arcterus 9752c63035 Move getopts out of extra 2014-02-06 10:00:17 -08:00
Jeff Olson b8852e89ce pull extra::{serialize, ebml} into a separate libserialize crate
- `extra::json` didn't make the cut, because of `extra::json` required
   dep on `extra::TreeMap`. If/when `extra::TreeMap` moves out of `extra`,
   then `extra::json` could move into `serialize`
- `libextra`, `libsyntax` and `librustc` depend on the newly created
  `libserialize`
- The extensions to various `extra` types like `DList`, `RingBuf`, `TreeMap`
  and `TreeSet` for `Encodable`/`Decodable` were moved into the respective
  modules in `extra`
- There is some trickery, evident in `src/libextra/lib.rs` where a stub
  of `extra::serialize` is set up (in `src/libextra/serialize.rs`) for
  use in the stage0 build, where the snapshot rustc is still making
  deriving for `Encodable` and `Decodable` point at extra. Big props to
  @huonw for help working out the re-export solution for this

extra: inline extra::serialize stub

fix stuff clobbered in rebase + don't reexport serialize::serialize

no more globs in libserialize

syntax: fix import of libserialize traits

librustc: fix bad imports in encoder/decoder

add serialize dep to librustdoc

fix failing run-pass tests w/ serialize dep

adjust uuid dep

more rebase de-clobbering for libserialize

fixing tests, pushing libextra dep into cfg(test)

fix doc code in extra::json

adjust index.md links to serialize and uuid library
2014-02-05 10:38:22 -08:00
JeremyLetang dd21a51d29 move concurrent stuff from libextra to libsync 2014-02-05 11:56:04 -05:00
bors 4509b49451 auto merge of #12018 : alexcrichton/rust/triage, r=sfackler
Mostly just test suite modifications.
2014-02-04 21:46:35 -08:00
Alex Crichton 50bdeb9a34 Run all target crate tests on the windows/try bots
Previously, the check-fast and check-lite test suites weren't picking up all
target crates, rather just std/extra. In order to ensure that all of our crates
work on windows, I've modified these rules to build the test suites for all
TARGET_CRATES members. Note that this still excludes rustc/syntax/rustdoc.
2014-02-04 18:05:13 -08:00
Birunthan Mohanathas f8afc9a5c1 extra: Move uuid to libuuid
cc #8784
2014-02-04 06:44:02 +02:00
OGINO Masanori fdb820a1be Move semver out of libextra.
Done as a part of #8784.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-02-03 17:18:27 +09:00
xales 51260f69cd Move term, terminfo out of extra.
cc #8784
2014-02-02 18:35:35 -05:00
Alex Crichton 22a421fa02 Rewrite the doc makefile for doc => src/doc
This continues to generate all documentation into doc, but it now looks for
source files in src/doc

Closes #11860
Closes #11970
2014-02-02 10:59:27 -08:00
Alex Crichton 91882a4c56 Remove VPATH usage in Makefiles
This is just messing up all the doc dependencies because of such similar
directory names and file names.

Closes #11422
2014-02-02 10:59:14 -08:00
Corey Richardson 25fe2cadb1 Remove rustpkg.
I'm sorry :'(

Closes #11859
2014-02-02 03:08:56 -05:00
bors 1e23c5c051 auto merge of #11879 : thestinger/rust/frame-pointer, r=alexcrichton
This is still used for Rust code (`Options.NoFramePointerElim = true`).
2014-01-29 13:36:40 -08:00
bors 87004db113 auto merge of #11867 : dmanescu/rust/8784-arena-glob, r=huonw
In line with the dissolution of libextra - #8784 - this moves arena and glob into
their own respective modules. Updates .gitignore with the entries
doc/{arena,glob} in accordance.
2014-01-29 06:26:38 -08:00
bors 1d80a9a0f6 auto merge of #11903 : alexcrichton/rust/android-test-deps, r=huonw
This changes android testing to upload *all* target crates rather than just a
select subset. This should unblock #11867 which is introducing a libglob
dependency in testing.
2014-01-29 01:06:41 -08:00
Alex Crichton 55280598a8 Fix android test deps
This changes android testing to upload *all* target crates rather than just a
select subset. This should unblock #11867 which is introducing a libglob
dependency in testing.
2014-01-29 00:16:32 -08:00
David Manescu 93398d16ec extra: move glob to libglob
In line with the dissolution of libextra - moves glob to its own library libglob.
Changes based on PR #11787. Updates .gitignore to ignore doc/glob.
2014-01-29 17:23:28 +11:00
David Manescu 4d0d3da9e4 extra: move arena to libarena
In line with the dissolution of libextra - #8784 - moves arena to its own library libarena.
Changes based on PR #11787. Updates .gitignore to ignore doc/arena.
2014-01-29 13:54:38 +11:00
Alex Crichton 20d6a8e0af Add a missing backslash to a makefile
Closes #11874
2014-01-28 09:17:06 -08:00
Daniel Micay 17c42db6d1 mk: remove -fno-omit-frame-pointer
This is still used for Rust code (`Options.NoFramePointerElim = true`).
2014-01-28 09:31:59 -05:00
Alex Crichton 0d38e1f9c1 Depend on libnative when testing
The stdtest binary uses both libnative and libgreen to test the two
implementations

Closes #11843
2014-01-27 09:16:55 -08:00
bors 74fedf325a auto merge of #11787 : alexcrichton/rust/refactor, r=brson
It was decided a long, long time ago that libextra should not exist, but rather its modules should be split out into smaller independent libraries maintained outside of the compiler itself. The theory was to use `rustpkg` to manage dependencies in order to move everything out of the compiler, but maintain an ease of usability.

Sadly, the work on `rustpkg` isn't making progress as quickly as expected, but the need for dissolving libextra is becoming more and more pressing. Because of this, we've thought that a good interim solution would be to simply package more libraries with the rust distribution itself. Instead of dissolving libextra into libraries outside of the mozilla/rust repo, we can dissolve libraries into the mozilla/rust repo for now.

Work on this has been excruciatingly painful in the past because the makefiles are completely opaque to all but a few. Adding a new library involved adding about 100 lines spread out across 8 files (incredibly error prone). The first commit of this pull request targets this pain point. It does not rewrite the build system, but rather refactors large portions of it. Afterwards, adding a new library is as simple as modifying 2 lines (easy, right?). The build system automatically keeps track of dependencies between crates (rust *and* native), promotes binaries between stages, tracks dependencies of installed tools, etc, etc.

With this newfound buildsystem power, I chose the `extra::flate` module as the first candidate for removal from libextra. While a small module, this module is relative complex in that is has a C dependency and the compiler requires it (messing with the dependency graph a bit). Albeit I modified more than 2 lines of makefiles to accomodate libflate (the native dependency required 2 extra lines of modifications), but the removal process was easy to do and straightforward.

---

Testing-wise, I've cross-compiled, run tests, built some docs, installed, uninstalled, etc. I'm still working out a few kinks, and I'm sure that there's gonna be built system issues after this, but it should be working well for basic use!

cc #8784
2014-01-26 16:46:34 -08:00
Alex Crichton cdfdc1eb6b Move extra::flate to libflate
This is hopefully the beginning of the long-awaited dissolution of libextra.
Using the newly created build infrastructure for building libraries, I decided
to move the first module out of libextra.

While not being a particularly meaty module in and of itself, the flate module
is required by rustc and additionally has a native C dependency. I was able to
very easily split out the C dependency from rustrt, update librustc, and
magically everything gets installed to the right locations and built
automatically.

This is meant to be a proof-of-concept commit to how easy it is to remove
modules from libextra now. I didn't put any effort into modernizing the
interface of libflate or updating it other than to remove the one glob import it
had.
2014-01-26 15:42:15 -08:00
Salem Talha cc61fc0994 Removed all instances of XXX in preparation for relaxing of FIXME rule 2014-01-26 14:42:53 -05:00
Alex Crichton 2611483894 Refactor the build system for easily adding crates
Before this patch, if you wanted to add a crate to the build system you had to
change about 100 lines across 8 separate makefiles. This is highly error prone
and opaque to all but a few. This refactoring is targeted at consolidating this
effort so adding a new crate adds one line in one file in a way that everyone
can understand it.
2014-01-26 00:53:41 -08:00
bors f3f2e697d8 auto merge of #11619 : adridu59/rust/patch-md, r=cmr
Noticeably necroes #10892.
Also closes #11559.

r? @alexcrichton
2014-01-18 09:01:46 -08:00
Alex Crichton bd469341eb test: Add the ability to force a host target
The new macro loading infrastructure needs the ability to force a
procedural-macro crate to be built with the host architecture rather than the
target architecture (because the compiler is just about to dlopen it).
2014-01-17 11:13:22 -08:00
Adrien Tétar b2cac497e8 doc: fix version stamp for TeX files
This fixes a regression introduced in
3d57b240ab.
2014-01-17 19:38:51 +01:00
Vadim Chugunov 62fbd00bed Only build LLVM tools Rust needs. 2014-01-15 17:47:48 -08:00
bors dd8b011319 auto merge of #11521 : dguenther/rust/hide_libdir_relative, r=alexcrichton
Renamed `LIBDIR_RELATIVE` to `CFG_LIBDIR_RELATIVE`. It's not a configurable variable, but it looks out of place without the `CFG_` prefix.

Fixes #11420
2014-01-14 15:11:30 -08:00
Derek Guenther a599d897fc Renamed LIBDIR_RELATIVE to CFG_LIBDIR_RELATIVE 2014-01-14 15:52:57 -06:00
bors 77eeddaa48 auto merge of #11501 : alexcrichton/rust/dox, r=brson
The official documentation sorely needs an explanation of the rust runtime and what it is exactly, and I want this guide to provide that information.

I'm unsure of whether I've been too light on some topics while too heavy on others. I also feel like a few things are still missing. As always, feedback is appreciated, especially about things you'd like to see written about!
2014-01-13 23:26:36 -08:00
Alex Crichton 289ba105ae dox: Write a guide to the rust runtime 2014-01-13 23:22:07 -08:00
Brian Anderson 279366a0b2 mk: Make TESTNAME and VERBOSE work with android. Closes #10957 2014-01-13 19:45:37 -08:00
Kevin Ballard 110e5dd1ac doc: build the docs for librustpkg 2014-01-11 19:13:59 -08:00
Adrien Tétar 72794094a1 Trim src/ README, bring back version_info everywhere 2014-01-11 19:55:24 +01:00
bors 01794cc993 auto merge of #11461 : alexcrichton/rust/rustdoc-fixes, r=brson
See the commits.
2014-01-11 02:41:23 -08:00
Alex Crichton b1eaeb5561 doc: build the docs for librustuv
Closes #11444
2014-01-10 15:12:06 -08:00
Ted Horst 0d4c51e1d1 fix uninstall target with configurable rustlib directory 2014-01-10 13:45:41 -06:00
Alex Crichton f2a86a2da6 Register new snapshots 2014-01-09 09:18:59 -08:00
bors f3a8baafbe auto merge of #11407 : alexcrichton/rust/fix-snap, r=brson
If we bootstrap a cross compile from a stage1 compiler, then the stage1 compiler
already knows about the rustc => rustlib change, so we need to not add the extra
flag if it's a stage0 version of a target from a stage1 of another target.
2014-01-08 08:46:33 -08:00
Alex Crichton 004dae6abd Fix the snapshot and cross compilation
If we bootstrap a cross compile from a stage1 compiler, then the stage1 compiler
already knows about the rustc => rustlib change, so we need to not add the extra
flag if it's a stage0 version of a target from a stage1 of another target.
2014-01-08 08:16:48 -08:00
Brian Anderson 77ec04487b mk: Start testing the cheatsheet 2014-01-07 17:01:07 -08:00
bors aa1839bd69 auto merge of #11364 : brson/rust/docs, r=alexcrichton
This reorganizes the documentation index to be more focused on the in-tree docs, and to clean up the style, and it also adds @steveklabnik's pointer guide.
2014-01-07 15:46:38 -08:00
Jan Niklas Hasse 116773a4eb Make CFG_LIBDIR configurable. Fixes #5223 2014-01-07 17:51:15 +01:00
bors 777f1e8d24 auto merge of #11355 : alexcrichton/rust/read-waits-forever, r=brson
All the fun is down below.
2014-01-06 23:36:46 -08:00
Alex Crichton 89f8bc2561 Fix parallel makefile builds
All the copying of files amongst one another was apparently causing something to
get corrupted. Instead of having files fly around, just update the directories
to link to.
2014-01-06 21:55:15 -08:00
Steve Klabnik 6f09d80f97 Add Pointer tutorial, rename borrowed pointer tutorial. 2014-01-06 19:37:26 -08:00
Brian Anderson f5ee07792e mk: Fix formatting of docs.mk 2014-01-06 17:24:16 -08:00
bors b6602cb74b auto merge of #11354 : brson/rust/versionwin, r=alexcrichton
The makefiles and the windows installer disagree on the name of this file. In practical terms this change only means that the '-pre' installers will be named 'rust-0.9-pre-install.exe' instead 'rust-0.9-install.exe'.
2014-01-06 16:31:52 -08:00
bors 1f1838ea3e auto merge of #11123 : alan-andrade/rust/move_wiki_to_internal_docs, r=brson
This is not done yet but I'm posting it to get feedback.

The wiki has a ton of different tutorials/manuals/faq and so forth. Instead of migrating all of them right now, I just migrated the following:

* The general main wiki page
* Language FAQ
* Project FAQ

If this feels reasonable, please comment so that I can continue with confidence.
2014-01-06 14:26:38 -08:00
Brian Anderson 21f9fa4850 Delete the installer exe when cleaning 2014-01-06 14:18:35 -08:00
Alan Andrade 7de2379013 rust_version.html is a HTML_DEPS and every html has it as dependecy 2014-01-06 15:38:20 -06:00
Alan Andrade e53b5661a7 First phase of migrating the wiki to the internal docs #11078 2014-01-06 15:27:49 -06:00
bors 4e622becdc auto merge of #11118 : jhasse/rust/patch-rustlibdir, r=alexcrichton
...stlib. Fixes #3319
2014-01-06 02:01:49 -08:00
Alan Andrade eeafee4c9b Convert sub tutorials into Guides #10838
Ensure configure creates doc/guides directory

Fix configure makefile and tests

Remove old guides dir and configure option, convert testing to guide

Remove ignored files

Fix submodule issue

prepend dir in makefile so that bor knows how to build the docs

S to uppercase
2014-01-05 22:48:19 -06:00
Jan Niklas Hasse 6abe0ef32e Make rustc's own lib directory configurable and change the default to rustlib. Fixes #3319 2014-01-05 12:06:20 +01:00
bors 57db916e86 auto merge of #11307 : vadimcn/rust/test-adb, r=brson
Fix android device detection when connected to a remote emulator (in this case device name contains ':').
Use $(CFG_ADB) for all adb invocations.
2014-01-04 19:02:03 -08:00
bors ea4219f6e5 auto merge of #11290 : alexcrichton/rust/testname, r=brson
Closes #11288
Closes #11222
2014-01-04 16:36:46 -08:00
bors 89907089c2 auto merge of #11301 : vadimcn/rust/fix-android, r=brson
This fixes stack unwinding on targets using ARM EHABI.
closes #11147
2014-01-04 11:56:46 -08:00
Vadim Chugunov c78a407115 Fix android device detection when connected to a remote emulator (in this case device name contains ':').
Use $(CFG_ADB) for all adb invocations.
2014-01-04 00:38:24 -08:00
Vadim Chugunov cefb2c7e45 Fix ARM unwinding. 2014-01-03 23:34:15 -08:00
Brian Anderson b3a334af6a mk: Fix llvmdeps.rs dependencies
In a multi-host build the mklldeps.py tool is getting called before
all the llvm-configs are built. I am not actually sure the cause. I
had convinced myself that DEF_LLVM_RULES needed to be called before
the llvmdeps.rs rule, but now looking at it again I can't see why.
2014-01-03 14:20:46 -08:00
Alex Crichton 2453079d09 Change rmake and doc-test to support TESTNAME
Closes #11288
Closes #11222
2014-01-03 11:16:52 -08:00
Julia Evans f0322371dd Add testing tutorial to docs 2013-12-31 10:34:55 -05:00
Corey Richardson e53e86a3f3 Add a compiler-docs target 2013-12-29 00:13:19 -05:00
Corey Richardson 8ca1c344d5 Add docs for more crates 2013-12-28 13:06:05 -05:00
Alex Crichton ab431a20c0 Register new snapshots 2013-12-26 11:30:23 -08:00
bors 9477c49a7b auto merge of #10965 : alexcrichton/rust/libgreen, r=brson
This pull request extracts all scheduling functionality from libstd, moving it into its own separate crates. The new libnative and libgreen will be the new way in which 1:1 and M:N scheduling is implemented. The standard library still requires an interface to the runtime, however, (think of things like `std::comm` and `io::println`). The interface is now defined by the `Runtime` trait inside of `std::rt`.

The booting process is now that libgreen defines the start lang-item and that's it. I want to extend this soon to have libnative also have a "start lang item" but also allow libgreen and libnative to be linked together in the same process. For now though, only libgreen can be used to start a program (unless you define the start lang item yourself). Again though, I want to change this soon, I just figured that this pull request is large enough as-is.

This certainly wasn't a smooth transition, certain functionality has no equivalent in this new separation, and some functionality is now better enabled through this new system. I did my best to separate all of the commits by topic and keep things fairly bite-sized, although are indeed larger than others.

As a note, this is currently rebased on top of my `std::comm` rewrite (or at least an old copy of it), but none of those commits need reviewing (that will all happen in another pull request).
2013-12-26 01:01:54 -08:00
Alex Crichton 70ff5f7033 mk: Fix doc tests for multiple targets
It only really makes sense to run tests for the build target anyway because it's
not guaranteed that you can execute other targets.

This is blocking the next snapshot
2013-12-24 22:59:38 -08:00
Alex Crichton 0dcdefcf7e make: Fix deps of rmake tests and host files
The rmake tests should depend on the target libraries (for linking), not just
the host libraries (for running). The host file dependencies are also correct
now because HLIBRUSTC_DEFAULT doesn't actually exist.
2013-12-24 19:59:54 -08:00
Alex Crichton 04c446b4b6 make: Don't have libsyntax depend on librustuv
It doesn't actually and we can get better incremental build times for
modifications to librustuv if libsyntax/librustc don't need to get rebuilt
2013-12-24 19:59:54 -08:00
Alex Crichton 282f3d99a5 Test fixes and rebase problems
Note that this removes a number of run-pass tests which are exercising behavior
of the old runtime. This functionality no longer exists and is thoroughly tested
inside of libgreen and libnative. There isn't really the notion of "starting the
runtime" any more. The major notion now is "bootstrapping the initial task".
2013-12-24 19:59:53 -08:00
Alex Crichton 018d60509c std: Get stdtest all passing again
This commit brings the library up-to-date in order to get all tests passing
again
2013-12-24 19:59:52 -08:00
Alex Crichton d830fcc6eb make: Add all the make support for lib{native,green}
This should now begin distribution of lib{green,native} in rlib/dylib format as
well as building them as part of the normal build process.
2013-12-24 19:59:52 -08:00
Vadim Chugunov e3b37154b0 Stop using C++ exceptions for stack unwinding. 2013-12-24 12:13:42 -08:00
Alex Crichton fe8b360c9d mk: Run doc tests as part of 'make check'
Don't run doc tests during make check-fast because it involves spawning lots of
processes.
2013-12-23 09:10:37 -08:00
bors f71c0dc2cd auto merge of #11069 : alexcrichton/rust/issue-11067, r=brson
Turns out libuv's build system doesn't like us telling them that the build
directory is a relative location, as it always spits out a warning about a
circular dependency being dropped. By using an absolute path, turns out the
warnings isn't spit out, who knew?

Closes #11067
2013-12-22 22:36:30 -08:00
Alex Crichton 9d59e358d9 uv: Suppress a warning by using an absolute path
Turns out libuv's build system doesn't like us telling them that the build
directory is a relative location, as it always spits out a warning about a
circular dependency being dropped. By using an absolute path, turns out the
warnings isn't spit out, who knew?

Closes #11067
2013-12-22 22:30:51 -08:00
bors 0478142b5f auto merge of #11096 : brson/rust/pp, r=alexcrichton 2013-12-22 12:36:35 -08:00
bors 9b1e7db71c auto merge of #11114 : klutzy/rust/a, r=cmr 2013-12-22 04:16:37 -08:00
klutzy dd44a25fd0 mk: Clean .lib files 2013-12-22 21:05:50 +09:00
bors 256f6976ad auto merge of #11095 : brson/rust/issue-11094, r=alexcrichton 2013-12-21 19:46:35 -08:00
Brian Anderson a5d26a2e37 mk: Remove obsolete source reformatting rules 2013-12-20 18:31:00 -08:00
Brian Anderson 675aac3001 mk: Work around problem with run-make tests on multiple targets. #11094 2013-12-20 18:06:12 -08:00
bors b760ed6573 auto merge of #10977 : brson/rust/androidtest, r=brson
#10975

For a while I thought the android test bot was succeeding but it wasn't really testing anything at all.
2013-12-18 20:06:33 -08:00
Brian Anderson 4a03e04755 Make Android tests fail if no device is available 2013-12-18 18:12:46 -08:00
bors b6933f8d8b auto merge of #11032 : cmr/rust/rustdoc_test, r=alexcrichton
This is just a smoke test which verifies that the expected files are
generated.
2013-12-18 15:16:39 -08:00
Corey Richardson 5d45170b02 Add a rustdoc test
This is just a smoke test which verifies that the expected files are
generated. Also makes the rmake tests have the right deps.
2013-12-18 15:21:30 -05:00
klutzy b0a9937a6d mklldeps.py: Write to file instead of print
It seems that msys automatically converts `\n` to `\r\n` on pipe
redirection, which causes `make tidy` failure.
2013-12-18 09:49:55 +09:00
bors f73c9c9bbc auto merge of #10949 : fabricedesre/rust/no-gnustl, r=cmr 2013-12-14 09:26:27 -08:00
bors fbbadae80f auto merge of #10849 : adridu59/rust/patch-css, r=alexcrichton
rustdoc:
- fix search-bar layout

doc: CSS:
- switch to native pandoc toc depth
- rm some dead code
- clamp width to be readable (we're not Wikipedia!)
- don't background-color titles, it's bloating
- make syntax-highlighting colors inline with rust-lang.org
- space indents

@alexcrichton
2013-12-13 14:21:35 -08:00
Adrien Tétar 1999b25310 doc: CSS changes + commit improved favicon 2013-12-13 21:50:26 +01:00
bors e5f4904fab auto merge of #10912 : DiamondLovesYou/rust/master, r=alexcrichton 2013-12-13 07:51:42 -08:00
Fabrice Desré 57c6281649 Remove dependency on gnustl_shared for android builds 2013-12-12 23:06:59 -08:00
Richard Diamond fa36de339a Fixed a minor typo. 2013-12-10 18:52:50 -06:00
bors ac4dd9efee auto merge of #10593 : metajack/rust/pkgid-hash, r=brson
This replaces the link meta attributes with a pkgid attribute and uses a hash
of this as the crate hash. This makes the crate hash computable by things
other than the Rust compiler. It also switches the hash function ot SHA1 since
that is much more likely to be available in shell, Python, etc than SipHash.

Fixes #10188, #8523.
2013-12-10 16:51:20 -08:00
Jack Moffitt a16753c188 Add missing sundown dependency to rustdoc tests. 2013-12-10 17:04:24 -07:00
Corey Richardson 94e0a03f5d Add rustdoc documentation. 2013-12-10 09:43:33 -05:00
Alex Crichton 70273bb1d6 Register new snapshots
This transitions the snapshot dependency process to understand that our
snapshots are now a single static binary rather than an array of files.
2013-12-07 23:02:39 -08:00
Alex Crichton f04d6241cb Fix the linked targets for rustc
Right now multiple targets/hosts is broken because the libdir passed for all of
the LLVM libraries is for the wrong architecture. By using the right arch
(target, not host), everything is linked and assembled just fine.
2013-12-07 10:38:32 -08:00
Alex Crichton e91ffb0710 Link rustllvm statically, and distribute a static snapshot
In order to keep up to date with changes to the libraries that `llvm-config`
spits out, the dependencies to the LLVM are a dynamically generated rust file.
This file is now automatically updated whenever LLVM is updated to get kept
up-to-date.

At the same time, this cleans out some old cruft which isn't necessary in the
makefiles in terms of dependencies.

Closes #10745
Closes #10744
2013-12-06 20:51:17 -08:00
Alex Crichton 17a951c7bf Remove unused upcalls
The main one removed is rust_upcall_reset_stack_limit (continuation of #10156),
and this also removes the upcall_trace function. The was hidden behind a
`-Z trace` flag, but if you attempt to use this now you'll get a linker error
because there is no implementation of the 'upcall_trace' function. Due to this
no longer working, I decided to remove it entirely from the compiler (I'm also a
little unsure on what it did in the first place).
2013-12-05 16:29:16 -08:00
Alex Crichton 6437122e64 Tidy up a few problems with run-make tests
Use the correct set of dependencies as well as CFG_PYTHON instead of assuming
'python' is the right one.
2013-12-03 08:13:00 -08:00
Felix S. Klock II 5e00d5c790 Make the ccache-free case look like the ccache case.
This fixes a problem with `make check` clang -Werror failing due to an
unused -Llib arg.
2013-12-02 19:25:14 +01:00
Alex Crichton c6e934f447 *Actually* fix `make install` with rlibs
Turns out that we only want to install the target rlibs, not the host rlibs.
I had it backwards the first time, then mixed up the second time, but this time
should get it right.

There's no need for host rlib files because none of them are needed at runtime.
2013-12-01 06:58:46 -08:00
bors c470184c20 auto merge of #10746 : alexcrichton/rust/fix-make-install, r=cmr
It was only copying the host files, not the target rlib files.
2013-11-30 21:01:43 -08:00
Alex Crichton 8b964bf349 Fix make install to install rlib files
It was only copying the host files, not the target rlib files.
2013-11-30 18:58:09 -08:00
bors 436adc2131 auto merge of #10731 : chris-morgan/rust/fix-double-slashing, r=metajack
CFG_BUILD_DIR, CFG_LLVM_SRC_DIR and CFG_SRC_DIR all have trailing
slashes, by definition, so this is correct.

(This is purely cosmetic; the doubled slash is ignored by all the tools we're using.)
2013-11-30 15:51:39 -08:00
Alex Crichton 56e4c82a38 Test fixes and merge conflicts 2013-11-30 14:34:59 -08:00
Alex Crichton 6d6ccb75ff Add a new run-make test directory
This infrastructure is meant to support runnings tests that involve various
interesting interdependencies about the types of crates being linked or possibly
interacting with C libraries. The goal of these make tests is to not restrict
them to a particular test runner, but allow each test to run its own tests.

To this end, there is a new src/test/run-make directory which has sub-folders of
tests. Each test requires a `Makefile`, and running the tests constitues simply
running `make` inside the directory. The new target is `check-stageN-rmake`.

These tests will have the destination directory (as TMPDIR) and the local rust
compiler (as RUSTC) passed along to them. There is also some helpful
cross-platform utilities included in src/test/run-make/tools.mk to aid with
compiling C programs and running them.

The impetus for adding this new test suite is to allow various interesting forms
of testing rust linkage. All of the tests initially added are various flavors of
compiling Rust and C with one another as well as just making sure that rust
linkage works in general.

Closes #10434
2013-11-29 18:36:14 -08:00
Alex Crichton 9fbba7b2ee Statically link librustrt to libstd
This commit alters the build process of the compiler to build a static
librustrt.a instead of a dynamic version. This means that we can stop
distributing librustrt as well as default linking against it in the compiler.

This also means that if you attempt to build rust code without libstd, it will
no longer work if there are any landing pads in play. The reason for this is
that LLVM and rustc will emit calls to the various upcalls in librustrt used to
manage exception handling. In theory we could split librustrt into librustrt and
librustupcall. We would then distribute librustupcall and link to it for all
programs using landing pads, but I would rather see just one librustrt artifact
and simplify the build process.

The major benefit of doing this is that building a static rust library for use
in embedded situations all of a sudden just became a whole lot more feasible.

Closes #3361
2013-11-29 18:36:14 -08:00
Alex Crichton e338a4154b Add generation of static libraries to rustc
This commit implements the support necessary for generating both intermediate
and result static rust libraries. This is an implementation of my thoughts in
https://mail.mozilla.org/pipermail/rust-dev/2013-November/006686.html.

When compiling a library, we still retain the "lib" option, although now there
are "rlib", "staticlib", and "dylib" as options for crate_type (and these are
stackable). The idea of "lib" is to generate the "compiler default" instead of
having too choose (although all are interchangeable). For now I have left the
"complier default" to be a dynamic library for size reasons.

Of the rust libraries, lib{std,extra,rustuv} will bootstrap with an
rlib/dylib pair, but lib{rustc,syntax,rustdoc,rustpkg} will only be built as a
dynamic object. I chose this for size reasons, but also because you're probably
not going to be embedding the rustc compiler anywhere any time soon.

Other than the options outlined above, there are a few defaults/preferences that
are now opinionated in the compiler:

* If both a .dylib and .rlib are found for a rust library, the compiler will
  prefer the .rlib variant. This is overridable via the -Z prefer-dynamic option
* If generating a "lib", the compiler will generate a dynamic library. This is
  overridable by explicitly saying what flavor you'd like (rlib, staticlib,
  dylib).
* If no options are passed to the command line, and no crate_type is found in
  the destination crate, then an executable is generated

With this change, you can successfully build a rust program with 0 dynamic
dependencies on rust libraries. There is still a dynamic dependency on
librustrt, but I plan on removing that in a subsequent commit.

This change includes no tests just yet. Our current testing
infrastructure/harnesses aren't very amenable to doing flavorful things with
linking, so I'm planning on adding a new mode of testing which I believe belongs
as a separate commit.

Closes #552
2013-11-29 18:36:13 -08:00
Chris Morgan d3019af244 Fix double slashes in make paths.
CFG_BUILD_DIR, CFG_LLVM_SRC_DIR and CFG_SRC_DIR all have trailing
slashes, by definition, so this is correct.
2013-11-30 12:09:10 +11:00
Corey Richardson 6fbe2a0c8b rustdoc: pass through --cfg to rustc
Closes #10623
2013-11-24 23:33:44 -05:00
Luqman Aden ae5a13d643 Use CXX not CC for linking. 2013-11-23 04:49:16 -05:00
Luqman Aden 84403eb897 Remove sjlj stuff from rust_upcall and don't pass -Werror to libuv. 2013-11-22 22:04:36 -08:00
Luqman Aden a2c111abde mk: Get rid of redundant LIBUV_FLAGS. 2013-11-22 20:39:58 -05:00
Luqman Aden 6820ed4dcf Fix up mingw64 target. 2013-11-22 20:39:58 -05:00
Alex Crichton 508b7b996e Move runtime files to C instead of C++
Explicitly have the only C++ portion of the runtime be one file with exception
handling. All other runtime files must now live in C and be fully defined in C.
2013-11-18 21:45:58 -08:00
Alex Crichton e8bf078802 Remove the C++ lock_and_signal type
A the same time this purges all runtime support needed for statically
initialized mutexes, moving all users over to the new Mutex type instead.
2013-11-18 20:06:40 -08:00
Chris Morgan 8e59c5d34a Don't make tags for our dependencies and tests.
Largely, this is just being more specific about where tags get searched
for to remove external dependencies like src/llvm, which reduces the
number of tags *enormously* and significantly increases the usefulness
of the tags file as it is then focusing on 240K lines of Rust code
and 4.5K of C++ rather than just shy of 1M lines of C++ code (mostly
from LLVM) and another 100K lines of Rust tests and a diverse collection
of other languages.

src/rustllvm/RustWrapper.cpp and src/rustllvm/PassWrapper.cpp are
getting tags made, but I'm not sure if that's desirable or not. At
worst, it's not a significant wrong.

A future, desirable step is producing tags for just libstd and libextra
for the use of people using Rust-the-language rather than working on
Rust itself.
2013-11-16 13:44:52 +11:00
Adrien Tétar 3d57b240ab doc: tidy up makefile rules 2013-11-13 09:40:45 +01:00
Adrien Tétar 58aa18c8ba doc: add favicon to tutorial/manual
Since tutorial/manual files are stored on static.rust-lang.org, browsers
try to fetch the favicon from there while it should be retrieved from the
main domain.
2013-11-13 09:32:50 +01:00
bors 95b46a1763 auto merge of #10226 : nibrahim/rust/docepub, r=alexcrichton
Added two new rules to create epubs out of the tutorial and reference manual source files. This is useful and doesn't add any new dependencies to the build process.
2013-11-10 14:46:04 -08:00
Alex Crichton 86a321b65d Another round of test fixes from previous commits 2013-11-10 01:37:12 -08:00
Alex Crichton 3a3eefc5c3 Update to the latest libuv
At this time, also point the libuv submodule to the official repo instead of my
own off to the side.

cc #10246
Closes #10329
2013-11-10 01:37:11 -08:00
bors 22eb11c09b auto merge of #10227 : kud1ing/rust/ios, r=alexcrichton 2013-11-06 14:01:14 -08:00
kud1ing 2a333ed088 Fixes for compilation to iOS:
- remove /usr/include from the include path since the iOS SDK provides the correct version
- `_NSGetEnviron()` is private and not available on iOS
- `.align` without an argument is not allowed with the Apple tools. 2^2 should be the default alignment
- ignore error messages for XCode < 5
- pass include path to libuv
2013-11-06 22:11:09 +01:00
Dirkjan Bussink 47e0bd403a Move implementation for threads to Rust
This binds to the appropriate pthreads_* and Windows specific functions
and calls them from Rust. This allows for removal of the C++ support
code for threads.

Fixes #10162
2013-11-05 17:49:46 +01:00
Alex Crichton 9c1851019f Remove all blocking std::os blocking functions
This commit moves all thread-blocking I/O functions from the std::os module.
Their replacements can be found in either std::rt::io::file or in a hidden
"old_os" module inside of native::file. I didn't want to outright delete these
functions because they have a lot of special casing learned over time for each
OS/platform, and I imagine that these will someday get integrated into a
blocking implementation of IoFactory. For now, they're moved to a private module
to prevent bitrot and still have tests to ensure that they work.

I've also expanded the extensions to a few more methods defined on Path, most of
which were previously defined in std::os but now have non-thread-blocking
implementations as part of using the current IoFactory.

The api of io::file is in flux, but I plan on changing it in the next commit as
well.

Closes #10057
2013-11-03 15:15:42 -08:00
Noufal Ibrahim 759c0168a1 Create epub versions of tutorial and ref manual.
Pandoc can create epub verions of the markdown files. Since the docs
are lengthy, epubs are handy to have around. Two rules to create epub
versions of the reference manual and the main tutorial are added here.

Signed-off-by: Noufal Ibrahim <noufal@nibrahim.net.in>
2013-11-03 18:39:36 +05:30
Chris Morgan 0369a41f0e Rename files to match current recommendations.
New standards have arisen in recent months, mostly for the use of
rustpkg, but the main Rust codebase has not been altered to match these
new specifications. This changeset rectifies most of these issues.

- Renamed the crate source files `src/libX/X.rs` to `lib.rs`, for
  consistency with current styles; this affects extra, rustc, rustdoc,
  rustpkg, rustuv, std, syntax.

- Renamed `X/X.rs` to `X/mod.rs,` as is now recommended style, for
  `std::num` and `std::terminfo`.

- Shifted `src/libstd/str/ascii.rs` out of the otherwise unused `str`
  directory, to be consistent with its import path of `std::ascii`;
  libstd is flat at present so it's more appropriate thus.

While this removes some `#[path = "..."]` directives, it does not remove
all of them, and leaves certain other inconsistencies, such as `std::u8`
et al. which are actually stored in `src/libstd/num/` (one subdirectory
down). No quorum has been reached on this issue, so I felt it best to
leave them all alone at present. #9208 deals with the possibility of
making libstd more hierarchical (such as changing the crate to match the
current filesystem structure, which would make the module path
`std::num::u8`).

There is one thing remaining in which this repository is not
rustpkg-compliant: rustpkg would have `src/std/` et al. rather than
`src/libstd/` et al. I have not endeavoured to change that at this point
as it would guarantee prompt bitrot and confusion. A change of that
magnitude needs to be discussed first.
2013-11-03 23:49:01 +11:00
bors b5c1b48048 auto merge of #10199 : alexcrichton/rust/no-propagate, r=brson
This commit removes the propagation of `link_args` attributes across crates. The first commit message has the reasons as to why. Additionally, this starts statically linking some C/C++ helper libraries that we have to their respective crates instead of throwing then in librustrt and then having everything depend on librustrt.

The major downside of this movement is that we're losing the ability to control visible symbols. I couldn't figure out a way to internalize symbols from a static library during the linking process, so everyone who links to librustdoc will be able to use its sundown implementation (not exactly ideal). I'm not entirely sure how to fix this (beyond generating a list of all public symbols, including rust ones, and passing that to the linker), but we may have a much easier time with this once we start using llvm's linker toolchain.

There's certainly a lot more possibilities in where this can go, but I didn't want to go too deep just yet. The main idea here is to stop propagating linker arguments and then see how we're able to start statically linking libraries as a result.

r? @catamorphism, you're going to be working on linking soon, so feel free to completely throw this away for something else!
2013-11-02 22:16:02 -07:00
Alex Crichton 0ce1b2f04d Statically link libuv to librustuv
Similarly to the previous commit, libuv is only used by this library, so there's
no need for it to be linked into librustrt and available to all crates by
default.
2013-11-02 21:28:17 -07:00
bors 9ec4c1851a auto merge of #10229 : brson/rust/warnings, r=thestinger
In Rust we don't like capital letters.
2013-11-02 00:51:12 -07:00
Alex Crichton 7f31b079e5 Statically link sundown to librustdoc
Closes #10103
2013-11-01 21:28:48 -07:00
Brian Anderson 758af60334 Fix installation with DESTDIR 2013-11-01 20:23:22 -07:00
Brian Anderson e9605dc0c9 Use consistent capitalization in makefile errors
In Rust we don't like capital letters.
2013-11-01 15:28:12 -07:00
bors 8ea2123055 auto merge of #10220 : luqmana/rust/con, r=brson
Previously we were actually overwriting `CFG_{HOST,TARGET,BUILD}` with `CFG_{HOST,TARGET,BUILD}_TRIPLE(S)` since configure tested for the legacy one by checking if it was empty which would never be the case. That meant it wouldn't split up multiple triples and just treat it as one long triple.

This pull also fixes the rules that were changed when librustuv was added to use the right CFG_ vars and removes the legacy flags.
2013-11-01 12:46:21 -07:00
bors fa8a202858 auto merge of #10203 : kud1ing/rust/ios, r=alexcrichton
This is based on the work by @dobkeratops, updated and extended to work for Xcode 5.

This gets you going. I will add separate PRs for compilation/linking fixes.
See also https://github.com/mozilla/rust/wiki/Doc-building-for-ios
2013-11-01 02:26:23 -07:00
Luqman Aden 12222f9825 configure: Fix passing multiple target and host triples. 2013-11-01 03:34:16 -04:00
kud1ing 5864ad9ab1 add target triple arm-apple-darwin 2013-10-31 22:43:59 +01:00
Olivier Saut a6cd20bff9 Fix missing parenthesis in a previous substitution '$(PREFIX_ROOT)' to '$(CFG_MANDIR' on 1c4a348b07 2013-10-31 11:33:02 +01:00
bors c888fc6db2 auto merge of #10164 : brson/rust/configure, r=brson
Rebase of #9990
2013-10-30 21:06:33 -07:00
bors 5e1a691125 auto merge of #9613 : jld/rust/enum-discrim-size.r0, r=alexcrichton
Allows an enum with a discriminant to use any of the primitive integer types to store it.  By default the smallest usable type is chosen, but this can be overridden with an attribute: `#[repr(int)]` etc., or `#[repr(C)]` to match the target's C ABI for the equivalent C enum.

Also adds a lint pass for using non-FFI safe enums in extern declarations, checks that specified discriminants can be stored in the specified type if any, and fixes assorted code that was assuming int.
2013-10-30 00:31:23 -07:00
Heather 1c4a348b07 Correct prefix / CFG_PREFIX work in configure / install.mk 2013-10-29 16:22:57 -07:00
Heather 8a593a8bdb support for GNU configure syntax 2013-10-29 16:22:08 -07:00
Alex Crichton e203f30bc7 Register new snapshots 2013-10-29 15:56:16 -07:00
Jed Davis c0190a9cfb Prevent unoptimized rustpkg tests from running out of stack.
The actual fix would be to make rustpkg use `rustc::monitor` so it picks
up anything special that rustc needs, but for now let's keep the tests
from breaking.
2013-10-29 09:09:20 -07:00
Alex Crichton 201cab84e8 Move rust's uv implementation to its own crate
There are a few reasons that this is a desirable move to take:

1. Proof of concept that a third party event loop is possible
2. Clear separation of responsibility between rt::io and the uv-backend
3. Enforce in the future that the event loop is "pluggable" and replacable

Here's a quick summary of the points of this pull request which make this
possible:

* Two new lang items were introduced: event_loop, and event_loop_factory.
  The idea of a "factory" is to define a function which can be called with no
  arguments and will return the new event loop as a trait object. This factory
  is emitted to the crate map when building an executable. The factory doesn't
  have to exist, and when it doesn't then an empty slot is in the crate map and
  a basic event loop with no I/O support is provided to the runtime.

* When building an executable, then the rustuv crate will be linked by default
  (providing a default implementation of the event loop) via a similar method to
  injecting a dependency on libstd. This is currently the only location where
  the rustuv crate is ever linked.

* There is a new #[no_uv] attribute (implied by #[no_std]) which denies
  implicitly linking to rustuv by default

Closes #5019
2013-10-29 08:39:22 -07:00
bors bee40a9f98 auto merge of #10094 : alexcrichton/rust/issue-8704, r=pcwalton
This drops more of the old C++ runtime to rather be written in rust. A few
features were lost along the way, but hopefully not too many. The main loss is
that there are no longer backtraces associated with allocations (rust doesn't
have a way of acquiring those just yet). Other than that though, I believe that
the rest of the debugging utilities made their way over into rust.

Closes #8704
2013-10-28 06:41:40 -07:00
Alex Crichton 357ef1f69c Rewrite boxed_region/memory_region in Rust
This drops more of the old C++ runtime to rather be written in rust. A few
features were lost along the way, but hopefully not too many. The main loss is
that there are no longer backtraces associated with allocations (rust doesn't
have a way of acquiring those just yet). Other than that though, I believe that
the rest of the debugging utilities made their way over into rust.

Closes #8704
2013-10-26 01:10:39 -07:00
Igor Bukanov 47fff53597 rust / build: make install should use explicit permissions when creating directories
Closes #10046
2013-10-24 10:23:12 +02:00
Tim Chevalier c97957588b rustpkg: Support arbitrary dependencies in the install API
api::install_pkg now accepts an argument that's a list of
(kind, path) dependency pairs. This allows custom package scripts to
declare C dependencies, as is demonstrated in
rustpkg::tests::test_c_dependency_ok.

Closes #6403
2013-10-22 20:41:29 -07:00
bors b477f7a7b7 auto merge of #10013 : bdash/rust/mavericks-unwinding, r=alexcrichton
OS X 10.9's linker has a bug that results in it failing to preserve
DWARF unwind information when passed the -no_compact_unwind flag.
This flag is passed on OS X because the unwind information for
__morestack cannot be represented by the compact unwind format.

We can work around this problem by using a more targeted approach
to disabling compact unwind information. The OS X linker looks for
a particular pattern in the DWARF unwind information and will not
attempt to convert the unwind information to the compact format.
The pattern in question is the return address register being saved
twice to the same location.

Fixes #6849.
2013-10-22 13:46:25 -07:00
Mark Rowe fd8c06e7b5 Fix unwinding on OS X 10.9.
OS X 10.9's linker has a bug that results in it failing to preserve
DWARF unwind information when passed the -no_compact_unwind flag.
This flag is passed on OS X because the unwind information for
__morestack cannot be represented by the compact unwind format.

We can work around this problem by using a more targeted approach
to disabling compact unwind information. The OS X linker looks for
a particular pattern in the DWARF unwind information and will not
attempt to convert the unwind information to the compact format.
The pattern in question is the return address register being saved
twice to the same location.

Fixes #6849.
2013-10-22 03:02:25 -07:00
bors 886a4ddcec auto merge of #9992 : astrieanna/rust/rm_rusti, r=alexcrichton
It seems like rusti has been removed, except for one reference in one Makefile. This reference breaks building rust on my computer because the "all-target" rule has rusti as a target.

~~~~
make: *** No rule to make target `x86_64-unknown-linux-gnu/stage2/bin/rusti', needed by `all-target-x86_64-unknown-linux-gnu-host-x86_64-unknown-linux-gnu'.  Stop.
~~~~

Removing this line fixes things for me.
2013-10-21 21:41:25 -07:00
Leah Hanson 9ced953b12 Remove rusti reference from pp.mk 2013-10-21 10:57:20 -05:00
Adrien Tétar 8d97db48d4 doc: tidy and cleanup CSS deps, add tutorial PDF generation 2013-10-21 04:12:12 +02:00
Adrien Tétar f69795e443 doc: switch pandoc to html5 2013-10-19 20:29:34 +02:00
bors 31a209ca42 auto merge of #9834 : alexcrichton/rust/morestack, r=brson
This commit re-introduces the functionality of __morestack in a way that it was
not originally anticipated. Rust does not currently have segmented stacks,
rather just large stack segments. We do not detect when these stack segments are
overrun currently, but this commit leverages __morestack in order to check this.

This commit purges a lot of the old __morestack and stack limit C++
functionality, migrating the necessary chunks to rust. The stack limit is now
entirely maintained in rust, and the "main logic bits" of __morestack are now
also implemented in rust as well.

I put my best effort into validating that this currently builds and runs successfully on osx and linux 32/64 bit, but I was unable to get this working on windows. We never did have unwinding through __morestack frames, and although I tried poking at it for a bit, I was unable to understand why we don't get unwinding right now.

A focus of this commit is to implement as much of the logic in rust as possible. This involved some liberal usage of `no_split_stack` in various locations, along with some use of the `asm!` macro (scary). I modified a bit of C++ to stop calling `record_sp_limit` because this is no longer defined in C++, rather in rust.

Another consequence of this commit is that `thread_local_storage::{get, set}` must both be flagged with `#[rust_stack]`. I've briefly looked at the implementations on osx/linux/windows to ensure that they're pretty small stacks, and I'm pretty sure that they're definitely less than 20K stacks, so we probably don't have a lot to worry about.

Other things worthy of note:
* The default stack size is now 4MB instead of 2MB. This is so that when we request 2MB to call a C function you don't immediately overflow because you have consumed any stack at all.
* `asm!` is actually pretty cool, maybe we could actually define context switching with it?
* I wanted to add links to the internet about all this jazz of storing information in TLS, but I was only able to find a link for the windows implementation. Otherwise my suggestion is just "disassemble on that arch and see what happens"
* I put my best effort forward on arm/mips to tweak __morestack correctly, we have no ability to test this so an extra set of eyes would be useful on these spots.
* This is all really tricky stuff, so I tried to put as many comments as I thought were necessary, but if anything is still unclear (or I completely forgot to take something into account), I'm willing to write more!
2013-10-19 09:46:18 -07:00
Alex Crichton 6d8330afb6 Use __morestack to detect stack overflow
This commit resumes management of the stack boundaries and limits when switching
between tasks. This additionally leverages the __morestack function to run code
on "stack overflow". The current behavior is to abort the process, but this is
probably not the best behavior in the long term (for deails, see the comment I
wrote up in the stack exhaustion routine).
2013-10-19 09:43:31 -07:00
Alex Crichton 90911d7259 Remove jemalloc from the runtime
As discovered in #9925, it turns out that we weren't using jemalloc on most
platforms. Additionally, on some platforms we were using it incorrectly and
mismatching the libc version of malloc with the jemalloc version of malloc.

Additionally, it's not clear that using jemalloc is indeed a large performance
win in particular situtations. This could be due to building jemalloc
incorrectly, or possibly due to using jemalloc incorrectly, but it is unclear at
this time.

Until jemalloc can be confirmed to integrate correctly on all platforms and has
verifiable large performance wins on platforms as well, it shouldn't be part of
the default build process. It should still be available for use via the
LD_PRELOAD trick on various architectures, but using it as the default allocator
for everything would require guaranteeing that it works in all situtations,
which it currently doesn't.

Closes #9925
2013-10-18 10:38:21 -07:00
bors 386fa1d818 auto merge of #9897 : thestinger/rust/rusti, r=alexcrichton
Closes #9818
Closes #9567
Closes #8924
Closes #8910
Closes #8392
Closes #7692
Closes #7499
Closes #7220
Closes #5038
2013-10-17 01:36:33 -07:00
Daniel Micay f766acad62 drop the linenoise library
Closes #5038
2013-10-16 22:57:51 -04:00
Daniel Micay 7c92435f8f remove the rusti command
Closes #9818
Closes #9567
Closes #8924
Closes #8910
Closes #8392
Closes #7692
Closes #7499
Closes #7220
2013-10-16 22:54:38 -04:00
Alex Crichton 6969e5fb58 Allow stage0 warnings 2013-10-16 11:53:05 -07:00
Tim Chevalier a9dddbacde rust / build: Remove the `rust` tool
Sadly, there's a lack of resources for maintaining the `rust` tool,
and we decided in the 2013-10-08 Rust team meeting that it's better
to remove it altogether than to leave it in a broken state.

This deletion is without prejudice. If a person or people appear who
would like to maintain the tool, we will probably be happy to
resurrect it!

Closes #9775
2013-10-10 14:36:06 -07:00
Huon Wilson 29e3b33a09 std::rand: make the windows OSRng more correct, remove some C++.
This lets the C++ code in the rt handle the (slightly) tricky parts of
random number generation: e.g. error detection/handling, and using the
values of the `#define`d options to the various functions.
2013-10-09 22:22:42 +11:00
Alex Crichton d858360483 Build libuv/jemalloc only once (not per stage)
Reorganize the makefiles to stop building these once per stage because there's
no need to do this at all.

Closes #7002
2013-10-08 14:26:56 -07:00
bors 8bb55dbf21 auto merge of #9662 : vadimcn/rust/package-runtime-deps, r=brson
This will make sure that system files that rust binaries depend on in Windows get packaged into stage0 snapshots as well as into Windows installer.
Currently these include `libgcc_s_dw2-1.dll`, `libstdc++-6.dll` and `libpthread-2.dll`.   Note that the latter will need to be changed to `pthreadGC2.dll` once Windows build bots get upgraded to mingw 4.0

Closes #9252
Closes #5878
Closes #9218
Closes #5712
2013-10-04 07:11:37 -07:00
Vadim Chugunov 4e59ab097a Package system runtime dependencies into Windows distribution. 2013-10-02 11:40:50 -07:00
bors 0dce112af7 auto merge of #9636 : alexcrichton/rust/rustdoc, r=huonw
Commits have all the juicy details.

Import thing to note in this pull request is that `rustdoc html crate.rs` becomes `rustdoc crate.rs`
2013-10-01 04:31:31 -07:00
bors f6df7ab839 auto merge of #9617 : crabtw/rust/softfp, r=alexcrichton
This change adds --soft-float option for generating
software floating point library calls.
It also implies using soft float ABI, that is the same as llc.

It is useful for targets that have no FPU.
2013-09-30 23:51:31 -07:00
Alex Crichton e523f99fb9 rustdoc: Add the ability to input json
This modifies the command-line usage of rustdoc to intake its own JSON output as
well as a rust source file. This also alters the command line from
`rustdoc input file`  to `rustdoc file` with the input/output formats specified
as -r and -w, respectively.

When using a JSON input, no passes or plugins are re-run over the json, instead
the output is generated directly from the JSON that was provided. Passes and
plugins are still run on rust source input, however.
2013-09-30 20:31:19 -07:00
Jyun-Yan You 350b5438cd add -Z soft-float option
This change adds -Z soft-float option for generating
software floating point library calls.
It also implies using soft float ABI, that is the same as llc.

It is useful for targets that have no FPU.
2013-10-01 11:19:18 +08:00
Alex Crichton d29b3ac8a7 Expand tidy to prevent binaries from being checked
Closes #9621
2013-09-30 10:15:47 -07:00
bors 92e7bb67a8 auto merge of #9542 : pnkfelix/rust/fsk-fix-issue-9531, r=thestinger
r? strcat 

(please double check that it fixes things on your chroot, if possible, before approval)

Fix #9531
2013-09-28 15:01:38 -07:00
bors 9cc11ca6a3 auto merge of #9577 : alexcrichton/rust/rustdoc, r=cmr
They're getting smaller each time though!

The highlight of this round is source files in documentation. Still trying to figure out the best syntax-highlighting solution.
2013-09-28 13:46:11 -07:00
Alex Crichton 8973d7c3f5 mk: Don't require pandoc to run rustdoc 2013-09-27 16:54:45 -07:00
bors 76e8f0828a auto merge of #9544 : alexcrichton/rust/clean-docs, r=pnkfelix
This purges doc/{std,extra} entirely during a `make clean` instead of just the
html files in some top level directories. This should help old documentation
from showing up on static.rust-lang.org
2013-09-27 11:11:06 -07:00
Alex Crichton d8db96cbbf mk: Fully clean out old documentation
This purges doc/{std,extra} entirely during a `make clean` instead of just the
html files in some top level directories. This should help old documentation
from showing up on static.rust-lang.org
2013-09-27 11:09:30 -07:00
Felix S. Klock II 2835df2db6 Fix for make -j race from #9531 injected by cleanup in b1a22518f0. 2013-09-26 23:56:53 +02:00
Alex Crichton 6aba140fa7 rustdoc: Add sundown to src/rt/
This also starts compiling it in the same manner as linenoise, it's just bundled
with librustrt directly, and we export just a few symbols out of it.
2013-09-25 14:27:41 -07:00
Steve Klabnik 06b11ba172 Add rustpkg tutorial to the official tutorials.
Three things in this commit:

1. Actually build the rustpkg tutorial. I didn't know I needed this when
   I first wrote it.
2. Link to it rather than the manual from the
   tutorial.
3. Update the headers: most of them were one level too deeply
   nested.
2013-09-23 14:36:38 -07:00
Alex Crichton 83499d1a89 Place *all* rustdoc output in doc/{crate} 2013-09-22 20:09:42 -07:00
Alex Crichton 7b24efd6f3 rustdoc: Out with the old, in with the new
Removes old rustdoc, moves rustdoc_ng into its place instead (plus drops the _ng
suffix). Also shreds all reference to rustdoc_ng from the Makefile rules.
2013-09-22 09:51:15 -07:00
Huon Wilson 0951313c1e Remove the C(++) ISAAC Rng from the old rt.
This has to leave rust_gen_seed and rng_gen_seed around since they're
used to initialise the std::rand RNGs.
2013-09-23 00:11:43 +10:00
Alex Crichton 02b27b2998 Fix the dependencies of rustdoc_ng doc generation
This needs libstd in its proper location to resolve references when generating
docs for libextra.
2013-09-21 13:25:33 -07:00
Alex Crichton 4fd061c426 Implement a web backend for rustdoc_ng
This large commit implements and `html` output option for rustdoc_ng. The
executable has been altered to be invoked as "rustdoc_ng html <crate>" and
it will dump everything into the local "doc" directory. JSON can still be
generated by changing 'html' to 'json'.

This also fixes a number of bugs in rustdoc_ng relating to comment stripping,
along with some other various issues that I found along the way.

The `make doc` command has been altered to generate the new documentation into
the `doc/ng/$(CRATE)` directories.
2013-09-20 22:49:03 -07:00
Alex Crichton 833a64d76e Invert --cfg debug to --cfg ndebug
Many people will be very confused that their debug! statements aren't working
when they first use rust only to learn that they should have been building with
`--cfg debug` the entire time. This inverts the meaning of the flag to instead
of enabling debug statements, now it disables debug statements.

This way the default behavior is a bit more reasonable, and requires less
end-user configuration. Furthermore, this turns on debug by default when
building the rustc compiler.
2013-09-20 12:10:04 -07:00
bors 3c0013134c auto merge of #9280 : alexcrichton/rust/less-c++, r=brson
Some of the functions could be converted to rust, but the functions dealing with
signals were moved to rust_builtin.cpp instead (no reason to keep the original
file around for one function).

Closes #2674

Because less C++ is better C++!
2013-09-18 22:15:59 -07:00
Alex Crichton c3ad785d83 Remove rust_run_program.cpp
Some of the functions could be converted to rust, but the functions dealing with
signals were moved to rust_builtin.cpp instead (no reason to keep the original
file around for one function).

Closes #2674
2013-09-18 20:58:56 -07:00
bors b43ee6cd2e auto merge of #9277 : crabtw/rust/mips, r=brson
This patch fixes some errors of MIPS target, however, MIPS C ABI is still broken. I will send another PR to fix the problem.

Because MIPS target has no "generic" CPU name, I add --target-cpu and --target-feature to RUST_FLAGS. In order to workaround the "compact frame descriptions incompatible with DWARF2 .eh_frame" problem, the linker I used is CXX but not CC.
2013-09-18 09:15:56 -07:00
bors adb638f54d auto merge of #9254 : vadimcn/rust/fix-mingw-v4, r=brson
Fix Rust build on mingw v4.0
See #9246 for details.
2013-09-18 02:25:57 -07:00
Jyun-Yan You d11f746cc1 fix compilation errors of mips target 2013-09-18 10:10:32 +08:00
bors f45c6406bc auto merge of #9241 : alexcrichton/rust/build-rustdoc-ng, r=catamorphism
Now rustdoc_ng will be built as both a binary and a library (using the same
rules as all the other binaries that rust has). Furthermore, this will also
start building rustdoc_ng unit tests (and running them).

Note that some `rustdoc_ng` tests were removed, but @cmr says they weren't supposed to be there in the first place. The rustdoc_ng code should also be included in `make install` and `make dist` now.
2013-09-17 06:00:45 -07:00
Vadim Chugunov c3fd430603 The purpose of these headers is to fix issues with mingw v4.0, as described in #9246.
This works by adding this directory to GCC include search path before mingw system headers directories,
so we can intercept their inclusions and add missing definitions without having to modify files in mingw/include.
2013-09-17 01:06:01 -07:00
Alex Crichton 876cb76f1b Add the rustdoc_ng binary to the makefile rules
Now rustdoc_ng will be built as both a binary and a library (using the same
rules as all the other binaries that rust has). Furthermore, this will also
start building rustdoc_ng unit tests (and running them).
2013-09-16 18:10:46 -07:00
Brian Anderson 4c49a3d8cd mk: Fix valgrinding with jemalloc
This fixes valgrind on the linux snapshot bot. The command added here
makes us require a fairly recent valgrind.
2013-09-16 15:29:46 -07:00