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

Working towards a libc-less (wasm32) libstd #45725

Merged
merged 4 commits into from Nov 9, 2017

Conversation

Projects
None yet
8 participants
@alexcrichton
Member

alexcrichton commented Nov 2, 2017

This is a series of commits I was able to extract from prepare to comiple libstd on a "bare libc-less" target, notably wasm32. The actual wasm32 bits I intend to send in a PR later, this is just some internal refactorings required for libstd to work with a libc that's empty and a few other assorted refactorings.

No functional change should be included in this PR for users of libstd, this is intended to just be internal refactorings.

@rust-highfive

This comment has been minimized.

Show comment
Hide comment
@rust-highfive

rust-highfive Nov 2, 2017

Collaborator

r? @dtolnay

(rust_highfive has picked a reviewer for you, use r? to override)

Collaborator

rust-highfive commented Nov 2, 2017

r? @dtolnay

(rust_highfive has picked a reviewer for you, use r? to override)

@dtolnay

dtolnay approved these changes Nov 4, 2017

@dtolnay

This comment has been minimized.

Show comment
Hide comment
@dtolnay
Member

dtolnay commented Nov 4, 2017

@bors r+

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 4, 2017

Contributor

📌 Commit db3d3f0 has been approved by dtolnay

Contributor

bors commented Nov 4, 2017

📌 Commit db3d3f0 has been approved by dtolnay

@LukasKalbertodt

This comment has been minimized.

Show comment
Hide comment
@LukasKalbertodt

LukasKalbertodt Nov 4, 2017

Contributor

screenshot from 2017-11-04 18-57-22

What a lovely PR! All of the commits have long, great descriptions too 😮

Contributor

LukasKalbertodt commented Nov 4, 2017

screenshot from 2017-11-04 18-57-22

What a lovely PR! All of the commits have long, great descriptions too 😮

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 5, 2017

Contributor

⌛️ Testing commit db3d3f0 with merge f080a40...

Contributor

bors commented Nov 5, 2017

⌛️ Testing commit db3d3f0 with merge f080a40...

bors added a commit that referenced this pull request Nov 5, 2017

Auto merge of #45725 - alexcrichton:std-less-rand, r=dtolnay
Working towards a libc-less (wasm32) libstd

This is a series of commits I was able to extract from prepare to comiple libstd on a "bare libc-less" target, notably wasm32. The actual wasm32 bits I intend to send in a PR later, this is just some internal refactorings required for libstd to work with a `libc` that's empty and a few other assorted refactorings.

No functional change should be included in this PR for users of libstd, this is intended to just be internal refactorings.
@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 5, 2017

Contributor

💔 Test failed - status-appveyor

Contributor

bors commented Nov 5, 2017

💔 Test failed - status-appveyor

@alexcrichton

This comment has been minimized.

Show comment
Hide comment
@alexcrichton

alexcrichton Nov 5, 2017

Member

@bors: r=dtolnay

Member

alexcrichton commented Nov 5, 2017

@bors: r=dtolnay

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 5, 2017

Contributor

📌 Commit 5b673fe has been approved by dtolnay

Contributor

bors commented Nov 5, 2017

📌 Commit 5b673fe has been approved by dtolnay

@alexcrichton

This comment has been minimized.

Show comment
Hide comment
@alexcrichton

alexcrichton Nov 5, 2017

Member

@bors: r=dtolnay

Member

alexcrichton commented Nov 5, 2017

@bors: r=dtolnay

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 5, 2017

Contributor

📌 Commit e82ce58 has been approved by dtolnay

Contributor

bors commented Nov 5, 2017

📌 Commit e82ce58 has been approved by dtolnay

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 5, 2017

Contributor

⌛️ Testing commit e82ce58 with merge 5c430c4...

Contributor

bors commented Nov 5, 2017

⌛️ Testing commit e82ce58 with merge 5c430c4...

bors added a commit that referenced this pull request Nov 5, 2017

Auto merge of #45725 - alexcrichton:std-less-rand, r=dtolnay
Working towards a libc-less (wasm32) libstd

This is a series of commits I was able to extract from prepare to comiple libstd on a "bare libc-less" target, notably wasm32. The actual wasm32 bits I intend to send in a PR later, this is just some internal refactorings required for libstd to work with a `libc` that's empty and a few other assorted refactorings.

No functional change should be included in this PR for users of libstd, this is intended to just be internal refactorings.
@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 5, 2017

Contributor

💔 Test failed - status-travis

Contributor

bors commented Nov 5, 2017

💔 Test failed - status-travis

@kennytm

This comment has been minimized.

Show comment
Hide comment
@kennytm

kennytm Nov 5, 2017

Member

unused_import on macOS when building libstd.

