Skip to content

Commit a70a037

Browse files
committed
auto merge of #17673 : aturon/rust/remove-uv, r=alexcrichton
This PR begins the process of [runtime removal](rust-lang/rfcs#230) by dismantling the `librustuv` crate and associated event loop. The result is that, while `libgreen` can still be used for task scheduling purposes, it will no longer be feasible to use green-threaded I/O. Removing the libuv-based event loop eases the transition away from the runtime system, which will be done incrementally. In terms of visible API changes, this PR: * Removes `std::io::signal`, which was never implemented on the native threading model. * Removes the `iotest!` macro, which was previously used to run I/O tests on both green and native threading models. * Removes the `green_start!` macro for starting an application with a `librustuv` event loop. * Removes the `librustuv` crate itself. It also removes the `libuv` and `gyp` submodules and adjusts the build system and copyright notices accordingly. If you wish to continue using `librustuv` and green-threaded I/O, consider using [green-rs](https://github.com/alexcrichton/green-rs/), which provides its own I/O stack.
2 parents b224dfe + dad59bd commit a70a037

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+652
-7747
lines changed

.gitmodules

-7
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
path = src/llvm
33
url = https://github.com/rust-lang/llvm.git
44
branch = master
5-
[submodule "src/libuv"]
6-
path = src/libuv
7-
url = https://github.com/rust-lang/libuv.git
8-
branch = master
9-
[submodule "src/gyp"]
10-
path = src/gyp
11-
url = https://github.com/rust-lang/gyp.git
125
[submodule "src/compiler-rt"]
136
path = src/compiler-rt
147
url = https://github.com/rust-lang/compiler-rt.git

COPYRIGHT

-35
Original file line numberDiff line numberDiff line change
@@ -213,41 +213,6 @@ their own copyright notices and license terms:
213213
as the Rust compiler or runtime libraries themselves).
214214

215215

216-
* The libuv asynchronous I/O library. Code for this package
217-
is found in the src/libuv directory, within this
218-
distribution. This package is redistributed under the
219-
following terms, as noted in its source:
220-
221-
Copyright Joyent, Inc. and other Node contributors. All
222-
rights reserved. Permission is hereby granted, free of
223-
charge, to any person obtaining a copy of this software
224-
and associated documentation files (the "Software"), to
225-
deal in the Software without restriction, including
226-
without limitation the rights to use, copy, modify,
227-
merge, publish, distribute, sublicense, and/or sell
228-
copies of the Software, and to permit persons to whom
229-
the Software is furnished to do so, subject to the
230-
following conditions:
231-
232-
The above copyright notice and this permission notice
233-
shall be included in all copies or substantial portions
234-
of the Software.
235-
236-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
237-
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
238-
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
239-
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
240-
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
241-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
242-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
243-
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
244-
DEALINGS IN THE SOFTWARE.
245-
246-
247-
* Additional libraries included in libuv carry separate
248-
BSD-compatible licenses. See src/libuv/LICENSE for
249-
details.
250-
251216
* The src/rt/miniz.c file, carrying an implementation of
252217
RFC1950/RFC1951 DEFLATE, by Rich Geldreich
253218
<[email protected]>. All uses of this file are

configure

-10
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,6 @@ valopt prefix "/usr/local" "set installation prefix"
438438
valopt local-rust-root "/usr/local" "set prefix for local rust binary"
439439
valopt llvm-root "" "set LLVM root"
440440
valopt jemalloc-root "" "set directory where libjemalloc_pic.a is located"
441-
valopt libuv-root "" "set directory where libuv.a is located"
442441
valopt android-cross-path "/opt/ndk_standalone" "Android NDK standalone path"
443442
valopt mingw32-cross-path "" "MinGW32 cross compiler path"
444443

@@ -869,10 +868,6 @@ do
869868
do
870869
make_dir $t/rt/stage$s
871870
make_dir $t/rt/jemalloc
872-
make_dir $t/rt/libuv
873-
make_dir $t/rt/libuv/src/ares
874-
make_dir $t/rt/libuv/src/eio
875-
make_dir $t/rt/libuv/src/ev
876871
for i in \
877872
isaac sync test \
878873
arch/i386 arch/x86_64 arch/arm arch/mips \
@@ -952,10 +947,6 @@ then
952947
msg "git: submodule deinit src/jemalloc"
953948
"${CFG_GIT}" submodule deinit src/jemalloc
954949
fi
955-
if [ ! -z "${CFG_LIBUV_ROOT}" ]; then
956-
msg "git: submodule deinit src/libuv"
957-
"${CFG_GIT}" submodule deinit src/libuv
958-
fi
959950

