Skip to content
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

rust v1.50.0 #75

Merged
merged 13 commits into from
Feb 26, 2021
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .ci_support/linux_64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ rust_arch:
- x86_64-unknown-linux-gnu
target_platform:
- linux-64
zip_keys:
- - cdt_name
- docker_image
6 changes: 3 additions & 3 deletions README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

173 changes: 173 additions & 0 deletions recipe/0001-gh-106-install.sh-Perfomance-Use-more-shell-builtins.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
From 3d7ed69185bda705171729e01c84c12143332236 Mon Sep 17 00:00:00 2001
From: Marcel Bargull <[email protected]>
Date: Fri, 19 Feb 2021 12:49:34 +0100
Subject: [PATCH] install.sh: Perfomance: Use more shell builtins

Replace echo/grep/cut/dirname/basename by variable substitutions and
case pattern matching to reduce the amount of subprocesses called for
every copied file.
---
install.sh | 91 +++++++++++++++++++--------------------------
1 file changed, 38 insertions(+), 53 deletions(-)

diff --git a/install.sh b/install.sh
index e68be89..3120e5d 100755
--- a/install.sh
+++ b/install.sh
@@ -174,11 +174,11 @@ valopt() {
eval $v="$default"
for arg in $CFG_ARGS
do
- if echo "$arg" | grep -q -- "--$op="
- then
- local val=$(echo "$arg" | cut -f2 -d=)
- eval $v=$val
- fi
+ case "${arg}" in
+ "--${op}="* )
+ local val="${arg#--${op}=}"
+ eval $v=$val
+ esac
done
putvar $v
else
@@ -280,10 +280,10 @@ validate_opt () {
done
for option in $VAL_OPTIONS
do
- if echo "$arg" | grep -q -- "--$option="
- then
- is_arg_valid=1
- fi
+ case "${arg}" in
+ "--${option}="* )
+ is_arg_valid=1
+ esac
done
if [ "$arg" = "--help" ]
then
@@ -302,8 +302,8 @@ validate_opt () {

absolutify() {
local file_path="$1"
- local file_path_dirname="$(dirname "$file_path")"
- local file_path_basename="$(basename "$file_path")"
+ local file_path_dirname="${file_path%/*}"
+ local file_path_basename="${file_path##*/}"
local file_abs_path="$(abs_path "$file_path_dirname")"
local file_path="$file_abs_path/$file_path_basename"
# This is the return value
@@ -442,8 +442,8 @@ uninstall_components() {
local _directive
while read _directive; do

- local _command=`echo $_directive | cut -f1 -d:`
- local _file=`echo $_directive | cut -f2 -d:`
+ local _command="${_directive%%:*}"
+ local _file="${_directive#*:}"

# Sanity checks
if [ ! -n "$_command" ]; then critical_err "malformed installation directive"; fi
@@ -549,8 +549,8 @@ install_components() {
local _directive
while read _directive; do

- local _command=`echo $_directive | cut -f1 -d:`
- local _file=`echo $_directive | cut -f2 -d:`
+ local _command="${_directive%%:*}"
+ local _file="${_directive#*:}"

# Sanity checks
if [ ! -n "$_command" ]; then critical_err "malformed installation directive"; fi
@@ -559,35 +559,23 @@ install_components() {
# Decide the destination of the file
local _file_install_path="$_dest_prefix/$_file"

- if echo "$_file" | grep "^etc/" > /dev/null
- then
- local _f="$(echo "$_file" | sed 's/^etc\///')"
- _file_install_path="$CFG_SYSCONFDIR/$_f"
- fi
-
- if echo "$_file" | grep "^bin/" > /dev/null
- then
- local _f="$(echo "$_file" | sed 's/^bin\///')"
- _file_install_path="$CFG_BINDIR/$_f"
- fi
-
- if echo "$_file" | grep "^lib/" > /dev/null
- then
- local _f="$(echo "$_file" | sed 's/^lib\///')"
- _file_install_path="$CFG_LIBDIR/$_f"
- fi
-
- if echo "$_file" | grep "^share" > /dev/null
- then
- local _f="$(echo "$_file" | sed 's/^share\///')"
- _file_install_path="$CFG_DATADIR/$_f"
- fi
-
- if echo "$_file" | grep "^share/man/" > /dev/null
- then
- local _f="$(echo "$_file" | sed 's/^share\/man\///')"
- _file_install_path="$CFG_MANDIR/$_f"
- fi
+ case "${_file}" in
+ etc/* )
+ _file_install_path="$CFG_SYSCONFDIR/${_file#etc/}"
+ ;;
+ bin/* )
+ _file_install_path="$CFG_BINDIR/${_file#bin/}"
+ ;;
+ lib/* )
+ _file_install_path="$CFG_LIBDIR/${_file#lib/}"
+ ;;
+ share/man/* )
+ _file_install_path="$CFG_MANDIR/${_file#share/man/}"
+ ;;
+ share/* )
+ _file_install_path="$CFG_DATADIR/${_file#share/}"
+ ;;
+ esac

# HACK: Try to support overriding --docdir. Paths with the form
# "share/doc/$product/" can be redirected to a single --docdir
@@ -601,15 +589,14 @@ install_components() {
# this problem to be a big deal in practice.
if [ "$CFG_DOCDIR" != "<default>" ]
then
- if echo "$_file" | grep "^share/doc/" > /dev/null
- then
- local _f="$(echo "$_file" | sed 's/^share\/doc\/[^/]*\///')"
- _file_install_path="$CFG_DOCDIR/$_f"
- fi
+ case "${_file}" in
+ share/doc/* )
+ _file_install_path="$CFG_DOCDIR/${_file#share/doc/*/}"
+ esac
fi

# Make sure there's a directory for it
- make_dir_recursive "$(dirname "$_file_install_path")"
+ make_dir_recursive "${_file_install_path%/*}"
critical_need_ok "directory creation failed"

# Make the path absolute so we can uninstall it later without
@@ -625,7 +612,7 @@ install_components() {

maybe_backup_path "$_file_install_path"

- if echo "$_file" | grep "^bin/" > /dev/null || test -x "$_src_dir/$_component/$_file"
+ if test -z "${_file##bin/*}" || test -x "$_src_dir/$_component/$_file"
then
run cp "$_src_dir/$_component/$_file" "$_file_install_path"
run chmod 755 "$_file_install_path"
@@ -770,8 +757,6 @@ verbose_msg

need_cmd mkdir
need_cmd printf
-need_cmd cut
-need_cmd grep
need_cmd uname
need_cmd tr
need_cmd sed
8 changes: 8 additions & 0 deletions recipe/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
set MSYSTEM=MINGW%ARCH%
set MSYS2_PATH_TYPE=inherit
set CHERE_INVOKING=1
FOR /F "delims=" %%i in ('cygpath.exe -u "%PREFIX%/Library"') DO set "PREFIX=%%i"
FOR /F "delims=" %%i in ('cygpath.exe -u "%SRC_DIR%"') DO set "SRC_DIR=%%i"
copy "%RECIPE_DIR%\build.sh" .
bash -lce "%SRC_DIR%/build.sh"
if errorlevel 1 exit 1
24 changes: 24 additions & 0 deletions recipe/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

set -ex

# windows shell doesn't start here
cd $SRC_DIR

DESTDIR=$PWD/destdir/

# we want to install only a portion of the full installation.
# To do that, let's use destdir and then use the manifest-rust-std-* file
# to install the files corresponding to rust-std
./install.sh --prefix=$PREFIX --destdir=$DESTDIR

# install.log is large because it records full paths for each file.
# => conda-build is slow to parse ripgrep's output for prefix replacement.
# => replace path records beforehand:
install_log="${DESTDIR}${PREFIX}/lib/rustlib/install.log"
sed \
-e "s|${PREFIX}|/prefix|g" \
-e "s|${DESTDIR}|/destdir|g" \
-e "s|${PWD}|/source|g" \
-i.bak "${install_log}"
rm "${install_log}.bak"
Comment on lines +17 to +24
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternative (if nobody wants/needs install.log):

Suggested change
# => replace path records beforehand:
install_log="${DESTDIR}${PREFIX}/lib/rustlib/install.log"
sed \
-e "s|${PREFIX}|/prefix|g" \
-e "s|${DESTDIR}|/destdir|g" \
-e "s|${PWD}|/source|g" \
-i.bak "${install_log}"
rm "${install_log}.bak"
# => remove install.log:
rm "${DESTDIR}${PREFIX}/lib/rustlib/install.log"

5 changes: 2 additions & 3 deletions recipe/install-rust-std.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ cd $SRC_DIR
DESTDIR=$PWD/destdir/

# we want to install only a portion of the full installation.
# To do that, let's use destdir and then use the manifest-rust-std-* file
# to install the files corresponding to rust-std
./install.sh --prefix=$PREFIX --destdir=$DESTDIR
# To do that, let's use destdir (populated via build.sh) and then use the
# manifest-rust-std-* file to install the files corresponding to rust-std

while read line; do
file=$(echo $line | cut -b 6-)
Expand Down
5 changes: 4 additions & 1 deletion recipe/install-rust.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ set -ex
# windows shell doesn't start here
cd $SRC_DIR

./install.sh --prefix=$PREFIX
mbargull marked this conversation as resolved.
Show resolved Hide resolved
DESTDIR=$PWD/destdir/

# Copy everything that has been prepared by build.sh from DESTDIR to PREFIX.
cp -aR "${DESTDIR}${PREFIX}"/* "${PREFIX}/"

# Fun times -- by default, Rust/Cargo tries to link executables on Linux by
# invoking `cc`. An executable of this name is not necessarily available. By
Expand Down
21 changes: 14 additions & 7 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% set version = "1.49.0" %}
{% set version = "1.50.0" %}

package:
name: rust-split
Expand All @@ -11,16 +11,23 @@ source:
url: https://static.rust-lang.org/dist/rust-{{ version }}-x86_64-apple-darwin.tar.gz # [osx and x86_64]
url: https://static.rust-lang.org/dist/rust-{{ version }}-aarch64-apple-darwin.tar.gz # [osx and arm64]
url: https://static.rust-lang.org/dist/rust-{{ version }}-x86_64-pc-windows-msvc.tar.gz # [win64]
sha256: 8b14446df82f3707d69cf58fed92f18e0bff91621c62baf89288ef70e3e92981 # [linux and x86_64]
sha256: b551bd482041307fa3373a687d6d6a2c4c0931c2e0a68b8b75dc80bc5cf5f002 # [aarch64]
sha256: 365d7721dd2521e5dad12aa73651bad2be375e798e443636d2c523cad5b54359 # [ppc64le]
sha256: fe3e248bc4b0ee0a2595693687ad845c8a8bda824a56c9321520bcca02433716 # [osx and x86_64]
sha256: ce7d689e6f73dd9c07b672ba23dabe5159fa8c194dce71b4f3f95baeaf564082 # [osx and arm64]
sha256: 5340831dcf98344de4a6888b50237f82568a97a46d9814f1400720dde0c7b6e5 # [win64]
sha256: fa889b53918980aea2dea42bfae4e858dcb2104c6fdca6e4fe359f3a49767701 # [linux and x86_64]
sha256: 1db7a4fbddc68cd29eb9bca9fa7d0d2d9e3d59ede7ddaad66222fb4336a6bacf # [aarch64]
sha256: e0472589d3f9ba7ebf27f033af320e0d5cfb70222955bd8ed73ce2c9a70ae535 # [ppc64le]
sha256: 1bf5a7ecf6468ce1bf9fe49c8083b3f648b40c16fbfb7539d106fe28eb0e792e # [osx and x86_64]
sha256: 1ed91a867e7b86cc4bc84c0838240f1c25acd007100ec9f7a14c4873e4b56561 # [osx and arm64]
sha256: e8857c30b43b7d92371f824303d18e90e67e1053497366ad3496fa7ba0e0de6e # [win64]
patches:
- 0001-gh-106-install.sh-Perfomance-Use-more-shell-builtins.patch

build:
number: 0

requirements:
build:
- posix # [win]
host:

outputs:
- name: rust-std-{{ rust_arch }}
build:
Expand Down