[00:04:39] error: unused import: `self`
[00:04:39]   --> src/libstd/sys/unix/rand.rs:31:14
[00:04:39]    |
[00:04:39] 31 |     use io::{self, Read};
[00:04:39]    |              ^^^^
[00:04:39]    |
[00:04:39] note: lint level defined here
[00:04:39]   --> src/libstd/lib.rs:232:9
[00:04:39]    |
[00:04:39] 232| #![deny(warnings)]
[00:04:39]    |         ^^^^^^^^
[00:04:39]    = note: #[deny(unused_imports)] implied by #[deny(warnings)]
[00:04:39] 
[00:04:43] error: aborting due to previous error
[00:04:43] 
[00:04:43] error: Could not compile `std`.
Member

kennytm commented Nov 5, 2017

unused_import on macOS when building libstd.

[00:04:39] error: unused import: `self`
[00:04:39]   --> src/libstd/sys/unix/rand.rs:31:14
[00:04:39]    |
[00:04:39] 31 |     use io::{self, Read};
[00:04:39]    |              ^^^^
[00:04:39]    |
[00:04:39] note: lint level defined here
[00:04:39]   --> src/libstd/lib.rs:232:9
[00:04:39]    |
[00:04:39] 232| #![deny(warnings)]
[00:04:39]    |         ^^^^^^^^
[00:04:39]    = note: #[deny(unused_imports)] implied by #[deny(warnings)]
[00:04:39] 
[00:04:43] error: aborting due to previous error
[00:04:43] 
[00:04:43] error: Could not compile `std`.
@alexcrichton

This comment has been minimized.

Show comment
Hide comment
@alexcrichton

alexcrichton Nov 5, 2017

Member

@bors: r=dtolnay

Member

alexcrichton commented Nov 5, 2017

@bors: r=dtolnay

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 5, 2017

Contributor

📌 Commit 847660c has been approved by dtolnay

Contributor

bors commented Nov 5, 2017

📌 Commit 847660c has been approved by dtolnay

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 5, 2017

Contributor

⌛️ Testing commit 847660c with merge de5fe8a...

Contributor

bors commented Nov 5, 2017

⌛️ Testing commit 847660c with merge de5fe8a...

bors added a commit that referenced this pull request Nov 5, 2017

Auto merge of #45725 - alexcrichton:std-less-rand, r=dtolnay
Working towards a libc-less (wasm32) libstd

This is a series of commits I was able to extract from prepare to comiple libstd on a "bare libc-less" target, notably wasm32. The actual wasm32 bits I intend to send in a PR later, this is just some internal refactorings required for libstd to work with a `libc` that's empty and a few other assorted refactorings.

No functional change should be included in this PR for users of libstd, this is intended to just be internal refactorings.
@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 5, 2017

Contributor

💔 Test failed - status-travis

Contributor

bors commented Nov 5, 2017

💔 Test failed - status-travis

@alexcrichton

This comment has been minimized.

Show comment
Hide comment
@alexcrichton

alexcrichton Nov 6, 2017

Member

@bors: r=dtolnay

Member

alexcrichton commented Nov 6, 2017

@bors: r=dtolnay

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 6, 2017

Contributor

📌 Commit eae99f0 has been approved by dtolnay

Contributor

bors commented Nov 6, 2017

📌 Commit eae99f0 has been approved by dtolnay

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 6, 2017

Contributor

⌛️ Testing commit eae99f0 with merge 8e6e2ba...

Contributor

bors commented Nov 6, 2017

⌛️ Testing commit eae99f0 with merge 8e6e2ba...

bors added a commit that referenced this pull request Nov 6, 2017

Auto merge of #45725 - alexcrichton:std-less-rand, r=dtolnay
Working towards a libc-less (wasm32) libstd

This is a series of commits I was able to extract from prepare to comiple libstd on a "bare libc-less" target, notably wasm32. The actual wasm32 bits I intend to send in a PR later, this is just some internal refactorings required for libstd to work with a `libc` that's empty and a few other assorted refactorings.

No functional change should be included in this PR for users of libstd, this is intended to just be internal refactorings.
@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 6, 2017

Contributor

💔 Test failed - status-travis

Contributor

bors commented Nov 6, 2017

💔 Test failed - status-travis

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 9, 2017

Contributor

⌛️ Testing commit 9435c71 with merge 5c364a1...

Contributor

bors commented Nov 9, 2017

⌛️ Testing commit 9435c71 with merge 5c364a1...

bors added a commit that referenced this pull request Nov 9, 2017

Auto merge of #45725 - alexcrichton:std-less-rand, r=dtolnay
Working towards a libc-less (wasm32) libstd

