Skip to content

Commit 7c6b900

Browse files
author
Elly Jones
committed
---
yaml --- r: 6898 b: refs/heads/master c: bbc534b h: refs/heads/master v: v3
1 parent 9b0ea6b commit 7c6b900

File tree

6 files changed

+33
-7
lines changed

6 files changed

+33
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: dedfef4c4c7a5e2d3f36d4301bfd9f7e1af21640
2+
refs/heads/master: bbc534bcccfc1904104a1fa275a6a873a7675cd1

trunk/src/cargo/cargo.rs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ type package = {
3131
uuid: str,
3232
url: str,
3333
method: str,
34+
ref: option::t<str>,
3435
tags: [str]
3536
};
3637

@@ -242,6 +243,11 @@ fn load_one_source_package(&src: source, p: map::hashmap<str, json::json>) {
242243
}
243244
};
244245

246+
let ref = alt p.find("ref") {
247+
some(json::string(_n)) { some(_n) }
248+
_ { none }
249+
};
250+
245251
let tags = [];
246252
alt p.find("tags") {
247253
some(json::list(js)) {
@@ -260,6 +266,7 @@ fn load_one_source_package(&src: source, p: map::hashmap<str, json::json>) {
260266
uuid: uuid,
261267
url: url,
262268
method: method,
269+
ref: ref,
263270
tags: tags
264271
});
265272
log " Loaded package: " + src.name + "/" + name;
@@ -398,8 +405,14 @@ fn install_source(c: cargo, path: str) {
398405
}
399406
}
400407

401-
fn install_git(c: cargo, wd: str, url: str) {
408+
fn install_git(c: cargo, wd: str, url: str, ref: option::t<str>) {
402409
run::run_program("git", ["clone", url, wd]);
410+
if option::is_some::<str>(ref) {
411+
let r = option::get::<str>(ref);
412+
fs::change_dir(wd);
413+
run::run_program("git", ["checkout", r]);
414+
}
415+
403416
install_source(c, wd);
404417
}
405418

@@ -424,7 +437,7 @@ fn install_file(c: cargo, wd: str, path: str) {
424437
fn install_package(c: cargo, wd: str, pkg: package) {
425438
info("Installing with " + pkg.method + " from " + pkg.url + "...");
426439
if pkg.method == "git" {
427-
install_git(c, wd, pkg.url);
440+
install_git(c, wd, pkg.url, pkg.ref);
428441
} else if pkg.method == "http" {
429442
install_curl(c, wd, pkg.url);
430443
} else if pkg.method == "file" {

trunk/src/cargo/sources.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"url": "https://raw.github.com/graydon/cargo-central/master/packages.json"
44
},
55
"elly": {
6-
"url": "https://raw.github.com/elly/rust-packages/master/packages.json",
6+
"url": "https://raw.github.com/elly/rust-packages/master/packages.json"
77
"sig": "https://raw.github.com/elly/rust-packages/master/packages.json.sig",
88
"key": "https://raw.github.com/elly/rust-packages/master/signing-key.gpg",
99
"keyfp": "4107 21C0 FF32 858F 61FF 33F6 E595 8E36 FDC8 EA00"

trunk/src/rt/rust_kernel.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,13 @@ rust_kernel::fail() {
150150

151151
rust_task_id
152152
rust_kernel::create_task(rust_task *spawner, const char *name) {
153-
scoped_lock with(_kernel_lock);
154153
rust_scheduler *thread = threads[isaac_rand(&rctx) % num_threads];
155154
rust_task *t = thread->create_task(spawner, name);
156-
t->user.id = max_id++;
157-
task_table.put(t->user.id, t);
155+
{
156+
scoped_lock with(_kernel_lock);
157+
t->user.id = max_id++;
158+
task_table.put(t->user.id, t);
159+
}
158160
return t->user.id;
159161
}
160162

trunk/src/rt/rust_task.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,16 @@ void rust_task::start()
397397
sched->lock.signal();
398398
}
399399

400+
void
401+
rust_task::grow(size_t n_frame_bytes)
402+
{
403+
// FIXME (issue #151): Just fail rather than almost certainly crashing
404+
// mysteriously later. The commented-out logic below won't work at all in
405+
// the presence of non-word-aligned pointers.
406+
abort();
407+
408+
}
409+
400410
// Only run this on the rust stack
401411
void
402412
rust_task::yield(size_t time_in_us, bool *killed) {

trunk/src/rt/rust_task.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ rust_task : public kernel_owned<rust_task>, rust_cond
138138
void start(uintptr_t spawnee_fn,
139139
uintptr_t args);
140140
void start();
141+
void grow(size_t n_frame_bytes);
141142
bool running();
142143
bool blocked();
143144
bool blocked_on(rust_cond *cond);

0 commit comments

Comments
 (0)