diff --git a/debian/changelog b/debian/changelog index 38aaa8e227..1102ce46fb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +rustc (1.10.0+dfsg1-1) UNRELEASED; urgency=medium + + * New upstream release + * Add myself to uploaders + * Update our bootstrapping scripts. Now we can build either from upstream's + stage0 snapshot (by setting DEB_BUILD_PROFILES=dlstage0) or from the + previous Debian rustc stable version (default, when no build profile). + + -- Ximin Luo Mon, 04 Jul 2016 15:05:50 +0200 + rustc (1.9.0+dfsg1-1) unstable; urgency=medium * New upstream release (Closes: #825752) diff --git a/debian/control b/debian/control index 96ceb17cd4..61adfe2c02 100644 --- a/debian/control +++ b/debian/control @@ -5,9 +5,11 @@ Maintainer: Rust Maintainers Uploaders: Jordan Justen , Luca Bruno , Sylvestre Ledru , - Angus Lees + Angus Lees , + Ximin Luo Build-Depends: debhelper (>= 9.20141010), dpkg-dev (>= 1.17.14), + rustc (>= 1.9.0+dfsg-1) , autotools-dev, curl, python, @@ -17,6 +19,7 @@ Build-Depends: debhelper (>= 9.20141010), valgrind, git, procps, + cmake, # git, procps are necessary for 'make check' antlr4, bison, @@ -59,7 +62,7 @@ Description: Rust systems programming language generic programming and meta-programming, in both static and dynamic styles. -Package: libstd-rust-1.9 +Package: libstd-rust-1.10 Section: libs Architecture: amd64 i386 Multi-Arch: same @@ -85,7 +88,7 @@ Section: libdevel Architecture: amd64 i386 Multi-Arch: same Pre-Depends: multiarch-support -Depends: ${misc:Depends}, libstd-rust-1.9 (= ${binary:Version}) +Depends: ${misc:Depends}, libstd-rust-1.10 (= ${binary:Version}) Description: Rust standard libraries - development files Rust is a curly-brace, block-structured expression language. It visually resembles the C language family, but differs significantly diff --git a/debian/libstd-rust-1.9.lintian-overrides b/debian/libstd-rust-1.10.lintian-overrides similarity index 57% rename from debian/libstd-rust-1.9.lintian-overrides rename to debian/libstd-rust-1.10.lintian-overrides index 5d8e06186a..3a16811c84 100644 --- a/debian/libstd-rust-1.9.lintian-overrides +++ b/debian/libstd-rust-1.10.lintian-overrides @@ -1,10 +1,10 @@ # "libstd" just seemed too generic -libstd-rust-1.9 binary: package-name-doesnt-match-sonames +libstd-rust-1.10 binary: package-name-doesnt-match-sonames # Rust doesn't use dev shlib symlinks. -libstd-rust-1.9 binary: dev-pkg-without-shlib-symlink +libstd-rust-1.10 binary: dev-pkg-without-shlib-symlink # Libraries that use libc symbols (libterm, libstd, etc) *are* linked # to libc. Lintian gets upset that some Rust libraries don't need # libc, boo hoo. -libstd-rust-1.9 binary: library-not-linked-against-libc +libstd-rust-1.10 binary: library-not-linked-against-libc diff --git a/debian/make_orig-dl_tarball.py b/debian/make_orig-dl_tarball.py deleted file mode 100755 index c9fd709cef..0000000000 --- a/debian/make_orig-dl_tarball.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/python - -import os -import subprocess -import sys -import time - -deb_dir = os.path.dirname(os.path.realpath(sys.argv[0])) -src_root_dir = os.path.realpath(os.path.join(deb_dir, '..')) -src_root_parent_dir = os.path.realpath(os.path.join(src_root_dir, '..')) -snapshot_dir = os.path.join(src_root_dir, 'src', 'etc') - -os.environ['CFG_SRC_DIR'] = src_root_dir - -os.chdir(src_root_dir) -ps = subprocess.Popen(['dpkg-parsechangelog','-SVersion'], stdout=subprocess.PIPE) -version = ps.stdout.read() -assert version is not None -upstream_version = version.split('-')[0] - -sys.path.append(snapshot_dir) -from snapshot import determine_curr_snapshot - -snapshots = {} -for arch in ('i386', 'x86_64'): - snapshots[arch] = determine_curr_snapshot(arch + '-unknown-linux') - -def create_dl_tarball(): - dl_tarfile = 'rustc_' + upstream_version + '.orig-dl.tar.xz' - url_base = 'https://static.rust-lang.org/stage0-snapshots/' - out_paths = [] - for arch, snapshot in snapshots.iteritems(): - url = url_base + snapshot - out_path = os.path.join(src_root_parent_dir, snapshot) - subprocess.check_call(["wget", "-N", url], cwd=src_root_parent_dir) - out_paths.append(out_path) - print "Building %s" % dl_tarfile - # extra flags for reproducibility - subprocess.check_call([ - "tar", "--mtime=@%s" % int(time.time()), "--clamp-mtime", - "-cJf", dl_tarfile - ] + snapshots.values(), cwd=src_root_parent_dir) - -create_dl_tarball() diff --git a/debian/make_orig-dl_tarball.sh b/debian/make_orig-dl_tarball.sh new file mode 100755 index 0000000000..667195456b --- /dev/null +++ b/debian/make_orig-dl_tarball.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# For versions 1.10 and later. +# ONLY FOR BOOTSTRAPPING with DEB_BUILD_PROFILES=dlstage0 +# +# Will create rustc_1.10.0+dfsg1.orig-dl.tar.xz; you should include this +# with your source upload. + +set -e + +upstream_version="$(dpkg-parsechangelog -SVersion | sed -e 's/\(.*\)-.*/\1/g')" +supported_arch="x86_64 i686" + +rm -rf dl/*.sha256 +for arch in $supported_arch; do + triplet="${arch}-unknown-linux-gnu" + python src/etc/get-stage0.py "$triplet" +done + +tar --mtime=@"$(date +%s)" --clamp-mtime \ + -cJf "../rustc_${upstream_version}.orig-dl.tar.xz" \ + --transform "s/^dl\///" \ + dl/* diff --git a/debian/patches/add-soname b/debian/patches/add-soname index 0958272a49..a879a00870 100644 --- a/debian/patches/add-soname +++ b/debian/patches/add-soname @@ -18,15 +18,13 @@ Description: Set DT_SONAME when building dylibs Author: Angus Lees Forwarded: no -Index: rustc.git/src/librustc_trans/back/link.rs -=================================================================== ---- rustc.git.orig/src/librustc_trans/back/link.rs -+++ rustc.git/src/librustc_trans/back/link.rs -@@ -1017,6 +1017,12 @@ fn link_args(cmd: &mut Linker, +--- a/src/librustc_trans/back/link.rs ++++ b/src/librustc_trans/back/link.rs +@@ -840,6 +840,12 @@ cmd.args(&rpath::get_rpath_flags(&mut rpath_config)); } -+ if dylib && t.options.linker_is_gnu { ++ if crate_type == config::CrateTypeDylib && t.options.linker_is_gnu { + let filename = String::from(out_filename.file_name().unwrap().to_str().unwrap()); + let soname = [String::from("-Wl,-soname=") + &filename]; + cmd.args(&soname); diff --git a/debian/patches/avoid-redundant-dls.diff b/debian/patches/avoid-redundant-dls.diff new file mode 100644 index 0000000000..7ab2b17161 --- /dev/null +++ b/debian/patches/avoid-redundant-dls.diff @@ -0,0 +1,36 @@ +Description: Avoid redundant downloads when bootstrapping + If the local file is available, then verify it against the hash we just + downloaded, and if it matches then we don't need to download it again. +Author: Ximin Luo +Applied-Upstream: commit:a120ae70d08d2eb991c7796e8726debb7ad46dea +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/src/bootstrap/bootstrap.py ++++ b/src/bootstrap/bootstrap.py +@@ -28,6 +28,14 @@ + + try: + download(sha_path, sha_url, verbose) ++ if os.path.exists(path): ++ try: ++ verify(path, sha_path, verbose) ++ print("using already-download file " + path) ++ return ++ except Exception as e: ++ print("failed verification for already-download file " + path) ++ os.unlink(path) + download(temp_path, url, verbose) + verify(temp_path, sha_path, verbose) + print("moving " + temp_path + " to " + path) +--- a/src/etc/get-stage0.py ++++ b/src/etc/get-stage0.py +@@ -35,8 +35,7 @@ + filename = filename_base + '.tar.gz' + url = 'https://static.rust-lang.org/dist/' + date + '/' + filename + dst = dl_dir + '/' + filename +- if not os.path.exists(dst): +- bootstrap.get(url, dst) ++ bootstrap.get(url, dst) + + stage0_dst = triple + '/stage0' + if os.path.exists(stage0_dst): diff --git a/debian/patches/dont-download-stage0.diff b/debian/patches/dont-download-stage0.diff new file mode 100644 index 0000000000..b9119a83c9 --- /dev/null +++ b/debian/patches/dont-download-stage0.diff @@ -0,0 +1,50 @@ +Description: Don't download SHA256 if it's already available locally + In Debian we provide the stage0 tarballs as a separate component so that the + buildds don't need to access the network during the build. +Author: Ximin Luo +Forwarded: not-needed +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/src/bootstrap/bootstrap.py ++++ b/src/bootstrap/bootstrap.py +@@ -19,15 +19,17 @@ + import tempfile + + +-def get(url, path, verbose=False): ++def get(url, path, verbose=False, use_local_hash_if_present=False): + sha_url = url + ".sha256" + with tempfile.NamedTemporaryFile(delete=False) as temp_file: + temp_path = temp_file.name +- with tempfile.NamedTemporaryFile(suffix=".sha256", delete=False) as sha_file: +- sha_path = sha_file.name ++ sha_path = path + ".sha256" + + try: +- download(sha_path, sha_url, verbose) ++ if use_local_hash_if_present and os.path.exists(sha_path): ++ print("using already-download file " + sha_path) ++ else: ++ download(sha_path, sha_url, verbose) + if os.path.exists(path): + try: + verify(path, sha_path, verbose) +@@ -41,7 +43,6 @@ + print("moving " + temp_path + " to " + path) + shutil.move(temp_path, path) + finally: +- delete_if_present(sha_path) + delete_if_present(temp_path) + + +--- a/src/etc/get-stage0.py ++++ b/src/etc/get-stage0.py +@@ -35,7 +35,7 @@ + filename = filename_base + '.tar.gz' + url = 'https://static.rust-lang.org/dist/' + date + '/' + filename + dst = dl_dir + '/' + filename +- bootstrap.get(url, dst) ++ bootstrap.get(url, dst, use_local_hash_if_present=True) + + stage0_dst = triple + '/stage0' + if os.path.exists(stage0_dst): diff --git a/debian/patches/fix-debian-cmake-path.diff b/debian/patches/fix-debian-cmake-path.diff new file mode 100644 index 0000000000..8e0fb20821 --- /dev/null +++ b/debian/patches/fix-debian-cmake-path.diff @@ -0,0 +1,11 @@ +--- a/src/compiler-rt/CMakeLists.txt ++++ b/src/compiler-rt/CMakeLists.txt +@@ -104,7 +104,7 @@ + + # Make use of LLVM CMake modules. + file(TO_CMAKE_PATH ${LLVM_BINARY_DIR} LLVM_BINARY_DIR_CMAKE_STYLE) +- set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR_CMAKE_STYLE}/share/llvm/cmake") ++ set(LLVM_CMAKE_PATH "/usr/share/llvm-3.7/cmake") + list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}") + # Get some LLVM variables from LLVMConfig. + include("${LLVM_CMAKE_PATH}/LLVMConfig.cmake") diff --git a/debian/patches/rust-gdb-paths b/debian/patches/rust-gdb-paths index 510352d8c6..0f434e9e7d 100644 --- a/debian/patches/rust-gdb-paths +++ b/debian/patches/rust-gdb-paths @@ -8,7 +8,7 @@ Forwarded: not-needed +++ b/src/etc/rust-gdb @@ -13,11 +13,13 @@ set -e - + # Find out where the pretty printer Python module is -RUSTC_SYSROOT=`rustc --print=sysroot` -GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc" @@ -16,7 +16,7 @@ Forwarded: not-needed +#GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc" +# We can just hardcode this on Debian, and remove the rustc dependency +GDB_PYTHON_MODULE_DIRECTORY="/usr/share/rust-gdb" - + # Run GDB with the additional arguments that load the pretty printers -PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" gdb \ +PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" exec gdb \ diff --git a/debian/patches/rust-lldb-paths b/debian/patches/rust-lldb-paths index 7ec9ca594c..ca6add8500 100644 --- a/debian/patches/rust-lldb-paths +++ b/debian/patches/rust-lldb-paths @@ -6,10 +6,10 @@ Forwarded: not-needed --- a/src/etc/rust-lldb +++ b/src/etc/rust-lldb -@@ -18,11 +18,8 @@ TMPFILE=`mktemp /tmp/rust-lldb-commands.XXXXXX` +@@ -18,11 +18,8 @@ # Make sure to delete the tempfile no matter what trap "rm -f $TMPFILE; exit" INT TERM EXIT - + -# Find out where to look for the pretty printer Python module -RUSTC_SYSROOT=`rustc --print sysroot` - @@ -18,3 +18,4 @@ Forwarded: not-needed +echo "command script import \"/usr/share/rust-lldb/lldb_rust_formatters.py\"" >> $TMPFILE echo "type summary add --no-value --python-function lldb_rust_formatters.print_val -x \".*\" --category Rust" >> $TMPFILE echo "type category enable Rust" >> $TMPFILE + diff --git a/debian/patches/series b/debian/patches/series index 0c516fdb20..953b7385b2 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -2,3 +2,6 @@ rust-gdb-paths rust-lldb-paths add-soname valgrind-workaround.diff +fix-debian-cmake-path.diff +avoid-redundant-dls.diff +dont-download-stage0.diff diff --git a/debian/patches/valgrind-workaround.diff b/debian/patches/valgrind-workaround.diff index 2caf7e9e60..12e36bd015 100644 --- a/debian/patches/valgrind-workaround.diff +++ b/debian/patches/valgrind-workaround.diff @@ -1,7 +1,5 @@ -Index: rust.c/src/test/run-pass-valgrind/down-with-thread-dtors.rs -=================================================================== ---- rust.c.orig/src/test/run-pass-valgrind/down-with-thread-dtors.rs -+++ rust.c/src/test/run-pass-valgrind/down-with-thread-dtors.rs +--- a/src/test/run-pass-valgrind/down-with-thread-dtors.rs ++++ b/src/test/run-pass-valgrind/down-with-thread-dtors.rs @@ -10,6 +10,8 @@ // no-prefer-dynamic diff --git a/debian/rules b/debian/rules index 5f4edea5dc..277c9cde17 100755 --- a/debian/rules +++ b/debian/rules @@ -55,9 +55,10 @@ DEB_CONFIGURE_FLAGS = \ DEB_CONFIGURE_FLAGS += --llvm-root=/usr/lib/llvm-3.7 ifeq (,$(findstring dlstage0,$(DEB_BUILD_PROFILES))) -# Without these options, a pre-built stage0 will be downloaded from -# rust-lang.org at build time (or looked for in dl/). - #DEB_CONFIGURE_FLAGS += --enable-local-rust --local-rust-root=/usr +# With the dlstage0 profile, rust build scripts will look for a pre-built +# stage0 in dl/. This can either be satisfied by the make_orig-dl_tarball.sh +# script, or else the build scripts will download these from rust-lang.org. + DEB_CONFIGURE_FLAGS += --enable-local-rust --local-rust-root=/usr endif BUILD_DOCS = 1 diff --git a/debian/update-version.sh b/debian/update-version.sh index c034fb7913..33690f353d 100644 --- a/debian/update-version.sh +++ b/debian/update-version.sh @@ -1,6 +1,6 @@ #!/bin/bash -ORIG=1.8 -NEW=1.9 +ORIG=1.9 +NEW=1.10 sed -i -e "s|libstd-rust-$ORIG|libstd-rust-$NEW|g" control