Skip to content

Commit

Permalink
Rename pkgid to crate_id
Browse files Browse the repository at this point in the history
Closes #11035
  • Loading branch information
emberian committed Dec 19, 2013
1 parent b6933f8 commit dee1107
Show file tree
Hide file tree
Showing 60 changed files with 72 additions and 56 deletions.
1 change: 1 addition & 0 deletions src/etc/combine-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def scrub(b):
c.write(
"""
// AUTO-GENERATED FILE: DO NOT EDIT
#[crate_id=\"run_pass_stage2#0.1\"];
#[pkgid=\"run_pass_stage2#0.1\"];
#[link(name=\"run_pass_stage2\", vers=\"0.1\")];
#[feature(globs, macro_rules, struct_variant, managed_boxes)];
Expand Down
2 changes: 2 additions & 0 deletions src/libextra/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ Rust extras are part of the standard Rust distribution.
*/

// NOTE: remove after snapshot
#[pkgid = "extra#0.9-pre"];
#[crate_id = "extra#0.9-pre"];
#[comment = "Rust extras"];
#[license = "MIT/ASL2"];
#[crate_type = "rlib"];
Expand Down
2 changes: 2 additions & 0 deletions src/librustc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// NOTE: remove after snapshot
#[pkgid = "rustc#0.9-pre"];
#[crate_id = "rustc#0.9-pre"];
#[comment = "The Rust compiler"];
#[license = "MIT/ASL2"];
#[crate_type = "dylib"];
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/metadata/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1499,13 +1499,13 @@ fn synthesize_crate_attrs(ecx: &EncodeContext,

attr::mk_attr(
attr::mk_name_value_item_str(
@"pkgid",
@"crate_id",
ecx.link_meta.pkgid.to_str().to_managed()))
}

let mut attrs = ~[];
for attr in crate.attrs.iter() {
if "pkgid" != attr.name() {
if "crate_id" != attr.name() {
attrs.push(*attr);
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/librustc/middle/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,8 @@ fn check_heap_item(cx: &Context, it: &ast::item) {
}

static crate_attrs: &'static [&'static str] = &[
"crate_type", "feature", "no_uv", "no_main", "no_std", "pkgid",
// NOTE: remove pkgid after snapshot
"crate_type", "feature", "no_uv", "no_main", "no_std", "pkgid", "crate_id",
"desc", "comment", "license", "copyright", // not used in rustc now
];

Expand Down
2 changes: 2 additions & 0 deletions src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// NOTE: remove after snapshot
#[pkgid = "rustdoc#0.9-pre"];
#[crate_id = "rustdoc#0.9-pre"];
#[desc = "rustdoc, the Rust documentation extractor"];
#[license = "MIT/ASL2"];
#[crate_type = "dylib"];
Expand Down
2 changes: 2 additions & 0 deletions src/librustpkg/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

// rustpkg - a package manager and build system for Rust

// NOTE: remove after snapshot
#[pkgid = "rustpkg#0.9-pre"];
#[crate_id = "rustpkg#0.9-pre"];
#[license = "MIT/ASL2"];
#[crate_type = "dylib"];

Expand Down
6 changes: 3 additions & 3 deletions src/librustpkg/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1892,9 +1892,9 @@ fn pkgid_pointing_to_subdir() {
fs::mkdir_recursive(&foo_dir, io::UserRWX);
fs::mkdir_recursive(&bar_dir, io::UserRWX);
writeFile(&foo_dir.join("lib.rs"),
"#[pkgid=\"mockgithub.com/mozilla/some_repo/extras/foo\"]; pub fn f() {}");
"#[crate_id=\"mockgithub.com/mozilla/some_repo/extras/foo\"]; pub fn f() {}");
writeFile(&bar_dir.join("lib.rs"),
"#[pkgid=\"mockgithub.com/mozilla/some_repo/extras/bar\"]; pub fn g() {}");
"#[crate_id=\"mockgithub.com/mozilla/some_repo/extras/bar\"]; pub fn g() {}");

debug!("Creating a file in {}", workspace.display());
let testpkg_dir = workspace.join_many(["src", "testpkg-0.0"]);
Expand Down Expand Up @@ -2316,7 +2316,7 @@ fn find_sources_in_cwd() {
let source_dir = temp_dir.join("foo");
fs::mkdir_recursive(&source_dir, io::UserRWX);
writeFile(&source_dir.join("main.rs"),
"fn main() { let _x = (); }");
r#"#[crate_id="foo"]; fn main() { let _x = (); }"#);
command_line_test([~"install", ~"foo"], &source_dir);
assert_executable_exists(&source_dir.join(".rust"), "foo");
}
Expand Down
4 changes: 2 additions & 2 deletions src/librustpkg/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,10 @@ pub fn compile_input(context: &BuildContext,
});

// Inject the pkgid attribute so we get the right package name and version
if !attr::contains_name(crate.attrs, "pkgid") {
if !attr::contains_name(crate.attrs, "crate_id") {
// FIXME (#9639): This needs to handle non-utf8 paths
let pkgid_attr =
attr::mk_name_value_item_str(@"pkgid",
attr::mk_name_value_item_str(@"crate_id",
format!("{}\\#{}",
pkg_id.path.as_str().unwrap(),
pkg_id.version.to_str()).to_managed());
Expand Down
2 changes: 2 additions & 0 deletions src/librustuv/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ via `close` and `delete` methods.
*/

// NOTE: remove after snapshot
#[pkgid = "rustuv#0.9-pre"];
#[crate_id = "rustuv#0.9-pre"];
#[license = "MIT/ASL2"];
#[crate_type = "rlib"];
#[crate_type = "dylib"];
Expand Down
2 changes: 2 additions & 0 deletions src/libstd/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
//!
//! use std::prelude::*;
// NOTE: remove after snapshot
#[pkgid = "std#0.9-pre"];
#[crate_id = "std#0.9-pre"];
#[comment = "The Rust standard library"];
#[license = "MIT/ASL2"];
#[crate_type = "rlib"];
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ pub fn find_linkage_metas(attrs: &[Attribute]) -> ~[@MetaItem] {
}

pub fn find_pkgid(attrs: &[Attribute]) -> Option<PkgId> {
match first_attr_value_str_by_name(attrs, "pkgid") {
match first_attr_value_str_by_name(attrs, "crate_id") {
None => None,
Some(id) => from_str::<PkgId>(id),
}
Expand Down
2 changes: 2 additions & 0 deletions src/libsyntax/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
* macros.
*/

// NOTE: remove pkgid after snapshot
#[pkgid = "syntax#0.9-pre"];
#[crate_id = "syntax#0.9-pre"];
#[license = "MIT/ASL2"];
#[crate_type = "dylib"];
#[crate_type = "rlib"];
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/anon-extern-mod-cross-crate-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[pkgid="anonexternmod#0.1"];
#[crate_id="anonexternmod#0.1"];

use std::libc;

Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/cci_impl_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[pkgid="cci_impl_lib"];
#[crate_id="cci_impl_lib"];
// NOTE: remove after the next snapshot
#[link(name="cci_impl_lib", vers="0.0")];

Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/cci_iter_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[pkgid="cci_iter_lib"];
#[crate_id="cci_iter_lib"];
// NOTE: remove after the next snapshot
#[link(name="cci_iter_lib", vers="0.0")];

Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/cci_no_inline_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[pkgid="cci_no_inline_lib"];
#[crate_id="cci_no_inline_lib"];
// NOTE: remove after the next snapshot
#[link(name="cci_no_inline_lib", vers="0.0")];

Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// except according to those terms.

#[feature(managed_boxes)];
#[pkgid="crate_method_reexport_grrrrrrr2"];
#[crate_id="crate_method_reexport_grrrrrrr2"];
// NOTE: remove after the next snapshot
#[link(name = "crate_method_reexport_grrrrrrr2")];

Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/crateresolve1-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[pkgid="crateresolve1#0.1"];
#[crate_id="crateresolve1#0.1"];
// NOTE: remove after the next snapshot
#[link(name = "crateresolve1",
vers = "0.1")];
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/crateresolve1-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[pkgid="crateresolve1#0.2"];
#[crate_id="crateresolve1#0.2"];
// NOTE: remove after the next snapshot
#[link(name = "crateresolve1",
vers = "0.2")];
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/crateresolve1-3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[pkgid="crateresolve1#0.3"];
#[crate_id="crateresolve1#0.3"];
// NOTE: remove after the next snapshot
#[link(name = "crateresolve1",
vers = "0.3")];
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/crateresolve2-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[pkgid="crateresolve2#0.1"];
#[crate_id="crateresolve2#0.1"];
// NOTE: remove after the next snapshot
#[link(name = "crateresolve2",
vers = "0.1")];
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/crateresolve2-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[pkgid="crateresolve2#0.2"];
#[crate_id="crateresolve2#0.2"];
// NOTE: remove after the next snapshot
#[link(name = "crateresolve2",
vers = "0.2")];
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/crateresolve2-3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[pkgid="crateresolve2#0.3"];
#[crate_id="crateresolve2#0.3"];
// NOTE: remove after the next snapshot
#[link(name = "crateresolve2",
vers = "0.3")];
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/crateresolve3-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[pkgid="crateresolve3#0.1"];
#[crate_id="crateresolve3#0.1"];
// NOTE: remove after the next snapshot
#[link(name = "crateresolve3",
vers = "0.1")];
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/crateresolve3-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[pkgid="crateresolve3#0.2"];
#[crate_id="crateresolve3#0.2"];
// NOTE: remove after the next snapshot
#[link(name = "crateresolve3",
vers = "0.2")];
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/crateresolve4a-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[pkgid="crateresolve4a#0.1"];
#[crate_id="crateresolve4a#0.1"];
// NOTE: remove after the next snapshot
#[link(name = "crateresolve4a", vers = "0.1")];
#[crate_type = "lib"];
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/crateresolve4a-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[pkgid="crateresolve4a#0.2"];
#[crate_id="crateresolve4a#0.2"];
// NOTE: remove after the next snapshot
#[link(name = "crateresolve4a", vers= "0.2")];
#[crate_type = "lib"];
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/crateresolve4b-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// aux-build:crateresolve4a-1.rs
// aux-build:crateresolve4a-2.rs
#[pkgid="crateresolve4b#0.1"];
#[crate_id="crateresolve4b#0.1"];
// NOTE: remove after the next snapshot
#[link(name = "crateresolve4b", vers = "0.1")];
#[crate_type = "lib"];
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/crateresolve4b-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// aux-build:crateresolve4a-1.rs
// aux-build:crateresolve4a-2.rs
#[pkgid="crateresolve4b#0.2"];
#[crate_id="crateresolve4b#0.2"];
// NOTE: remove after the next snapshot
#[link(name = "crateresolve4b", vers = "0.2")];
#[crate_type = "lib"];
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/crateresolve5-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[pkgid="crateresolve5#0.1"];
#[crate_id="crateresolve5#0.1"];
// NOTE: remove after the next snapshot
#[link(name = "crateresolve5",
vers = "0.1")];
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/crateresolve5-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[pkgid="crateresolve5#0.2"];
#[crate_id="crateresolve5#0.2"];
// NOTE: remove after the next snapshot
#[link(name = "crateresolve5",
vers = "0.2")];
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/crateresolve8-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// except according to those terms.

// default link meta for 'package_id' will be equal to filestem
#[pkgid="crateresolve8#0.1"];
#[crate_id="crateresolve8#0.1"];
// NOTE: remove after the next snapshot
#[link(name = "crateresolve8",
vers = "0.1")];
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/crateresolve_calories-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[pkgid="crateresolve_calories#0.1"];
#[crate_id="crateresolve_calories#0.1"];
// NOTE: remove after the next snapshot
#[link(name = "crateresolve_calories",
vers = "0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/crateresolve_calories-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[pkgid="crateresolve_calories#0.1"];
#[crate_id="crateresolve_calories#0.1"];
// NOTE: remove after the next snapshot
#[link(name = "crateresolve_calories",
vers = "0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/extern-crosscrate-source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[pkgid="externcallback#0.1"];
#[crate_id="externcallback#0.1"];
// NOTE: remove after the next snapshot
#[link(name = "externcallback",
vers = "0.1")];
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/foreign_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[pkgid="foreign_lib"];
#[crate_id="foreign_lib"];
// NOTE: remove after the next snapshot
#[link(name="foreign_lib", vers="0.0")];

Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/inline_dtor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[pkgid="inline_dtor#0.1"];
#[crate_id="inline_dtor#0.1"];
// NOTE: remove after the next snapshot
#[link(name="inline_dtor", vers="0.1")];

Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/iss.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[pkgid="issue6919_3#0.1"];
#[crate_id="issue6919_3#0.1"];
// NOTE: remove after the next snapshot
#[link(name="iss6919_3", vers="0.1")];

Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/issue-2380.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// except according to those terms.

#[feature(managed_boxes)];
#[pkgid="a"];
#[crate_id="a"];
// NOTE: remove after the next snapshot
#[link(name = "a", vers = "0.0")];
#[crate_type = "lib"];
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/issue-2414-a.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[pkgid="a#0.1"];
#[crate_id="a#0.1"];
// NOTE: remove after the next snapshot
#[link(name = "a", vers = "0.1")];
#[crate_type = "lib"];
Expand Down
Loading

0 comments on commit dee1107

Please sign in to comment.