Skip to content

Commit 3379a90

Browse files
authored
Merge pull request rust-lang#1256 from fitzgen/fix-missing-dylibs. r=emilio
Fix missing dylibs
2 parents 8c5f862 + ad6b223 commit 3379a90

18 files changed

+177
-126
lines changed

CHANGELOG.md

+67-9
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,38 @@
99
- [Removed](#removed)
1010
- [Fixed](#fixed)
1111
- [Security](#security)
12-
- [0.32.0](#0320)
12+
- [0.33.1](#0331)
13+
- [Fixed](#fixed-1)
14+
- [0.33.0](#0330)
1315
- [Added](#added-1)
1416
- [Changed](#changed-1)
15-
- [Fixed](#fixed-1)
16-
- [0.31.0](#0310)
17-
- [Added](#added-2)
18-
- [Changed](#changed-2)
1917
- [Deprecated](#deprecated-1)
2018
- [Removed](#removed-1)
2119
- [Fixed](#fixed-2)
22-
- [0.30.0](#0300)
20+
- [Security](#security-1)
21+
- [0.32.2](#0322)
22+
- [Fixed](#fixed-3)
23+
- [0.32.1](#0321)
24+
- [Fixed](#fixed-4)
25+
- [0.32.0](#0320)
26+
- [Added](#added-2)
27+
- [Changed](#changed-2)
28+
- [Fixed](#fixed-5)
29+
- [0.31.0](#0310)
2330
- [Added](#added-3)
2431
- [Changed](#changed-3)
2532
- [Deprecated](#deprecated-2)
26-
- [Fixed](#fixed-3)
27-
- [0.29.0](#0290)
33+
- [Removed](#removed-2)
34+
- [Fixed](#fixed-6)
35+
- [0.30.0](#0300)
2836
- [Added](#added-4)
2937
- [Changed](#changed-4)
30-
- [Fixed](#fixed-4)
38+
- [Deprecated](#deprecated-3)
39+
- [Fixed](#fixed-7)
40+
- [0.29.0](#0290)
41+
- [Added](#added-5)
42+
- [Changed](#changed-5)
43+
- [Fixed](#fixed-8)
3144

3245
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
3346

@@ -63,6 +76,51 @@ Released YYYY/MM/DD
6376

6477
--------------------------------------------------------------------------------
6578

79+
# 0.33.1
80+
81+
Released 2018/02/14
82+
83+
## Fixed
84+
85+
* Reverted the dependency update to `quote = "0.4"` and addition of the
86+
`proc_macro2` dependency. The `proc_macro2` crate depends on `rustc` internal
87+
libraries, which means that CLIs which use it must be run under `rustup`,
88+
which is not acceptable for `bindgen`. [#1248][]
89+
90+
[#1248]: https://github.com/rust-lang-nursery/rust-bindgen/issues/1248
91+
92+
--------------------------------------------------------------------------------
93+
94+
# 0.33.0
95+
96+
Released YYYY/MM/DD
97+
98+
## Added
99+
100+
* TODO (or remove section if none)
101+
102+
## Changed
103+
104+
* TODO (or remove section if none)
105+
106+
## Deprecated
107+
108+
* TODO (or remove section if none)
109+
110+
## Removed
111+
112+
* TODO (or remove section if none)
113+
114+
## Fixed
115+
116+
* TODO (or remove section if none)
117+
118+
## Security
119+
120+
* TODO (or remove section if none)
121+
122+
--------------------------------------------------------------------------------
123+
66124
# 0.32.2
67125

68126
Released 2018/01/22

Cargo.lock

+4-23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ name = "bindgen"
1313
readme = "README.md"
1414
repository = "https://github.com/rust-lang-nursery/rust-bindgen"
1515
documentation = "https://docs.rs/bindgen"
16-
version = "0.33.0"
16+
version = "0.33.1"
1717
build = "build.rs"
1818

1919
include = [
@@ -47,10 +47,9 @@ clap = "2"
4747
clang-sys = { version = "0.21.0", features = ["runtime", "clang_3_9"] }
4848
lazy_static = "1"
4949
peeking_take_while = "0.1.2"
50-
quote = "0.4"
50+
quote = "0.3.15"
5151
regex = "0.2"
5252
which = "1.0.2"
53-
proc-macro2 = "0.2"
5453

5554
[dependencies.env_logger]
5655
optional = true

src/codegen/helpers.rs

+30-19
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,27 @@
33
use ir::context::BindgenContext;
44
use ir::layout::Layout;
55
use quote;
6-
use proc_macro2;
76
use std::mem;
87

98
pub mod attributes {
109
use quote;
11-
use proc_macro2;
1210

1311
pub fn repr(which: &str) -> quote::Tokens {
14-
let which = proc_macro2::Term::intern(which);
12+
let which = quote::Ident::new(which);
1513
quote! {
1614
#[repr( #which )]
1715
}
1816
}
1917

2018
pub fn repr_list(which_ones: &[&str]) -> quote::Tokens {
21-
let which_ones = which_ones.iter().cloned().map(proc_macro2::Term::intern);
19+
let which_ones = which_ones.iter().cloned().map(quote::Ident::new);
2220
quote! {
2321
#[repr( #( #which_ones ),* )]
2422
}
2523
}
2624

2725
pub fn derives(which_ones: &[&str]) -> quote::Tokens {
28-
let which_ones = which_ones.iter().cloned().map(proc_macro2::Term::intern);
26+
let which_ones = which_ones.iter().cloned().map(quote::Ident::new);
2927
quote! {
3028
#[derive( #( #which_ones ),* )]
3129
}
@@ -41,8 +39,11 @@ pub mod attributes {
4139
// Doc comments are already preprocessed into nice `///` formats by the
4240
// time they get here. Just make sure that we have newlines around it so
4341
// that nothing else gets wrapped into the comment.
44-
let comment = proc_macro2::Literal::doccomment(&comment);
45-
quote! {#comment}
42+
let mut tokens = quote! {};
43+
tokens.append("\n");
44+
tokens.append(comment);
45+
tokens.append("\n");
46+
tokens
4647
}
4748

4849
pub fn link_name(name: &str) -> quote::Tokens {
@@ -72,7 +73,7 @@ pub fn blob(layout: Layout) -> quote::Tokens {
7273
}
7374
};
7475

75-
let ty_name = proc_macro2::Term::intern(ty_name);
76+
let ty_name = quote::Ident::new(ty_name);
7677

7778
let data_len = opaque.array_size().unwrap_or(layout.size);
7879

@@ -102,7 +103,7 @@ pub fn bitfield_unit(ctx: &BindgenContext, layout: Layout) -> quote::Tokens {
102103
let mut tokens = quote! {};
103104

104105
if ctx.options().enable_cxx_namespaces {
105-
tokens.append_all(quote! { root:: });
106+
tokens.append(quote! { root:: });
106107
}
107108

108109
let align = match layout.align {
@@ -113,7 +114,7 @@ pub fn bitfield_unit(ctx: &BindgenContext, layout: Layout) -> quote::Tokens {
113114
};
114115

115116
let size = layout.size;
116-
tokens.append_all(quote! {
117+
tokens.append(quote! {
117118
__BindgenBitfieldUnit<[u8; #size], #align>
118119
});
119120

@@ -125,7 +126,6 @@ pub mod ast_ty {
125126
use ir::function::FunctionSig;
126127
use ir::ty::FloatKind;
127128
use quote;
128-
use proc_macro2;
129129

130130
pub fn raw_type(ctx: &BindgenContext, name: &str) -> quote::Tokens {
131131
let ident = ctx.rust_ident_raw(name);
@@ -166,25 +166,29 @@ pub mod ast_ty {
166166

167167
pub fn int_expr(val: i64) -> quote::Tokens {
168168
// Don't use quote! { #val } because that adds the type suffix.
169-
let val = proc_macro2::Literal::integer(val);
170-
quote!(#val)
169+
let mut tokens = quote! {};
170+
tokens.append(val.to_string());
171+
tokens
171172
}
172173

173174
pub fn uint_expr(val: u64) -> quote::Tokens {
174175
// Don't use quote! { #val } because that adds the type suffix.
175-
let val = proc_macro2::Term::intern(&val.to_string());
176-
quote!(#val)
176+
let mut tokens = quote! {};
177+
tokens.append(val.to_string());
178+
tokens
177179
}
178180

179181
pub fn byte_array_expr(bytes: &[u8]) -> quote::Tokens {
180182
let mut bytes: Vec<_> = bytes.iter().cloned().collect();
181183
bytes.push(0);
182-
quote! { [ #(#bytes),* ] }
184+
quote! {
185+
#bytes
186+
}
183187
}
184188

185189
pub fn cstr_expr(mut string: String) -> quote::Tokens {
186190
string.push('\0');
187-
let b = proc_macro2::Literal::byte_string(&string.as_bytes());
191+
let b = quote::ByteStr(&string);
188192
quote! {
189193
#b
190194
}
@@ -195,9 +199,16 @@ pub mod ast_ty {
195199
f: f64,
196200
) -> Result<quote::Tokens, ()> {
197201
if f.is_finite() {
198-
let val = proc_macro2::Literal::float(f);
202+
let mut string = f.to_string();
203+
204+
// So it gets properly recognised as a floating point constant.
205+
if !string.contains('.') {
206+
string.push('.');
207+
}
199208

200-
return Ok(quote!(#val));
209+
let mut tokens = quote! {};
210+
tokens.append(string);
211+
return Ok(tokens);
201212
}
202213

203214
let prefix = ctx.trait_prefix();

src/codegen/impl_partialeq.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use ir::context::BindgenContext;
44
use ir::item::{IsOpaque, Item};
55
use ir::ty::{TypeKind, RUST_DERIVE_IN_ARRAY_LIMIT};
66
use quote;
7-
use proc_macro2;
87

98
/// Generate a manual implementation of `PartialEq` trait for the
109
/// specified compound type.
@@ -72,7 +71,7 @@ pub fn gen_partialeq_impl(
7271
}
7372

7473
fn gen_field(ctx: &BindgenContext, ty_item: &Item, name: &str) -> quote::Tokens {
75-
fn quote_equals(name_ident: proc_macro2::Term) -> quote::Tokens {
74+
fn quote_equals(name_ident: quote::Ident) -> quote::Tokens {
7675
quote! { self.#name_ident == other.#name_ident }
7776
}
7877

0 commit comments

Comments
 (0)