Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 15 pull requests #37670

Merged
merged 39 commits into from
Nov 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
47515ad
rustdoc: mark unsafe fns with icons
liigo Oct 24, 2016
955829c
Add documentation to write! and writeln! on using both io::Write and …
joshtriplett Oct 29, 2016
40c2c0f
Include type of missing trait methods in error
estebank Oct 24, 2016
b1a3f88
Print more tags in rustdoc
GuillaumeGomez Oct 12, 2016
a96247b
Set possibility to hide attributes
GuillaumeGomez Nov 6, 2016
22dad4b
Improve attributes display and allow expansion
GuillaumeGomez Nov 6, 2016
520d5f4
Set attributes hidden by default
GuillaumeGomez Nov 6, 2016
d377cf5
Rename KNOWN_ATTRS to BUILT_ATTRS, and create KNOWN_ATTRS
keeperofdakeys Nov 7, 2016
4b20221
save-analysis: don't choke on stripped doc attributes
nrc Nov 8, 2016
eca1cc9
Add FxHasher, a faster alternative to FnvHasher.
nnethercote Nov 8, 2016
00e48af
Replace FnvHasher use with FxHasher.
nnethercote Nov 8, 2016
31a508e
Allow proc_macro functions to whitelist specific attributes
keeperofdakeys Nov 8, 2016
134ef4f
Revert "Point macros 1.1 errors to the input item"
keeperofdakeys Nov 8, 2016
c2a1c7f
Change description of no-stack-check (#34915)
abhijeetbhagat Aug 1, 2016
c670293
Adding a deprecation warning for no-stack-check codegen option.
karpinski Nov 7, 2016
319f46f
rustbuild: Vendor all dependencies
alexcrichton Nov 1, 2016
31a8638
rustbuild: Tweak for vendored dependencies
alexcrichton Nov 1, 2016
18f5f99
Slightly optimise CString
ollie27 Nov 8, 2016
ab5ba04
Partially stabilize RFC 1506 "Clarify relationships between ADTs"
petrochenkov Sep 14, 2016
f2ff985
Add missing urls and few local rewrites
GuillaumeGomez Nov 7, 2016
f7d2a81
ICH: Add test case for let-expressions.
michaelwoerister Nov 8, 2016
5d186d0
ICH: Add test case for match-expressions
michaelwoerister Nov 8, 2016
3edb4fc
Point to type argument span when used as trait
estebank Oct 27, 2016
50bfc23
Clarify that send_to might return an error in certain cases
achanda Oct 27, 2016
f433209
Rollup merge of #36868 - petrochenkov:adtstab, r=nikomatsakis
eddyb Nov 9, 2016
2321d11
Rollup merge of #37134 - GuillaumeGomez:display_tag, r=steveklabnik
eddyb Nov 9, 2016
dc8ac26
Rollup merge of #37229 - nnethercote:FxHasher, r=nikomatsakis
eddyb Nov 9, 2016
6c7b433
Rollup merge of #37250 - liigo:rustdoc-unsafe-fns, r=steveklabnik
eddyb Nov 9, 2016
7f2853f
Rollup merge of #37370 - estebank:signature-2-empire-strikes-back, r=…
eddyb Nov 9, 2016
bd9969f
Rollup merge of #37428 - estebank:generic-type-error-span, r=sanxiyn
eddyb Nov 9, 2016
d712882
Rollup merge of #37432 - achanda:send_to, r=alexcrichton
eddyb Nov 9, 2016
e10e49d
Rollup merge of #37472 - joshtriplett:doc-fmt-write-io-write, r=brson
eddyb Nov 9, 2016
3d2ffa0
Rollup merge of #37524 - alexcrichton:vendor, r=brson
eddyb Nov 9, 2016
5ebd7c5
Rollup merge of #37614 - keeperofdakeys:proc_macro, r=jseyfried
eddyb Nov 9, 2016
aad4f29
Rollup merge of #37622 - ollie27:cstring, r=alexcrichton
eddyb Nov 9, 2016
e0894ca
Rollup merge of #37627 - GuillaumeGomez:missing_urls_bis, r=frewsxcv
eddyb Nov 9, 2016
3292f40
Rollup merge of #37636 - karpinski:issue-34915, r=nikomatsakis
eddyb Nov 9, 2016
a41a87e
Rollup merge of #37644 - nrc:save-derive-span, r=eddyb
eddyb Nov 9, 2016
60c74b7
Rollup merge of #37654 - michaelwoerister:test-let-ich, r=nikomatsakis
eddyb Nov 9, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
src/etc/pkg/rust-logo.ico binary
src/etc/pkg/rust-logo.png binary
*.woff binary
src/vendor/* binary
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,4 @@ tmp.*.rs
version.md
version.ml
version.texi
.cargo
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ before_install:
script:
- docker run -v `pwd`:/build rust
sh -c "
./configure --enable-rustbuild --llvm-root=/usr/lib/llvm-3.7 --enable-quiet-tests &&
./configure --enable-vendor --enable-rustbuild --llvm-root=/usr/lib/llvm-3.7 --enable-quiet-tests &&
make tidy &&
make check -j4
"
Expand Down
1 change: 1 addition & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ opt rustbuild 0 "use the rust and cargo based build system"
opt codegen-tests 1 "run the src/test/codegen tests"
opt option-checking 1 "complain about unrecognized options in this configure script"
opt ninja 0 "build LLVM using the Ninja generator (for MSVC, requires building in the correct environment)"
opt vendor 0 "enable usage of vendored Rust crates"

# Optimization and debugging options. These may be overridden by the release channel, etc.
opt_nosave optimize 1 "build optimized rust code"
Expand Down
3 changes: 2 additions & 1 deletion mk/dist.mk
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ PKG_FILES := \
stage0.txt \
rust-installer \
tools \
test) \
test \
vendor) \
$(PKG_GITMODULES) \
$(filter-out config.stamp, \
$(MKFILES_FOR_TARBALL))
Expand Down
69 changes: 0 additions & 69 deletions src/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions src/bootstrap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ num_cpus = "0.2"
toml = "0.1"
getopts = "0.2"
rustc-serialize = "0.3"
gcc = "0.3.36"
gcc = "0.3.38"
libc = "0.2"
md5 = "0.1"

[target.'cfg(windows)'.dependencies]
winapi = "0.2"
kernel32-sys = "0.2"
27 changes: 24 additions & 3 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,11 @@ def build_bootstrap(self):
env["DYLD_LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib")
env["PATH"] = os.path.join(self.bin_root(), "bin") + \
os.pathsep + env["PATH"]
self.run([self.cargo(), "build", "--manifest-path",
os.path.join(self.rust_root, "src/bootstrap/Cargo.toml")],
env)
args = [self.cargo(), "build", "--manifest-path",
os.path.join(self.rust_root, "src/bootstrap/Cargo.toml")]
if self.use_vendored_sources:
args.append("--frozen")
self.run(args, env)

def run(self, args, env):
proc = subprocess.Popen(args, env=env)
Expand Down Expand Up @@ -400,6 +402,25 @@ def main():
except:
pass

rb.use_vendored_sources = '\nvendor = true' in rb.config_toml or \
'CFG_ENABLE_VENDOR' in rb.config_mk

if rb.use_vendored_sources:
if not os.path.exists('.cargo'):
os.makedirs('.cargo')
f = open('.cargo/config','w')
f.write("""
[source.crates-io]
replace-with = 'vendored-sources'
registry = 'https://example.com'
[source.vendored-sources]
directory = '{}/src/vendor'
""".format(rb.rust_root))
f.close()
else:
if os.path.exists('.cargo'):
shutil.rmtree('.cargo')
data = stage0_data(rb.rust_root)
rb._rustc_channel, rb._rustc_date = data['rustc'].split('-', 1)
rb._cargo_channel, rb._cargo_date = data['cargo'].split('-', 1)
Expand Down
4 changes: 4 additions & 0 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ pub struct Config {
pub submodules: bool,
pub compiler_docs: bool,
pub docs: bool,
pub vendor: bool,
pub target_config: HashMap<String, Target>,

// llvm codegen options
Expand Down Expand Up @@ -126,6 +127,7 @@ struct Build {
docs: Option<bool>,
submodules: Option<bool>,
gdb: Option<String>,
vendor: Option<bool>,
}

/// TOML representation of how the LLVM build is configured.
Expand Down Expand Up @@ -234,6 +236,7 @@ impl Config {
set(&mut config.compiler_docs, build.compiler_docs);
set(&mut config.docs, build.docs);
set(&mut config.submodules, build.submodules);
set(&mut config.vendor, build.vendor);

if let Some(ref llvm) = toml.llvm {
set(&mut config.ccache, llvm.ccache);
Expand Down Expand Up @@ -347,6 +350,7 @@ impl Config {
("LOCAL_REBUILD", self.local_rebuild),
("NINJA", self.ninja),
("CODEGEN_TESTS", self.codegen_tests),
("VENDOR", self.vendor),
}

match key {
Expand Down
3 changes: 3 additions & 0 deletions src/bootstrap/config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@
# The path to (or name of) the GDB executable to use
#gdb = "gdb"

# Indicate whether the vendored sources are used for Rust dependencies or not
#vendor = false

# =============================================================================
# Options for compiling Rust code itself
# =============================================================================
Expand Down
75 changes: 71 additions & 4 deletions src/bootstrap/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,82 @@
//! Note that this module has a #[cfg(windows)] above it as none of this logic
//! is required on Unix.

extern crate kernel32;
extern crate winapi;
#![allow(bad_style, dead_code)]

use std::env;
use std::io;
use std::mem;

use self::winapi::*;
use self::kernel32::*;
type HANDLE = *mut u8;
type BOOL = i32;
type DWORD = u32;
type LPHANDLE = *mut HANDLE;
type LPVOID = *mut u8;
type JOBOBJECTINFOCLASS = i32;
type SIZE_T = usize;
type LARGE_INTEGER = i64;
type ULONG_PTR = usize;
type ULONGLONG = u64;

const FALSE: BOOL = 0;
const DUPLICATE_SAME_ACCESS: DWORD = 0x2;
const PROCESS_DUP_HANDLE: DWORD = 0x40;
const JobObjectExtendedLimitInformation: JOBOBJECTINFOCLASS = 9;
const JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE: DWORD = 0x2000;

extern "system" {
fn CreateJobObjectW(lpJobAttributes: *mut u8, lpName: *const u8) -> HANDLE;
fn CloseHandle(hObject: HANDLE) -> BOOL;
fn GetCurrentProcess() -> HANDLE;
fn OpenProcess(dwDesiredAccess: DWORD,
bInheritHandle: BOOL,
dwProcessId: DWORD) -> HANDLE;
fn DuplicateHandle(hSourceProcessHandle: HANDLE,
hSourceHandle: HANDLE,
hTargetProcessHandle: HANDLE,
lpTargetHandle: LPHANDLE,
dwDesiredAccess: DWORD,
bInheritHandle: BOOL,
dwOptions: DWORD) -> BOOL;
fn AssignProcessToJobObject(hJob: HANDLE, hProcess: HANDLE) -> BOOL;
fn SetInformationJobObject(hJob: HANDLE,
JobObjectInformationClass: JOBOBJECTINFOCLASS,
lpJobObjectInformation: LPVOID,
cbJobObjectInformationLength: DWORD) -> BOOL;
}

#[repr(C)]
struct JOBOBJECT_EXTENDED_LIMIT_INFORMATION {
BasicLimitInformation: JOBOBJECT_BASIC_LIMIT_INFORMATION,
IoInfo: IO_COUNTERS,
ProcessMemoryLimit: SIZE_T,
JobMemoryLimit: SIZE_T,
PeakProcessMemoryUsed: SIZE_T,
PeakJobMemoryUsed: SIZE_T,
}

#[repr(C)]
struct IO_COUNTERS {
ReadOperationCount: ULONGLONG,
WriteOperationCount: ULONGLONG,
OtherOperationCount: ULONGLONG,
ReadTransferCount: ULONGLONG,
WriteTransferCount: ULONGLONG,
OtherTransferCount: ULONGLONG,
}

#[repr(C)]
struct JOBOBJECT_BASIC_LIMIT_INFORMATION {
PerProcessUserTimeLimit: LARGE_INTEGER,
PerJobUserTimeLimit: LARGE_INTEGER,
LimitFlags: DWORD,
MinimumWorkingsetSize: SIZE_T,
MaximumWorkingsetSize: SIZE_T,
ActiveProcessLimit: DWORD,
Affinity: ULONG_PTR,
PriorityClass: DWORD,
SchedulingClass: DWORD,
}

pub unsafe fn setup() {
// Create a new job object for us to use
Expand Down
3 changes: 3 additions & 0 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,9 @@ impl Build {
if self.config.rust_optimize {
cargo.arg("--release");
}
if self.config.vendor {
cargo.arg("--frozen");
}
return cargo
}

Expand Down
Loading