960951
msg "git: submodule update"
961952
"${CFG_GIT}" submodule update
@@ -1216,7 +1207,6 @@ putvar CFG_MINGW32_CROSS_PATH
12161207
putvar CFG_MANDIR
12171208
putvar CFG_DISABLE_INJECT_STD_VERSION
12181209
putvar CFG_JEMALLOC_ROOT
1219-
putvar CFG_LIBUV_ROOT
12201210
putvar CFG_DISABLE_JEMALLOC
12211211

12221212
# Avoid spurious warnings from clang by feeding it original source on

mk/crates.mk

+2-3
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
# automatically generated for all stage/host/target combinations.
5050
################################################################################
5151

52-
TARGET_CRATES := libc std green rustuv native flate arena glob term semver \
52+
TARGET_CRATES := libc std green native flate arena glob term semver \
5353
uuid serialize sync getopts collections num test time rand \
5454
url log regex graphviz core rbml rlibc alloc debug rustrt \
5555
unicode
@@ -69,7 +69,6 @@ DEPS_std := core libc rand alloc collections rustrt sync unicode \
6969
native:rust_builtin native:backtrace
7070
DEPS_graphviz := std
7171
DEPS_green := std native:context_switch
72-
DEPS_rustuv := std native:uv native:uv_support
7372
DEPS_native := std
7473
DEPS_syntax := std term serialize log fmt_macros debug arena libc
7574
DEPS_rustc := syntax flate arena serialize getopts rbml \
@@ -102,7 +101,7 @@ DEPS_regex := std
102101
DEPS_regex_macros = rustc syntax std regex
103102
DEPS_fmt_macros = std
104103

105-
TOOL_DEPS_compiletest := test green rustuv getopts
104+
TOOL_DEPS_compiletest := test getopts
106105
TOOL_DEPS_rustdoc := rustdoc native
107106
TOOL_DEPS_rustc := rustc native
108107
TOOL_SOURCE_compiletest := $(S)src/compiletest/compiletest.rs

mk/ctags.mk

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@
1616
.PHONY: TAGS.emacs TAGS.vi
1717