This is a series of commits I was able to extract from prepare to comiple libstd on a "bare libc-less" target, notably wasm32. The actual wasm32 bits I intend to send in a PR later, this is just some internal refactorings required for libstd to work with a `libc` that's empty and a few other assorted refactorings.

No functional change should be included in this PR for users of libstd, this is intended to just be internal refactorings.
@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 9, 2017

Contributor

💔 Test failed - status-travis

Contributor

bors commented Nov 9, 2017

💔 Test failed - status-travis

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 9, 2017

Contributor

⌛️ Testing commit 9435c71 with merge e811220...

Contributor

bors commented Nov 9, 2017

⌛️ Testing commit 9435c71 with merge e811220...

bors added a commit that referenced this pull request Nov 9, 2017

Auto merge of #45725 - alexcrichton:std-less-rand, r=dtolnay
Working towards a libc-less (wasm32) libstd

This is a series of commits I was able to extract from prepare to comiple libstd on a "bare libc-less" target, notably wasm32. The actual wasm32 bits I intend to send in a PR later, this is just some internal refactorings required for libstd to work with a `libc` that's empty and a few other assorted refactorings.

No functional change should be included in this PR for users of libstd, this is intended to just be internal refactorings.
@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 9, 2017

Contributor

💔 Test failed - status-travis

Contributor

bors commented Nov 9, 2017

💔 Test failed - status-travis

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 9, 2017

Contributor

⌛️ Testing commit 9435c71 with merge 9e989bf...

Contributor

bors commented Nov 9, 2017

⌛️ Testing commit 9435c71 with merge 9e989bf...

bors added a commit that referenced this pull request Nov 9, 2017

Auto merge of #45725 - alexcrichton:std-less-rand, r=dtolnay
Working towards a libc-less (wasm32) libstd

This is a series of commits I was able to extract from prepare to comiple libstd on a "bare libc-less" target, notably wasm32. The actual wasm32 bits I intend to send in a PR later, this is just some internal refactorings required for libstd to work with a `libc` that's empty and a few other assorted refactorings.

No functional change should be included in this PR for users of libstd, this is intended to just be internal refactorings.
@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 9, 2017

Contributor

💔 Test failed - status-travis

Contributor

bors commented Nov 9, 2017

💔 Test failed - status-travis

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 9, 2017

Contributor

⌛️ Testing commit 9435c71 with merge be37f63...

Contributor

bors commented Nov 9, 2017

⌛️ Testing commit 9435c71 with merge be37f63...

bors added a commit that referenced this pull request Nov 9, 2017

Auto merge of #45725 - alexcrichton:std-less-rand, r=dtolnay
Working towards a libc-less (wasm32) libstd

This is a series of commits I was able to extract from prepare to comiple libstd on a "bare libc-less" target, notably wasm32. The actual wasm32 bits I intend to send in a PR later, this is just some internal refactorings required for libstd to work with a `libc` that's empty and a few other assorted refactorings.

No functional change should be included in this PR for users of libstd, this is intended to just be internal refactorings.
@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 9, 2017

Contributor

💔 Test failed - status-travis

Contributor

bors commented Nov 9, 2017

💔 Test failed - status-travis

@alexcrichton

This comment has been minimized.

Show comment
Hide comment
@alexcrichton
Member

alexcrichton commented Nov 9, 2017

@bord: retry

@alexcrichton

This comment has been minimized.

Show comment
Hide comment
@alexcrichton

alexcrichton Nov 9, 2017

Member

Er sorry

@bors: retry

Member

alexcrichton commented Nov 9, 2017

Er sorry

@bors: retry

@kennytm

This comment has been minimized.

Show comment
Hide comment
@kennytm

kennytm Nov 9, 2017

Member

@bors treeclosed- p=0

Member

kennytm commented Nov 9, 2017

@bors treeclosed- p=0

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 9, 2017

Contributor

⌛️ Testing commit 9435c71 with merge a5e95f7...

Contributor

bors commented Nov 9, 2017

⌛️ Testing commit 9435c71 with merge a5e95f7...

bors added a commit that referenced this pull request Nov 9, 2017

Auto merge of #45725 - alexcrichton:std-less-rand, r=dtolnay
Working towards a libc-less (wasm32) libstd

This is a series of commits I was able to extract from prepare to comiple libstd on a "bare libc-less" target, notably wasm32. The actual wasm32 bits I intend to send in a PR later, this is just some internal refactorings required for libstd to work with a `libc` that's empty and a few other assorted refactorings.

No functional change should be included in this PR for users of libstd, this is intended to just be internal refactorings.
@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 9, 2017

Contributor

💔 Test failed - status-travis

Contributor

bors commented Nov 9, 2017

💔 Test failed - status-travis

@kennytm

This comment has been minimized.

Show comment
Hide comment
@kennytm