1818
# This is using a blacklist approach, probably more durable than a whitelist.
19-
# We exclude: external dependencies (llvm, libuv, gyp, rt/{msvc,sundown,vg}),
19+
# We exclude: external dependencies (llvm, rt/{msvc,sundown,vg}),
2020
# tests (compiletest, test) and a couple of other things (rt/arch, etc)
2121
CTAGS_LOCATIONS=$(patsubst ${CFG_SRC_DIR}src/llvm,, \
22-
$(patsubst ${CFG_SRC_DIR}src/libuv,, \
2322
$(patsubst ${CFG_SRC_DIR}src/compiletest,, \
2423
$(patsubst ${CFG_SRC_DIR}src/test,, \
25-
$(patsubst ${CFG_SRC_DIR}src/gyp,, \
2624
$(patsubst ${CFG_SRC_DIR}src/etc,, \
2725
$(patsubst ${CFG_SRC_DIR}src/rt,, \
2826
$(patsubst ${CFG_SRC_DIR}src/rt/arch,, \

mk/dist.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ LICENSE.txt: $(S)COPYRIGHT $(S)LICENSE-APACHE $(S)LICENSE-MIT
3535

3636
PKG_TAR = dist/$(PKG_NAME).tar.gz
3737

38-
PKG_GITMODULES := $(S)src/libuv $(S)src/llvm $(S)src/gyp $(S)src/compiler-rt \
38+
PKG_GITMODULES := $(S)src/llvm $(S)src/compiler-rt \
3939
$(S)src/rt/hoedown $(S)src/jemalloc
4040
PKG_FILES := \
4141
$(S)COPYRIGHT \

mk/platform.mk

-16
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ CFG_GCCISH_POST_LIB_FLAGS_x86_64-unknown-linux-gnu := -Wl,-no-whole-archive
118118
CFG_DEF_SUFFIX_x86_64-unknown-linux-gnu := .linux.def
119119
CFG_LLC_FLAGS_x86_64-unknown-linux-gnu :=
120120
CFG_INSTALL_NAME_x86_64-unknown-linux-gnu =
121-
CFG_LIBUV_LINK_FLAGS_x86_64-unknown-linux-gnu =
122121
CFG_EXE_SUFFIX_x86_64-unknown-linux-gnu =
123122
CFG_WINDOWSY_x86_64-unknown-linux-gnu :=
124123
CFG_UNIXY_x86_64-unknown-linux-gnu := 1
@@ -146,7 +145,6 @@ CFG_GCCISH_POST_LIB_FLAGS_i686-unknown-linux-gnu := -Wl,-no-whole-archive
146145
CFG_DEF_SUFFIX_i686-unknown-linux-gnu := .linux.def
147146
CFG_LLC_FLAGS_i686-unknown-linux-gnu :=
148147
CFG_INSTALL_NAME_i686-unknown-linux-gnu =
149-
CFG_LIBUV_LINK_FLAGS_i686-unknown-linux-gnu =
150148
CFG_EXE_SUFFIX_i686-unknown-linux-gnu =
151149
CFG_WINDOWSY_i686-unknown-linux-gnu :=
152150
CFG_UNIXY_i686-unknown-linux-gnu := 1
@@ -180,7 +178,6 @@ CFG_GCCISH_POST_LIB_FLAGS_arm-apple-ios :=
180178
CFG_DEF_SUFFIX_arm-apple-ios := .darwin.def
181179
CFG_LLC_FLAGS_arm-apple-ios := -mattr=+vfp3,+v7,+thumb2,+neon -march=arm
182180
CFG_INSTALL_NAME_arm-apple-ios = -Wl,-install_name,@rpath/$(1)
183-
CFG_LIBUV_LINK_FLAGS_arm-apple-ios =
184181
CFG_EXE_SUFFIX_arm-apple-ios :=
185182
CFG_WINDOWSY_arm-apple-ios :=
186183
CFG_UNIXY_arm-apple-ios := 1
@@ -216,7 +213,6 @@ CFG_GCCISH_POST_LIB_FLAGS_i386-apple-ios =
216213
CFG_DEF_SUFFIX_i386-apple-ios = .darwin.def
217214
CFG_LLC_FLAGS_i386-apple-ios =
218215
CFG_INSTALL_NAME_i386-apple-ios = -Wl,-install_name,@rpath/$(1)
219-
CFG_LIBUV_LINK_FLAGS_i386-apple-ios =
220216
CFG_EXE_SUFFIX_i386-apple-ios =
221217
CFG_WINDOWSY_i386-apple-ios =
222218
CFG_UNIXY_i386-apple-ios = 1
@@ -245,7 +241,6 @@ CFG_GCCISH_POST_LIB_FLAGS_x86_64-apple-darwin :=
245241
CFG_DEF_SUFFIX_x86_64-apple-darwin := .darwin.def
246242
CFG_LLC_FLAGS_x86_64-apple-darwin :=
247243
CFG_INSTALL_NAME_x86_64-apple-darwin = -Wl,-install_name,@rpath/$(1)
248-
CFG_LIBUV_LINK_FLAGS_x86_64-apple-darwin =
249244
CFG_EXE_SUFFIX_x86_64-apple-darwin :=
250245
CFG_WINDOWSY_x86_64-apple-darwin :=
251246
CFG_UNIXY_x86_64-apple-darwin := 1
@@ -273,7 +268,6 @@ CFG_GCCISH_POST_LIB_FLAGS_i686-apple-darwin :=
273268
CFG_DEF_SUFFIX_i686-apple-darwin := .darwin.def
274269
CFG_LLC_FLAGS_i686-apple-darwin :=
275270
CFG_INSTALL_NAME_i686-apple-darwin = -Wl,-install_name,@rpath/$(1)
276-
CFG_LIBUV_LINK_FLAGS_i686-apple-darwin =
277271
CFG_EXE_SUFFIX_i686-apple-darwin :=
278272
CFG_WINDOWSY_i686-apple-darwin :=
279273
CFG_UNIXY_i686-apple-darwin := 1
@@ -301,7 +295,6 @@ CFG_GCCISH_POST_LIB_FLAGS_arm-linux-androideabi := -Wl,-no-whole-archive
301295
CFG_DEF_SUFFIX_arm-linux-androideabi := .android.def
302296
CFG_LLC_FLAGS_arm-linux-androideabi :=
303297
CFG_INSTALL_NAME_arm-linux-androideabi =
304-
CFG_LIBUV_LINK_FLAGS_arm-linux-androideabi =
305298
CFG_EXE_SUFFIX_arm-linux-androideabi :=
306299
CFG_WINDOWSY_arm-linux-androideabi :=
307300
CFG_UNIXY_arm-linux-androideabi := 1
@@ -332,7 +325,6 @@ CFG_GCCISH_POST_LIB_FLAGS_arm-unknown-linux-gnueabihf := -Wl,-no-whole-archive
332325
CFG_DEF_SUFFIX_arm-unknown-linux-gnueabihf := .linux.def
333326
CFG_LLC_FLAGS_arm-unknown-linux-gnueabihf :=
334327
CFG_INSTALL_NAME_ar,-unknown-linux-gnueabihf =
335-
CFG_LIBUV_LINK_FLAGS_arm-unknown-linux-gnueabihf =
336328
CFG_EXE_SUFFIX_arm-unknown-linux-gnueabihf :=
337329
CFG_WINDOWSY_arm-unknown-linux-gnueabihf :=
338330
CFG_UNIXY_arm-unknown-linux-gnueabihf := 1
@@ -363,7 +355,6 @@ CFG_GCCISH_POST_LIB_FLAGS_arm-unknown-linux-gnueabi := -Wl,-no-whole-archive
363355
CFG_DEF_SUFFIX_arm-unknown-linux-gnueabi := .linux.def
364356
CFG_LLC_FLAGS_arm-unknown-linux-gnueabi :=
365357
CFG_INSTALL_NAME_arm-unknown-linux-gnueabi =
366-
CFG_LIBUV_LINK_FLAGS_arm-unknown-linux-gnueabi =
367358
CFG_EXE_SUFFIX_arm-unknown-linux-gnueabi :=
368359
CFG_WINDOWSY_arm-unknown-linux-gnueabi :=
369360
CFG_UNIXY_arm-unknown-linux-gnueabi := 1
@@ -393,7 +384,6 @@ CFG_GCCISH_POST_LIB_FLAGS_mipsel-linux := -Wl,-no-whole-archive
393384
CFG_DEF_SUFFIX_mipsel-linux := .linux.def
394385
CFG_LLC_FLAGS_mipsel-linux :=
395386
CFG_INSTALL_NAME_mipsel-linux =
396-
CFG_LIBUV_LINK_FLAGS_mipsel-linux =
397387
CFG_EXE_SUFFIX_mipsel-linux :=
398388
CFG_WINDOWSY_mipsel-linux :=
399389
CFG_UNIXY_mipsel-linux := 1
@@ -423,7 +413,6 @@ CFG_GCCISH_POST_LIB_FLAGS_mips-unknown-linux-gnu := -Wl,-no-whole-archive
423413
CFG_DEF_SUFFIX_mips-unknown-linux-gnu := .linux.def
424414
CFG_LLC_FLAGS_mips-unknown-linux-gnu :=
425415
CFG_INSTALL_NAME_mips-unknown-linux-gnu =
426-
CFG_LIBUV_LINK_FLAGS_mips-unknown-linux-gnu =
427416
CFG_EXE_SUFFIX_mips-unknown-linux-gnu :=
428417
CFG_WINDOWSY_mips-unknown-linux-gnu :=
429418
CFG_UNIXY_mips-unknown-linux-gnu := 1
@@ -452,7 +441,6 @@ CFG_GCCISH_POST_LIB_FLAGS_i586-mingw32msvc :=
452441
CFG_DEF_SUFFIX_i586-mingw32msvc := .mingw32.def
453442
CFG_LLC_FLAGS_i586-mingw32msvc :=
454443
CFG_INSTALL_NAME_i586-mingw32msvc =
455-
CFG_LIBUV_LINK_FLAGS_i586-mingw32msvc := -L$(CFG_MINGW32_CROSS_PATH)/i586-mingw32msvc/lib -lws2_32 -lpsapi -liphlpapi
456444
CFG_EXE_SUFFIX_i586-mingw32msvc := .exe
457445
CFG_WINDOWSY_i586-mingw32msvc := 1
458446
CFG_UNIXY_i586-mingw32msvc :=
@@ -483,7 +471,6 @@ CFG_GCCISH_POST_LIB_FLAGS_i686-w64-mingw32 :=
483471
CFG_DEF_SUFFIX_i686-w64-mingw32 := .mingw32.def
484472
CFG_LLC_FLAGS_i686-w64-mingw32 :=
485473
CFG_INSTALL_NAME_i686-w64-mingw32 =
486-
CFG_LIBUV_LINK_FLAGS_i686-w64-mingw32 := -lws2_32 -lpsapi -liphlpapi
487474
CFG_EXE_SUFFIX_i686-w64-mingw32 := .exe
488475
CFG_WINDOWSY_i686-w64-mingw32 := 1
489476
CFG_UNIXY_i686-w64-mingw32 :=
@@ -515,7 +502,6 @@ CFG_GCCISH_POST_LIB_FLAGS_x86_64-w64-mingw32 :=
515502
CFG_DEF_SUFFIX_x86_64-w64-mingw32 := .mingw32.def
516503
CFG_LLC_FLAGS_x86_64-w64-mingw32 :=
517504
CFG_INSTALL_NAME_x86_64-w64-mingw32 =
518-
CFG_LIBUV_LINK_FLAGS_x86_64-w64-mingw32 := -lws2_32 -lpsapi -liphlpapi
519505
CFG_EXE_SUFFIX_x86_64-w64-mingw32 := .exe
520506
CFG_WINDOWSY_x86_64-w64-mingw32 := 1
521507
CFG_UNIXY_x86_64-w64-mingw32 :=
@@ -543,7 +529,6 @@ CFG_GCCISH_POST_LIB_FLAGS_x86_64-unknown-freebsd := -Wl,-no-whole-archive
543529
CFG_DEF_SUFFIX_x86_64-unknown-freebsd := .bsd.def
544530
CFG_LLC_FLAGS_x86_64-unknown-freebsd :=
545531
CFG_INSTALL_NAME_x86_64-unknown-freebsd =
546-
CFG_LIBUV_LINK_FLAGS_x86_64-unknown-freebsd := -pthread -lkvm
547532
CFG_EXE_SUFFIX_x86_64-unknown-freebsd :=
548533
CFG_WINDOWSY_x86_64-unknown-freebsd :=
549534
CFG_UNIXY_x86_64-unknown-freebsd := 1
@@ -570,7 +555,6 @@ CFG_GCCISH_POST_LIB_FLAGS_x86_64-unknown-dragonfly := -Wl,-no-whole-archive
570555
CFG_DEF_SUFFIX_x86_64-unknown-dragonfly := .bsd.def
571556
CFG_LLC_FLAGS_x86_64-unknown-dragonfly :=
572557
CFG_INSTALL_NAME_x86_64-unknown-dragonfly =
573-
CFG_LIBUV_LINK_FLAGS_x86_64-unknown-dragonfly := -pthread -lkvm
574558
CFG_EXE_SUFFIX_x86_64-unknown-dragonfly :=
575559
CFG_WINDOWSY_x86_64-unknown-dragonfly :=
576560
CFG_UNIXY_x86_64-unknown-dragonfly := 1

mk/reconfig.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) \
1616
ifndef CFG_DISABLE_MANAGE_SUBMODULES
1717
# This is a pretty expensive operation but I don't see any way to avoid it
1818
# NB: This only looks for '+' status (wrong commit checked out), not '-' status
19-
# (nothing checked out at all). `./configure --{llvm,jemalloc,libuv}-root`
19+
# (nothing checked out at all). `./configure --{llvm,jemalloc}-root`
2020
# will explicitly deinitialize the corresponding submodules, and we don't
2121
# want to force constant rebuilds in that case.
2222
NEED_GIT_RECONFIG=$(shell cd "$(CFG_SRC_DIR)" && "$(CFG_GIT)" submodule status | grep -c '^+')

0 commit comments

Comments
 (0)