kennytm Nov 9, 2017

Member
Building stage2 std artifacts (x86_64-apple-darwin -> armv7-apple-ios)
...
[01:06:55] warning: dropping unsupported crate type `dylib` for target `armv7-apple-ios`
[01:06:55] 
[01:06:58] error[E0308]: mismatched types
[01:06:58]   --> src/libstd/sys/unix/backtrace/tracing/backtrace_fn.rs:39:29
[01:06:58]    |
[01:06:58] 39 |             exact_position: *from,
[01:06:58]    |                             ^^^^^ expected u8, found enum `libc::c_void`
[01:06:58]    |
[01:06:58]    = note: expected type `*const u8`
[01:06:58]               found type `*mut libc::c_void`
[01:06:58] 
[01:06:58] error[E0308]: mismatched types
[01:06:58]   --> src/libstd/sys/unix/backtrace/tracing/backtrace_fn.rs:40:26
[01:06:58]    |
[01:06:58] 40 |             symbol_addr: *from,
[01:06:58]    |                          ^^^^^ expected u8, found enum `libc::c_void`
[01:06:58]    |
[01:06:58]    = note: expected type `*const u8`
[01:06:58]               found type `*mut libc::c_void`
Member

kennytm commented Nov 9, 2017

Building stage2 std artifacts (x86_64-apple-darwin -> armv7-apple-ios)
...
[01:06:55] warning: dropping unsupported crate type `dylib` for target `armv7-apple-ios`
[01:06:55] 
[01:06:58] error[E0308]: mismatched types
[01:06:58]   --> src/libstd/sys/unix/backtrace/tracing/backtrace_fn.rs:39:29
[01:06:58]    |
[01:06:58] 39 |             exact_position: *from,
[01:06:58]    |                             ^^^^^ expected u8, found enum `libc::c_void`
[01:06:58]    |
[01:06:58]    = note: expected type `*const u8`
[01:06:58]               found type `*mut libc::c_void`
[01:06:58] 
[01:06:58] error[E0308]: mismatched types
[01:06:58]   --> src/libstd/sys/unix/backtrace/tracing/backtrace_fn.rs:40:26
[01:06:58]    |
[01:06:58] 40 |             symbol_addr: *from,
[01:06:58]    |                          ^^^^^ expected u8, found enum `libc::c_void`
[01:06:58]    |
[01:06:58]    = note: expected type `*const u8`
[01:06:58]               found type `*mut libc::c_void`
std: Avoid use of `libc` in portable modules
This commit removes usage of the `libc` crate in "portable" modules like
those at the top level and `sys_common`. Instead common types like `*mut
u8` or `u32` are used instead of `*mut c_void` or `c_int` as well as
switching to platform-specific functions like `sys::strlen` instead of
`libc::strlen`.
@alexcrichton

This comment has been minimized.

Show comment
Hide comment
@alexcrichton

alexcrichton Nov 9, 2017

Member

@bors: r=dtolnay

Member

alexcrichton commented Nov 9, 2017

@bors: r=dtolnay

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 9, 2017

Contributor

📌 Commit 5c3fe11 has been approved by dtolnay

Contributor

bors commented Nov 9, 2017

📌 Commit 5c3fe11 has been approved by dtolnay

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 9, 2017

Contributor

⌛️ Testing commit 5c3fe11 with merge f1ea23e...

Contributor

bors commented Nov 9, 2017

⌛️ Testing commit 5c3fe11 with merge f1ea23e...

bors added a commit that referenced this pull request Nov 9, 2017

Auto merge of #45725 - alexcrichton:std-less-rand, r=dtolnay
Working towards a libc-less (wasm32) libstd

This is a series of commits I was able to extract from prepare to comiple libstd on a "bare libc-less" target, notably wasm32. The actual wasm32 bits I intend to send in a PR later, this is just some internal refactorings required for libstd to work with a `libc` that's empty and a few other assorted refactorings.

No functional change should be included in this PR for users of libstd, this is intended to just be internal refactorings.
@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 9, 2017

Contributor

☀️ Test successful - status-appveyor, status-travis
Approved by: dtolnay
Pushing f1ea23e to master...

Contributor

bors commented Nov 9, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: dtolnay
Pushing f1ea23e to master...

@bors bors merged commit 5c3fe11 into rust-lang:master Nov 9, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
use io;
use rand::Rng;
// FIXME: Use rand:

This comment has been minimized.

@bjorn3

bjorn3 Nov 15, 2017

Contributor

Please leave this FIXME

@bjorn3

bjorn3 Nov 15, 2017

Contributor

Please leave this FIXME

@alexcrichton alexcrichton deleted the alexcrichton:std-less-rand branch Dec 1, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment