mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
Remove lots of dated configuration from this repo
Lots of data build stuff is still here from awhile ago when this repo was producing Cargo binaries, but the rust-lang/rust repo is now responsible for all these binaries and build configurations. We no longer need to produce artifacts or have tons of cross-compiles as rust-lang/rust does all that work, instead let's just test the likely-to-regress platforms and have rust-lang/rust take care of the rest. This commit: * Deletes the old `configure` script and `Makefile` * Rewrites `src/doc` management as a shell script * Trims down Travis/AppVeyor configuration
This commit is contained in:
parent
82733b0147
commit
50a46f4708
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,3 +0,0 @@
|
||||
[submodule "src/rust-installer"]
|
||||
path = src/rust-installer
|
||||
url = https://github.com/rust-lang/rust-installer.git
|
144
.travis.yml
144
.travis.yml
@ -2,161 +2,53 @@ language: rust
|
||||
rust: stable
|
||||
sudo: required
|
||||
dist: trusty
|
||||
os: linux
|
||||
services:
|
||||
- docker
|
||||
|
||||
git:
|
||||
depth: 1
|
||||
|
||||
matrix:
|
||||
include:
|
||||
# stable linux builds, tested
|
||||
- env: TARGET=x86_64-unknown-linux-gnu
|
||||
ALT=i686-unknown-linux-gnu
|
||||
IMAGE=dist
|
||||
MAKE_TARGETS="test distcheck doc install uninstall"
|
||||
ALLOW_PR=1
|
||||
NO_ADD=1
|
||||
- env: TARGET=i686-unknown-linux-gnu
|
||||
IMAGE=dist
|
||||
MAKE_TARGETS=test-unit-i686-unknown-linux-gnu
|
||||
CFG_DISABLE_CROSS_TESTS=1
|
||||
|
||||
# stable osx builds, tested
|
||||
- env: TARGET=x86_64-apple-darwin
|
||||
ALT=i686-apple-darwin
|
||||
MAKE_TARGETS="test distcheck doc install uninstall"
|
||||
MACOSX_DEPLOYMENT_TARGET=10.7
|
||||
NO_ADD=1
|
||||
os: osx
|
||||
- env: TARGET=i686-apple-darwin
|
||||
MAKE_TARGETS=test-unit-i686-apple-darwin
|
||||
MACOSX_DEPLOYMENT_TARGET=10.7
|
||||
CFG_DISABLE_CROSS_TESTS=1
|
||||
os: osx
|
||||
|
||||
# stable musl target, tested
|
||||
- env: TARGET=x86_64-unknown-linux-musl
|
||||
IMAGE=x86_64-musl
|
||||
CFG_DISABLE_CROSS_TESTS=1
|
||||
MAKE_TARGETS=test-unit-$TARGET
|
||||
|
||||
# cross compiled targets
|
||||
- env: TARGET=armv7-linux-androideabi
|
||||
IMAGE=android
|
||||
- env: TARGET=arm-unknown-linux-gnueabi
|
||||
IMAGE=cross
|
||||
- env: TARGET=arm-unknown-linux-gnueabihf
|
||||
IMAGE=cross
|
||||
- env: TARGET=armv7-unknown-linux-gnueabihf
|
||||
IMAGE=cross
|
||||
- env: TARGET=aarch64-unknown-linux-gnu
|
||||
IMAGE=cross
|
||||
- env: TARGET=i686-unknown-freebsd
|
||||
IMAGE=cross
|
||||
- env: TARGET=x86_64-unknown-freebsd
|
||||
IMAGE=cross
|
||||
- env: TARGET=x86_64-unknown-netbsd
|
||||
IMAGE=cross
|
||||
- env: TARGET=mips-unknown-linux-gnu
|
||||
IMAGE=cross
|
||||
- env: TARGET=mipsel-unknown-linux-gnu
|
||||
IMAGE=cross
|
||||
- env: TARGET=mips64-unknown-linux-gnuabi64
|
||||
IMAGE=cross
|
||||
rust: beta
|
||||
- env: TARGET=mips64el-unknown-linux-gnuabi64
|
||||
IMAGE=cross
|
||||
rust: beta
|
||||
- env: TARGET=s390x-unknown-linux-gnu
|
||||
IMAGE=cross
|
||||
rust: beta
|
||||
- env: TARGET=powerpc-unknown-linux-gnu
|
||||
IMAGE=cross
|
||||
rust: beta
|
||||
- env: TARGET=powerpc64-unknown-linux-gnu
|
||||
IMAGE=cross
|
||||
rust: beta
|
||||
- env: TARGET=powerpc64le-unknown-linux-gnu
|
||||
IMAGE=cross
|
||||
rust: beta
|
||||
|
||||
# beta/nightly builds
|
||||
- env: TARGET=x86_64-unknown-linux-gnu
|
||||
ALT=i686-unknown-linux-gnu
|
||||
IMAGE=dist
|
||||
MAKE_TARGETS="test distcheck doc install uninstall"
|
||||
DEPLOY=0
|
||||
NO_ADD=1
|
||||
rust: beta
|
||||
|
||||
- env: TARGET=x86_64-unknown-linux-gnu
|
||||
ALT=i686-unknown-linux-gnu
|
||||
IMAGE=dist
|
||||
MAKE_TARGETS="test distcheck doc install uninstall"
|
||||
DEPLOY=0
|
||||
NO_ADD=1
|
||||
rust: nightly
|
||||
script:
|
||||
- cargo test
|
||||
- cargo doc --no-deps
|
||||
- sh src/ci/dox.sh
|
||||
after_success: |
|
||||
[ $TRAVIS_BRANCH = master ] &&
|
||||
[ $TRAVIS_PULL_REQUEST = false ] &&
|
||||
[ $(uname -s) = Linux ] &&
|
||||
pip install ghp-import --user &&
|
||||
$HOME/.local/bin/ghp-import -n target/doc &&
|
||||
git push -qf https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages 2>&1 > /dev/null
|
||||
|
||||
exclude:
|
||||
- rust: stable
|
||||
|
||||
before_script:
|
||||
- if [ -z "$NO_ADD" ]; then rustup target add $TARGET; fi
|
||||
- if [ ! -z "$ALT" ]; then rustup target add $ALT; fi
|
||||
- rustup target add $ALT
|
||||
script:
|
||||
- >
|
||||
if [ "$ALLOW_PR" = "" ] && [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
|
||||
echo skipping, not a full build;
|
||||
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
SRC=. src/ci/run.sh $TARGET;
|
||||
else
|
||||
src/ci/docker/run.sh $IMAGE $TARGET;
|
||||
fi
|
||||
|
||||
after_success: |
|
||||
[ $TRAVIS_BRANCH = master ] &&
|
||||
[ $TRAVIS_PULL_REQUEST = false ] &&
|
||||
[ $(uname -s) = Linux ] &&
|
||||
pip install ghp-import --user &&
|
||||
$HOME/.local/bin/ghp-import -n target/doc &&
|
||||
git push -qf https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages 2>&1 > /dev/null
|
||||
- cargo test
|
||||
|
||||
env:
|
||||
global:
|
||||
- DEPLOY=1
|
||||
- secure: "hWheSLilMM4DXChfSy2XsDlLw338X2o+fw8bE590xxU2TzngFW8GUfq7lGfZEp/l4SNNIS6ROU/igyttCZtxZMANZ4aMQZR5E8Fp4yPOyE1pZLDH/LdQVXnROsfburQJeq+GIYIbZ01Abzh5ClpgLg5KX0H627uj063zZ7Ljo/w="
|
||||
|
||||
notifications:
|
||||
email:
|
||||
on_success: never
|
||||
|
||||
before_deploy:
|
||||
- mkdir -p deploy/$TRAVIS_COMMIT
|
||||
- cp target/$TARGET/release/dist/cargo-*-$TARGET.tar.gz
|
||||
deploy/$TRAVIS_COMMIT
|
||||
- >
|
||||
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
|
||||
find "deploy/$TRAVIS_COMMIT" -maxdepth 1 -type f -exec sh -c 'shasum -a 256 -b "{}" > "{}.sha256"' \;;
|
||||
else
|
||||
find "deploy/$TRAVIS_COMMIT" -maxdepth 1 -type f -exec sh -c 'sha256sum -b "{}" > "{}.sha256"' \;;
|
||||
fi
|
||||
|
||||
deploy:
|
||||
- provider: s3
|
||||
bucket: rust-lang-ci
|
||||
skip_cleanup: true
|
||||
local_dir: deploy
|
||||
upload_dir: cargo-builds
|
||||
acl: public_read
|
||||
region: us-east-1
|
||||
access_key_id: AKIAIWZDM2B2IJOWBGTA
|
||||
secret_access_key:
|
||||
secure: NB9b/MhIDiv8OtNiN/sHaFgA3xG2fa7MGuQQKJNj80ktvgByzDm5UPNyNeoYx9SmJ3jOWobgcPVaoUd2S+6XgO3bMBqm7sM/oMeE0KdqToh6+V2bKfyRF2U5fm697LEGepPIBYqMLDg4nr/dbknbKltzp6dAfJRyy22Nb721zPQ=
|
||||
on:
|
||||
branch: auto-cargo
|
||||
condition: $DEPLOY = 1
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- target/openssl
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- gcc-multilib
|
||||
|
427
Makefile.in
427
Makefile.in
@ -1,427 +0,0 @@
|
||||
CFG_RELEASE_NUM=0.20.0
|
||||
CFG_RELEASE_LABEL=
|
||||
|
||||
OPENSSL_VERS=1.0.2k
|
||||
OPENSSL_SHA256=6b3977c61f2aedf0f96367dcfb5c6e578cf37e7b8d913b4ecb6643c3cb88d8c0
|
||||
|
||||
include config.mk
|
||||
|
||||
export PATH := $(dir $(CFG_RUSTC)):$(PATH)
|
||||
|
||||
ifeq ($(CFG_RELEASE_CHANNEL),stable)
|
||||
CFG_RELEASE=$(CFG_RELEASE_NUM)
|
||||
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)
|
||||
else ifeq ($(CFG_RELEASE_CHANNEL),beta)
|
||||
CFG_RELEASE=$(CFG_RELEASE_NUM)-beta
|
||||
CFG_PACKAGE_VERS=beta
|
||||
else ifeq ($(CFG_RELEASE_CHANNEL),nightly)
|
||||
CFG_RELEASE=$(CFG_RELEASE_NUM)-nightly
|
||||
CFG_PACKAGE_VERS=nightly
|
||||
else ifeq ($(CFG_RELEASE_CHANNEL),dev)
|
||||
CFG_RELEASE=$(CFG_RELEASE_NUM)-dev
|
||||
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-dev
|
||||
endif
|
||||
|
||||
# allow build systems to use a constant date instead of the current one
|
||||
CFG_BUILD_DATE = $(shell SOURCE_DATE_EPOCH="$${SOURCE_DATE_EPOCH:-$$(date +%s)}" ; date -u -d "@$$SOURCE_DATE_EPOCH" +%F 2>/dev/null || date -u -r "$$SOURCE_DATE_EPOCH" +%F 2>/dev/null || date -u +%F)
|
||||
|
||||
ifneq ($(wildcard $(CFG_SRC_DIR)/.git),)
|
||||
CFG_COMMIT_DATE = $(shell git --git-dir='$(CFG_SRC_DIR).git' log -1 --date=short --pretty=format:'%cd')
|
||||
CFG_SHORT_COMMIT_HASH = $(shell git --git-dir='$(CFG_SRC_DIR).git' rev-parse --short HEAD)
|
||||
CFG_COMMIT_HASH = $(shell git --git-dir='$(CFG_SRC_DIR).git' rev-parse HEAD)
|
||||
endif
|
||||
PKG_NAME = cargo-$(CFG_PACKAGE_VERS)
|
||||
|
||||
ifdef CFG_DISABLE_VERIFY_INSTALL
|
||||
MAYBE_DISABLE_VERIFY=--disable-verify
|
||||
else
|
||||
MAYBE_DISABLE_VERIFY=
|
||||
endif
|
||||
|
||||
ifdef CFG_DISABLE_OPTIMIZE
|
||||
OPT_FLAG=
|
||||
else
|
||||
OPT_FLAG=--release
|
||||
endif
|
||||
|
||||
ifdef VERBOSE
|
||||
VERBOSE_FLAG=--verbose
|
||||
else
|
||||
VERBOSE_FLAG=
|
||||
endif
|
||||
|
||||
ifdef CFG_CUSTOM_BUILD_DIR
|
||||
export CARGO_TARGET_DIR := $(CFG_CUSTOM_BUILD_DIR)
|
||||
endif
|
||||
|
||||
S := $(CFG_SRC_DIR)/
|
||||
|
||||
CFG_RELEASE_PARTS := $(subst ., ,$(CFG_RELEASE_NUM))
|
||||
CFG_VERSION_MAJOR := $(word 1,$(CFG_RELEASE_PARTS))
|
||||
CFG_VERSION_MINOR := $(word 2,$(CFG_RELEASE_PARTS))
|
||||
CFG_VERSION_PATCH := $(word 3,$(CFG_RELEASE_PARTS))
|
||||
|
||||
# This is output to the 'version' file during packaging
|
||||
CFG_VERSION=$(CFG_RELEASE)
|
||||
ifneq ($(CFG_COMMIT_HASH),)
|
||||
CFG_VERSION=$(CFG_RELEASE) ($(CFG_SHORT_COMMIT_HASH) $(CFG_COMMIT_DATE))
|
||||
endif
|
||||
|
||||
export CFG_VERSION_MAJOR
|
||||
export CFG_VERSION_MINOR
|
||||
export CFG_VERSION_PATCH
|
||||
ifneq ($(CFG_COMMIT_HASH),)
|
||||
export CFG_COMMIT_HASH
|
||||
export CFG_COMMIT_DATE
|
||||
export CFG_SHORT_COMMIT_HASH
|
||||
endif
|
||||
export CFG_BUILD_DATE
|
||||
export CFG_RELEASE_CHANNEL
|
||||
export CFG_DISABLE_CROSS_TESTS
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
X = .exe
|
||||
endif
|
||||
|
||||
TARGET_ROOT = target
|
||||
BIN_TARGETS := cargo
|
||||
BIN_TARGETS := $(BIN_TARGETS:src/bin/%.rs=%)
|
||||
BIN_TARGETS := $(filter-out cargo,$(BIN_TARGETS))
|
||||
|
||||
define DIST_TARGET
|
||||
ifdef CFG_DISABLE_OPTIMIZE
|
||||
TARGET_$(1) = $$(TARGET_ROOT)/$(1)/debug
|
||||
else
|
||||
TARGET_$(1) = $$(TARGET_ROOT)/$(1)/release
|
||||
endif
|
||||
DISTDIR_$(1) = $$(TARGET_$(1))/dist
|
||||
IMGDIR_$(1) = $$(DISTDIR_$(1))/$$(PKG_NAME)-$(1)-image
|
||||
OVERLAYDIR_$(1) = $$(DISTDIR_$(1))/$$(PKG_NAME)-$(1)-overlay
|
||||
PKGDIR_$(1) = $$(DISTDIR_$(1))/$$(PKG_NAME)-$(1)
|
||||
BIN_TARGETS_$(1) := $$(BIN_TARGETS:%=$$(TARGET_$(1))/%$$(X))
|
||||
endef
|
||||
$(foreach target,$(CFG_TARGET),$(eval $(call DIST_TARGET,$(target))))
|
||||
|
||||
ifdef CFG_LOCAL_CARGO
|
||||
CARGO := $(CFG_LOCAL_CARGO)
|
||||
else
|
||||
CARGO := $(CFG_CARGO)
|
||||
endif
|
||||
|
||||
all: $(foreach target,$(CFG_TARGET),cargo-$(target))
|
||||
|
||||
define CARGO_TARGET
|
||||
cargo-$(1): target/openssl/$(1).stamp
|
||||
$$(CFG_RUSTC) -V
|
||||
$$(CARGO) --version
|
||||
$$(CARGO) build --target $(1) \
|
||||
--manifest-path $(S)Cargo.toml \
|
||||
$$(OPT_FLAG) $$(CARGOFLAGS) $$(VERBOSE_FLAG) $$(ARGS)
|
||||
|
||||
test-unit-$(1): target/openssl/$(1).stamp cargo-$(1)
|
||||
@mkdir -p $$(CFG_BUILD_DIR)/target/$(1)/cit
|
||||
$$(CARGO) test --target $(1) \
|
||||
--manifest-path $(S)Cargo.toml \
|
||||
$$(OPT_FLAG) $$(CARGOFLAGS) $$(VERBOSE_FLAG) $$(only) -- \
|
||||
--quiet
|
||||
endef
|
||||
$(foreach target,$(CFG_TARGET),$(eval $(call CARGO_TARGET,$(target))))
|
||||
|
||||
# === Tests
|
||||
|
||||
test: style no-exes $(foreach target,$(CFG_TARGET),test-unit-$(target))
|
||||
|
||||
style:
|
||||
(cd $(S) && sh tests/check-style.sh)
|
||||
|
||||
ifeq ($(CFG_GIT),)
|
||||
no-exes:
|
||||
else
|
||||
no-exes:
|
||||
(cd $(S) && find $$($(CFG_GIT) ls-files) -type f \
|
||||
\( -perm -u+x -or -perm -g+x -or -perm -o+x \) \
|
||||
-not -name configure -not -name '*.sh' -not -name '*.rs' \
|
||||
-not -name '*.py' -not -wholename "*/rust-installer/*" | \
|
||||
grep '.*' \
|
||||
&& exit 1 || exit 0)
|
||||
endif
|
||||
|
||||
# === Misc
|
||||
|
||||
Makefile config.mk: config.stamp
|
||||
config.stamp: $(CFG_SRC_DIR)configure $(CFG_SRC_DIR)Makefile.in
|
||||
$(CFG_SRC_DIR)configure $(CFG_CONFIGURE_ARGS)
|
||||
|
||||
clean-all: clean
|
||||
clean:
|
||||
rm -rf $(TARGET_ROOT)
|
||||
|
||||
# === Documentation
|
||||
|
||||
DOCS := index faq config guide manifest build-script pkgid-spec crates-io \
|
||||
environment-variables specifying-dependencies source-replacement \
|
||||
policies external-tools
|
||||
DOC_DIR := target/doc
|
||||
DOC_OPTS := --markdown-no-toc \
|
||||
--markdown-css stylesheets/normalize.css \
|
||||
--markdown-css stylesheets/all.css \
|
||||
--markdown-css stylesheets/prism.css \
|
||||
--html-in-header $(S)src/doc/html-headers.html \
|
||||
--html-before-content $(S)src/doc/header.html \
|
||||
--html-after-content $(S)src/doc/footer.html
|
||||
ASSETS := CNAME images/noise.png images/forkme.png images/Cargo-Logo-Small.png \
|
||||
stylesheets/all.css stylesheets/normalize.css javascripts/prism.js \
|
||||
javascripts/all.js stylesheets/prism.css images/circle-with-i.png \
|
||||
images/search.png images/org-level-acl.png images/auth-level-acl.png \
|
||||
favicon.ico
|
||||
|
||||
doc: $(foreach doc,$(DOCS),target/doc/$(doc).html) \
|
||||
$(foreach asset,$(ASSETS),target/doc/$(asset)) \
|
||||
target/doc/cargo/index.html
|
||||
|
||||
target/doc/cargo/index.html: target/openssl/$(CFG_BUILD).stamp cargo-$(CFG_BUILD)
|
||||
$(CARGO) doc --no-deps --target $(CFG_BUILD) \
|
||||
--manifest-path $(S)Cargo.toml $(OPT_FLAG)
|
||||
|
||||
$(DOC_DIR)/%.html: \
|
||||
$(S)src/doc/%.md \
|
||||
$(S)src/doc/html-headers.html \
|
||||
$(S)src/doc/header.html \
|
||||
$(S)src/doc/footer.html
|
||||
@mkdir -p $(@D)
|
||||
$(CFG_RUSTDOC) $< -o $(@D) $(DOC_OPTS)
|
||||
|
||||
$(DOC_DIR)/%: $(S)src/doc/%
|
||||
@mkdir -p $(@D)
|
||||
cp $< $@
|
||||
|
||||
OPENSSL_OS_aarch64-linux-android := linux-aarch64
|
||||
OPENSSL_OS_aarch64-unknown-linux-gnu := linux-aarch64
|
||||
OPENSSL_OS_arm-linux-androideabi := android
|
||||
OPENSSL_OS_arm-unknown-linux-gnueabi := linux-armv4
|
||||
OPENSSL_OS_arm-unknown-linux-gnueabihf := linux-armv4
|
||||
OPENSSL_OS_armv7-linux-androideabi := android-armv7
|
||||
OPENSSL_OS_armv7-unknown-linux-gnueabihf := linux-armv4
|
||||
OPENSSL_OS_i686-apple-darwin := darwin-i386-cc
|
||||
OPENSSL_OS_i686-linux-android := android-x86
|
||||
OPENSSL_OS_i686-unknown-freebsd := BSD-x86-elf
|
||||
OPENSSL_OS_i686-unknown-linux-gnu := linux-elf
|
||||
OPENSSL_OS_i686-unknown-linux-musl := linux-elf
|
||||
OPENSSL_OS_mips-unknown-linux-gnu := linux-mips32
|
||||
OPENSSL_OS_mips64-unknown-linux-gnuabi64 := linux64-mips64
|
||||
OPENSSL_OS_mips64el-unknown-linux-gnuabi64 := linux64-mips64
|
||||
OPENSSL_OS_mipsel-unknown-linux-gnu := linux-mips32
|
||||
OPENSSL_OS_powerpc-unknown-linux-gnu := linux-ppc
|
||||
OPENSSL_OS_powerpc64-unknown-linux-gnu := linux-ppc64
|
||||
OPENSSL_OS_powerpc64le-unknown-linux-gnu := linux-ppc64le
|
||||
OPENSSL_OS_s390x-unknown-linux-gnu := linux64-s390x
|
||||
OPENSSL_OS_x86_64-apple-darwin := darwin64-x86_64-cc
|
||||
OPENSSL_OS_x86_64-unknown-freebsd := BSD-x86_64
|
||||
OPENSSL_OS_x86_64-unknown-linux-gnu := linux-x86_64
|
||||
OPENSSL_OS_x86_64-unknown-linux-musl := linux-x86_64
|
||||
OPENSSL_OS_x86_64-unknown-netbsd := BSD-x86_64
|
||||
|
||||
OPENSSL_AR_aarch64-linux-android := aarch64-linux-android-ar
|
||||
OPENSSL_AR_aarch64-unknown-linux-gnu := aarch64-linux-gnu-ar
|
||||
OPENSSL_AR_arm-linux-androideabi := arm-linux-androideabi-ar
|
||||
OPENSSL_AR_arm-unknown-linux-gnueabi := arm-linux-gnueabi-ar
|
||||
OPENSSL_AR_arm-unknown-linux-gnueabihf := arm-linux-gnueabihf-ar
|
||||
OPENSSL_AR_armv7-linux-androideabi := arm-linux-androideabi-ar
|
||||
OPENSSL_AR_armv7-unknown-linux-gnueabihf := armv7-linux-gnueabihf-ar
|
||||
OPENSSL_AR_i686-apple-darwin := ar
|
||||
OPENSSL_AR_i686-linux-android := i686-linux-android-ar
|
||||
OPENSSL_AR_i686-unknown-freebsd := i686-unknown-freebsd10-ar
|
||||
OPENSSL_AR_i686-unknown-linux-gnu := ar
|
||||
OPENSSL_AR_i686-unknown-linux-musl := ar
|
||||
OPENSSL_AR_mips-unknown-linux-gnu := mips-linux-gnu-ar
|
||||
OPENSSL_AR_mips64-unknown-linux-gnuabi64 := mips64-linux-gnuabi64-ar
|
||||
OPENSSL_AR_mips64el-unknown-linux-gnuabi64 := mips64el-linux-gnuabi64-ar
|
||||
OPENSSL_AR_mipsel-unknown-linux-gnu := mipsel-linux-gnu-ar
|
||||
OPENSSL_AR_powerpc-unknown-linux-gnu := powerpc-linux-gnu-ar
|
||||
OPENSSL_AR_powerpc64-unknown-linux-gnu := powerpc64-linux-gnu-ar
|
||||
OPENSSL_AR_powerpc64le-unknown-linux-gnu := powerpc64le-linux-gnu-ar
|
||||
OPENSSL_AR_s390x-unknown-linux-gnu := s390x-linux-gnu-ar
|
||||
OPENSSL_AR_x86_64-apple-darwin := ar
|
||||
OPENSSL_AR_x86_64-unknown-freebsd := x86_64-unknown-freebsd10-ar
|
||||
OPENSSL_AR_x86_64-unknown-linux-gnu := ar
|
||||
OPENSSL_AR_x86_64-unknown-linux-musl := ar
|
||||
OPENSSL_AR_x86_64-unknown-netbsd := x86_64-unknown-netbsd-ar
|
||||
|
||||
OPENSSL_CC_aarch64-linux-android := aarch64-linux-android-gcc
|
||||
OPENSSL_CC_aarch64-unknown-linux-gnu := aarch64-linux-gnu-gcc
|
||||
OPENSSL_CC_arm-linux-androideabi := arm-linux-androideabi-gcc
|
||||
OPENSSL_CC_arm-unknown-linux-gnueabi := arm-linux-gnueabi-gcc
|
||||
OPENSSL_CC_arm-unknown-linux-gnueabihf := arm-linux-gnueabihf-gcc
|
||||
OPENSSL_CC_armv7-unknown-linux-gnueabihf := armv7-linux-gnueabihf-gcc
|
||||
OPENSSL_CC_armv7-linux-androideabi := arm-linux-androideabi-gcc
|
||||
OPENSSL_CC_i686-apple-darwin := clang
|
||||
OPENSSL_CC_i686-linux-android := i686-linux-android-gcc
|
||||
OPENSSL_CC_i686-unknown-freebsd := i686-unknown-freebsd10-gcc
|
||||
OPENSSL_CC_i686-unknown-linux-gnu := gcc
|
||||
OPENSSL_CC_i686-unknown-linux-musl := musl-gcc
|
||||
OPENSSL_CC_mips-unknown-linux-gnu := mips-linux-gnu-gcc
|
||||
OPENSSL_CC_mips64-unknown-linux-gnuabi64 := mips64-linux-gnuabi64-gcc
|
||||
OPENSSL_CC_mips64el-unknown-linux-gnuabi64 := mips64el-linux-gnuabi64-gcc
|
||||
OPENSSL_CC_mipsel-unknown-linux-gnu := mipsel-linux-gnu-gcc
|
||||
OPENSSL_CC_powerpc-unknown-linux-gnu := powerpc-linux-gnu-gcc
|
||||
OPENSSL_CC_powerpc64-unknown-linux-gnu := powerpc64-linux-gnu-gcc
|
||||
OPENSSL_CC_powerpc64le-unknown-linux-gnu := powerpc64le-linux-gnu-gcc
|
||||
OPENSSL_CC_s390x-unknown-linux-gnu := s390x-linux-gnu-gcc
|
||||
OPENSSL_CC_x86_64-apple-darwin := clang
|
||||
OPENSSL_CC_x86_64-unknown-freebsd := x86_64-unknown-freebsd10-gcc
|
||||
OPENSSL_CC_x86_64-unknown-linux-gnu := gcc
|
||||
OPENSSL_CC_x86_64-unknown-linux-musl := musl-gcc
|
||||
OPENSSL_CC_x86_64-unknown-netbsd := x86_64-unknown-netbsd-gcc
|
||||
|
||||
SETARCH_i686-unknown-linux-gnu := setarch i386
|
||||
|
||||
OPENSSL_CFLAGS_aarch64-linux-android := "-mandroid -fomit-frame-pointer"
|
||||
OPENSSL_CFLAGS_i686-apple-darwin := -m32
|
||||
OPENSSL_CFLAGS_i686-unknown-linux-gnu := -m32
|
||||
OPENSSL_CFLAGS_i686-unknown-linux-musl := -m32
|
||||
|
||||
define BUILD_OPENSSL
|
||||
|
||||
ifdef CFG_ENABLE_BUILD_OPENSSL
|
||||
|
||||
cargo-$(1): export OPENSSL_STATIC := 1
|
||||
test-unit-$(1): export OPENSSL_STATIC := 1
|
||||
|
||||
OPENSSL_INSTALL_$(1) := $$(CFG_BUILD_DIR)/target/openssl/$(1)-install
|
||||
|
||||
ifdef OPENSSL_OS_$(1)
|
||||
|
||||
target/openssl/$(1).stamp: target/openssl/openssl-$$(OPENSSL_VERS).tar.gz \
|
||||
| target/openssl/
|
||||
rm -rf target/openssl/$(1)
|
||||
mkdir -p target/openssl/$(1)
|
||||
tar xf $$< -C target/openssl/$(1) --strip-components 1
|
||||
(cd target/openssl/$(1) && \
|
||||
CC=$$(OPENSSL_CC_$(1)) \
|
||||
AR=$$(OPENSSL_AR_$(1)) \
|
||||
$$(SETARCH_$(1)) ./Configure --prefix=$$(OPENSSL_INSTALL_$(1)) \
|
||||
no-dso $$(OPENSSL_OS_$(1)) -fPIC $$(OPENSSL_CFLAGS_$(1))&& \
|
||||
$(MAKE) -j1 && \
|
||||
$(MAKE) install)
|
||||
touch $$@
|
||||
|
||||
# variables read by various build scripts to find openssl
|
||||
cargo-$(1): export OPENSSL_DIR := $$(OPENSSL_INSTALL_$(1))
|
||||
test-unit-$(1): export OPENSSL_DIR := $$(OPENSSL_INSTALL_$(1))
|
||||
|
||||
# build libz statically into the cargo we're producing
|
||||
cargo-$(1): export LIBZ_SYS_STATIC := 1
|
||||
|
||||
else # !OPENSSL_OS_$(1)
|
||||
target/openssl/$(1).stamp:
|
||||
|
||||
endif
|
||||
|
||||
else # !CFG_ENABLE_BUILD_OPENSSL
|
||||
target/openssl/$(1).stamp:
|
||||
endif
|
||||
|
||||
endef
|
||||
|
||||
$(foreach target,$(CFG_TARGET),$(eval $(call BUILD_OPENSSL,$(target))))
|
||||
|
||||
ifeq ($(shell uname),Darwin)
|
||||
SHASUM := shasum -a 256
|
||||
else
|
||||
SHASUM := sha256sum
|
||||
endif
|
||||
|
||||
target/openssl/openssl-$(OPENSSL_VERS).tar.gz: | target/openssl/
|
||||
curl -o $(@).tmp https://www.openssl.org/source/openssl-$(OPENSSL_VERS).tar.gz
|
||||
$(SHASUM) $(@).tmp > $(@).sha256
|
||||
test $(OPENSSL_SHA256) = `cut -d ' ' -f 1 $(@).sha256`
|
||||
mv $(@).tmp $(@)
|
||||
|
||||
target/openssl/:
|
||||
mkdir -p $(@)
|
||||
|
||||
# === Distribution
|
||||
|
||||
define DO_DIST_TARGET
|
||||
dist-$(1): $$(DISTDIR_$(1))/$$(PKG_NAME)-$(1).tar.gz
|
||||
|
||||
# One may wonder why some of the commands here are prefixed with `cd -P .`, and
|
||||
# that's a good question! On some of the windows bots, PWD has a windows-style
|
||||
# path, and that ends up choking the installation script in various ways.
|
||||
# Prefixing commands with this `cd -P .` helps the bots to set the right PWD env
|
||||
# var.
|
||||
distcheck-$(1): dist-$(1)
|
||||
rm -rf $$(TARGET_$(1))/distcheck
|
||||
mkdir -p $$(TARGET_$(1))/distcheck
|
||||
(cd $$(TARGET_$(1))/distcheck && tar xf ../dist/$$(PKG_NAME)-$(1).tar.gz)
|
||||
cd -P . && $$(TARGET_$(1))/distcheck/$$(PKG_NAME)-$(1)/install.sh \
|
||||
--prefix=$$(TARGET_$(1))/distcheck/install
|
||||
$$(TARGET_$(1))/distcheck/install/bin/cargo -V > /dev/null
|
||||
cd -P . && $$(TARGET_$(1))/distcheck/$$(PKG_NAME)-$(1)/install.sh \
|
||||
--prefix=$$(TARGET_$(1))/distcheck/install --uninstall
|
||||
[ -f $$(TARGET_$(1))/distcheck/install/bin/cargo$(X) ] && exit 1 || exit 0
|
||||
|
||||
prepare-image-$(1):
|
||||
@[ -f $$(TARGET_$(1))/cargo$$(X) ] || echo 'Please run `make` first'
|
||||
@[ -f $$(TARGET_$(1))/cargo$$(X) ]
|
||||
rm -rf $$(IMGDIR_$(1))
|
||||
mkdir -p $$(IMGDIR_$(1))/bin $$(IMGDIR_$(1))/$(CFG_LIBDIR)/cargo \
|
||||
$$(IMGDIR_$(1))$(CFG_MANDIR)/man1 \
|
||||
$$(IMGDIR_$(1))$(CFG_DOCDIR) \
|
||||
$$(IMGDIR_$(1))$(CFG_DATADIR)/zsh/site-functions \
|
||||
$$(IMGDIR_$(1))$(CFG_SYSCONFDIR)/bash_completion.d
|
||||
cp $$(TARGET_$(1))/cargo$$(X) $$(IMGDIR_$(1))/bin
|
||||
cp $(S)src/etc/man/*.1 $$(IMGDIR_$(1))$(CFG_MANDIR)/man1
|
||||
cp $(S)src/etc/_cargo $$(IMGDIR_$(1))$(CFG_DATADIR)/zsh/site-functions/_cargo
|
||||
cp $(S)src/etc/cargo.bashcomp.sh $$(IMGDIR_$(1))$(CFG_SYSCONFDIR)/bash_completion.d/cargo
|
||||
cp $(S)README.md $(S)LICENSE-MIT $(S)LICENSE-APACHE \
|
||||
$(S)LICENSE-THIRD-PARTY \
|
||||
$$(IMGDIR_$(1))$(CFG_DOCDIR)
|
||||
|
||||
prepare-overlay-$(1):
|
||||
rm -Rf $$(OVERLAYDIR_$(1))
|
||||
mkdir -p $$(OVERLAYDIR_$(1))
|
||||
cp $(S)README.md $(S)LICENSE-MIT $(S)LICENSE-APACHE \
|
||||
$(S)LICENSE-THIRD-PARTY \
|
||||
$$(OVERLAYDIR_$(1))
|
||||
echo "$(CFG_VERSION)" > $$(OVERLAYDIR_$(1))/version
|
||||
|
||||
$$(DISTDIR_$(1))/$$(PKG_NAME)-$(1).tar.gz: prepare-image-$(1) prepare-overlay-$(1)
|
||||
sh $(S)src/rust-installer/gen-installer.sh \
|
||||
--product-name=Rust \
|
||||
--rel-manifest-dir=rustlib \
|
||||
--success-message=Rust-is-ready-to-roll. \
|
||||
--image-dir=$$(IMGDIR_$(1)) \
|
||||
--work-dir=./$$(DISTDIR_$(1)) \
|
||||
--output-dir=./$$(DISTDIR_$(1)) \
|
||||
--non-installed-overlay=$$(OVERLAYDIR_$(1)) \
|
||||
--package-name=$$(PKG_NAME)-$(1) \
|
||||
--component-name=cargo \
|
||||
--legacy-manifest-dirs=rustlib,cargo
|
||||
rm -Rf $$(IMGDIR_$(1))
|
||||
|
||||
install-$(1): $$(DISTDIR_$(1))/$$(PKG_NAME)-$(1).tar.gz
|
||||
$$(PKGDIR_$(1))/install.sh \
|
||||
--prefix="$$(CFG_PREFIX)" \
|
||||
--destdir="$$(DESTDIR)" $$(MAYBE_DISABLE_VERIFY)
|
||||
|
||||
uninstall-$(1): $$(DISTDIR_$(1))/$$(PKG_NAME)-$(1).tar.gz
|
||||
$$(PKGDIR_$(1))/install.sh \
|
||||
--prefix="$$(CFG_PREFIX)" \
|
||||
--destdir="$$(DESTDIR)" \
|
||||
--uninstall
|
||||
endef
|
||||
$(foreach target,$(CFG_TARGET),$(eval $(call DO_DIST_TARGET,$(target))))
|
||||
|
||||
dist: $(foreach target,$(CFG_TARGET),dist-$(target))
|
||||
distcheck: $(foreach target,$(CFG_TARGET),distcheck-$(target))
|
||||
install: $(foreach target,$(CFG_TARGET),install-$(target))
|
||||
uninstall: $(foreach target,$(CFG_TARGET), uninstall-$(target))
|
||||
|
||||
|
||||
# Setup phony tasks
|
||||
.PHONY: all clean clean-all dist distcheck install uninstall test test-unit style
|
||||
|
||||
# Disable unnecessary built-in rules
|
||||
.SUFFIXES:
|
||||
|
19
README.md
19
README.md
@ -34,22 +34,6 @@ With `cargo` already installed, you can simply run:
|
||||
cargo build --release
|
||||
```
|
||||
|
||||
Otherwise, you can also use a more traditional approach:
|
||||
|
||||
```sh
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
```
|
||||
|
||||
More options can be discovered through `./configure`, such as compiling cargo
|
||||
for more than one target. For example, if you'd like to compile both 32 and 64
|
||||
bit versions of cargo on unix you would use:
|
||||
|
||||
```
|
||||
$ ./configure --target=i686-unknown-linux-gnu,x86_64-unknown-linux-gnu
|
||||
```
|
||||
|
||||
## Running the tests
|
||||
|
||||
To run cargo's tests, use `cargo test`. If you do not have the cross-compilers
|
||||
@ -71,8 +55,7 @@ the `src/doc` directory. To view the rendered version of changes you have
|
||||
made locally, run:
|
||||
|
||||
```sh
|
||||
./configure
|
||||
make doc
|
||||
sh src/ci/dox.sh
|
||||
open target/doc/index.html
|
||||
```
|
||||
|
||||
|
55
appveyor.yml
55
appveyor.yml
@ -1,38 +1,14 @@
|
||||
environment:
|
||||
RUSTFLAGS: -Zunstable-options -Ctarget-feature=+crt-static
|
||||
matrix:
|
||||
- TARGET: x86_64-pc-windows-gnu
|
||||
BITS: 64
|
||||
CFG_DISABLE_CROSS_TESTS: 1
|
||||
MAKE_TARGETS: test-unit-x86_64-pc-windows-gnu
|
||||
- TARGET: i686-pc-windows-gnu
|
||||
BITS: 32
|
||||
MINGW_URL: https://s3.amazonaws.com/rust-lang-ci
|
||||
MINGW_ARCHIVE: i686-4.9.2-release-win32-dwarf-rt_v4-rev4.7z
|
||||
MINGW_DIR: mingw32
|
||||
CFG_DISABLE_CROSS_TESTS: 1
|
||||
MAKE_TARGETS: test-unit-i686-pc-windows-gnu
|
||||
- TARGET: i686-pc-windows-msvc
|
||||
BITS: 32
|
||||
MAKE_TARGETS: test-unit-i686-pc-windows-msvc
|
||||
CFG_DISABLE_CROSS_TESTS: 1
|
||||
ALLOW_PR: 1
|
||||
- TARGET: x86_64-pc-windows-msvc
|
||||
OTHER_TARGET: i686-pc-windows-msvc
|
||||
BITS: 64
|
||||
MAKE_TARGETS: test-unit-x86_64-pc-windows-msvc
|
||||
|
||||
install:
|
||||
- set PATH=C:\msys64\mingw%BITS%\bin;C:\msys64\usr\bin;%PATH%
|
||||
- if defined MINGW_URL appveyor DownloadFile %MINGW_URL%/%MINGW_ARCHIVE%
|
||||
- if defined MINGW_URL 7z x -y %MINGW_ARCHIVE% > nul
|
||||
- if defined MINGW_URL set PATH=%CD%\%MINGW_DIR%\bin;C:\msys64\usr\bin;%PATH%
|
||||
|
||||
- appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
|
||||
- rustup-init.exe -y --default-host x86_64-pc-windows-msvc --default-toolchain nightly-2017-03-03
|
||||
- rustup-init.exe -y --default-host x86_64-pc-windows-msvc --default-toolchain nightly
|
||||
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
|
||||
- if NOT "%TARGET%" == "x86_64-pc-windows-msvc" rustup target add %TARGET%
|
||||
- if defined OTHER_TARGET rustup target add %OTHER_TARGET%
|
||||
- rustup target add %OTHER_TARGET%
|
||||
- rustc -V
|
||||
- cargo -V
|
||||
- git submodule update --init
|
||||
@ -42,29 +18,4 @@ clone_depth: 1
|
||||
build: false
|
||||
|
||||
test_script:
|
||||
- sh src/ci/run.sh %TARGET%
|
||||
|
||||
before_deploy:
|
||||
- ps: |
|
||||
New-Item -Path deploy -ItemType directory
|
||||
Get-ChildItem -Path target\${env:TARGET}\release\dist -Filter '*.tar.gz' | Move-Item -Destination deploy
|
||||
Get-FileHash .\deploy\* | ForEach-Object {
|
||||
[io.file]::WriteAllText($_.Path + ".sha256", $_.Hash.ToLower() + "`n")
|
||||
}
|
||||
Get-ChildItem -Path deploy | Foreach-Object {
|
||||
Push-AppveyorArtifact $_.FullName -FileName ${env:APPVEYOR_REPO_COMMIT}/$_
|
||||
}
|
||||
|
||||
deploy:
|
||||
- provider: S3
|
||||
skip_cleanup: true
|
||||
access_key_id: AKIAIWZDM2B2IJOWBGTA
|
||||
secret_access_key:
|
||||
secure: hyH54di5NyNdV+jjntM1dRN/NeUgDidwZmwcg4/UKpdJqGf1AAwYb2ulXYK67CXA
|
||||
bucket: rust-lang-ci
|
||||
set_public: true
|
||||
region: us-east-1
|
||||
folder: cargo-builds
|
||||
artifact: /.*\.(tar.gz|sha256)/
|
||||
on:
|
||||
branch: auto-cargo
|
||||
- cargo test
|
||||
|
423
configure
vendored
423
configure
vendored
@ -1,423 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# /bin/sh on Solaris is not a POSIX compatible shell, but /usr/bin/bash is.
|
||||
if [ `uname -s` = 'SunOS' -a "${POSIX_SHELL}" != "true" ]; then
|
||||
POSIX_SHELL="true"
|
||||
export POSIX_SHELL
|
||||
exec /usr/bin/env bash $0 "$@"
|
||||
fi
|
||||
unset POSIX_SHELL # clear it so if we invoke other scripts, they run as bash as well
|
||||
|
||||
msg() {
|
||||
echo "configure: $1"
|
||||
}
|
||||
|
||||
step_msg() {
|
||||
msg
|
||||
msg "$1"
|
||||
msg
|
||||
}
|
||||
|
||||
warn() {
|
||||
echo "configure: WARNING: $1"
|
||||
}
|
||||
|
||||
err() {
|
||||
echo "configure: error: $1"
|
||||
exit 1
|
||||
}
|
||||
|
||||
need_ok() {
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
err "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
need_cmd() {
|
||||
if command -v $1 >/dev/null 2>&1
|
||||
then msg "found $1"
|
||||
else err "need $1"
|
||||
fi
|
||||
}
|
||||
|
||||
make_dir() {
|
||||
if [ ! -d $1 ]
|
||||
then
|
||||
msg "mkdir -p $1"
|
||||
mkdir -p $1
|
||||
fi
|
||||
}
|
||||
|
||||
copy_if_changed() {
|
||||
if cmp -s $1 $2
|
||||
then
|
||||
msg "leaving $2 unchanged"
|
||||
else
|
||||
msg "cp $1 $2"
|
||||
cp -f $1 $2
|
||||
chmod u-w $2 # make copied artifact read-only
|
||||
fi
|
||||
}
|
||||
|
||||
move_if_changed() {
|
||||
if cmp -s $1 $2
|
||||
then
|
||||
msg "leaving $2 unchanged"
|
||||
else
|
||||
msg "mv $1 $2"
|
||||
mv -f $1 $2
|
||||
chmod u-w $2 # make moved artifact read-only
|
||||
fi
|
||||
}
|
||||
|
||||
putvar() {
|
||||
local T
|
||||
eval T=\$$1
|
||||
eval TLEN=\${#$1}
|
||||
if [ $TLEN -gt 35 ]
|
||||
then
|
||||
printf "configure: %-20s := %.35s ...\n" $1 "$T"
|
||||
else
|
||||
printf "configure: %-20s := %s %s\n" $1 "$T" "$2"
|
||||
fi
|
||||
printf "%-20s := %s\n" $1 "$T" >>config.tmp
|
||||
}
|
||||
|
||||
probe() {
|
||||
local V=$1
|
||||
shift
|
||||
local P
|
||||
local T
|
||||
for P
|
||||
do
|
||||
T=$(command -v $P 2>&1)
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
VER0=$($P --version 2>/dev/null | head -1 \
|
||||
| sed -e 's/[^0-9]*\([vV]\?[0-9.]\+[^ ]*\).*/\1/' )
|
||||
if [ $? -eq 0 -a "x${VER0}" != "x" ]
|
||||
then
|
||||
VER="($VER0)"
|
||||
else
|
||||
VER=""
|
||||
fi
|
||||
break
|
||||
else
|
||||
VER=""
|
||||
T=""
|
||||
fi
|
||||
done
|
||||
eval $V=\$T
|
||||
putvar $V "$VER"
|
||||
}
|
||||
|
||||
probe_need() {
|
||||
local V=$1
|
||||
probe $*
|
||||
eval VV=\$$V
|
||||
if [ -z "$VV" ]
|
||||
then
|
||||
err "needed, but unable to find any of: $*"
|
||||
fi
|
||||
}
|
||||
|
||||
validate_opt () {
|
||||
for arg in $CFG_CONFIGURE_ARGS
|
||||
do
|
||||
isArgValid=0
|
||||
for option in $BOOL_OPTIONS
|
||||
do
|
||||
if test --disable-$option = $arg
|
||||
then
|
||||
isArgValid=1
|
||||
fi
|
||||
if test --enable-$option = $arg
|
||||
then
|
||||
isArgValid=1
|
||||
fi
|
||||
done
|
||||
for option in $VAL_OPTIONS
|
||||
do
|
||||
if echo "$arg" | grep -q -- "--$option="
|
||||
then
|
||||
isArgValid=1
|
||||
fi
|
||||
done
|
||||
if [ "$arg" = "--help" ]
|
||||
then
|
||||
echo
|
||||
echo "No more help available for Configure options,"
|
||||
echo "check the Wiki or join our IRC channel"
|
||||
break
|
||||
else
|
||||
if test $isArgValid -eq 0
|
||||
then
|
||||
err "Option '$arg' is not recognized"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
valopt() {
|
||||
VAL_OPTIONS="$VAL_OPTIONS $1"
|
||||
|
||||
local OP=$1
|
||||
local DEFAULT=$2
|
||||
shift
|
||||
shift
|
||||
local DOC="$*"
|
||||
if [ $HELP -eq 0 ]
|
||||
then
|
||||
local UOP=$(echo $OP | tr '[:lower:]' '[:upper:]' | tr '\-' '\_')
|
||||
local V="CFG_${UOP}"
|
||||
eval $V="$DEFAULT"
|
||||
for arg in $CFG_CONFIGURE_ARGS
|
||||
do
|
||||
if echo "$arg" | grep -q -- "--$OP="
|
||||
then
|
||||
val=$(echo "$arg" | cut -f2 -d=)
|
||||
eval $V=$val
|
||||
fi
|
||||
done
|
||||
putvar $V
|
||||
else
|
||||
if [ -z "$DEFAULT" ]
|
||||
then
|
||||
DEFAULT="<none>"
|
||||
fi
|
||||
OP="${OP}=[${DEFAULT}]"
|
||||
printf " --%-30s %s\n" "$OP" "$DOC"
|
||||
fi
|
||||
}
|
||||
|
||||
opt() {
|
||||
BOOL_OPTIONS="$BOOL_OPTIONS $1"
|
||||
|
||||
local OP=$1
|
||||
local DEFAULT=$2
|
||||
shift
|
||||
shift
|
||||
local DOC="$*"
|
||||
local FLAG=""
|
||||
|
||||
if [ $DEFAULT -eq 0 ]
|
||||
then
|
||||
FLAG="enable"
|
||||
else
|
||||
FLAG="disable"
|
||||
DOC="don't $DOC"
|
||||
fi
|
||||
|
||||
if [ $HELP -eq 0 ]
|
||||
then
|
||||
for arg in $CFG_CONFIGURE_ARGS
|
||||
do
|
||||
if [ "$arg" = "--${FLAG}-${OP}" ]
|
||||
then
|
||||
OP=$(echo $OP | tr 'a-z-' 'A-Z_')
|
||||
FLAG=$(echo $FLAG | tr 'a-z' 'A-Z')
|
||||
local V="CFG_${FLAG}_${OP}"
|
||||
eval $V=1
|
||||
putvar $V
|
||||
fi
|
||||
done
|
||||
else
|
||||
if [ ! -z "$META" ]
|
||||
then
|
||||
OP="$OP=<$META>"
|
||||
fi
|
||||
printf " --%-30s %s\n" "$FLAG-$OP" "$DOC"
|
||||
fi
|
||||
}
|
||||
|
||||
envopt() {
|
||||
local NAME=$1
|
||||
local V="CFG_${NAME}"
|
||||
eval VV=\$$V
|
||||
|
||||
# If configure didn't set a value already, then check environment.
|
||||
#
|
||||
# (It is recommended that the configure script always check the
|
||||
# environment before setting any values to envopt variables; see
|
||||
# e.g. how CFG_CC is handled, where it first checks `-z "$CC"`,
|
||||
# and issues msg if it ends up employing that provided value.)
|
||||
if [ -z "$VV" ]
|
||||
then
|
||||
eval $V=\$$NAME
|
||||
eval VV=\$$V
|
||||
fi
|
||||
|
||||
# If script or environment provided a value, save it.
|
||||
if [ ! -z "$VV" ]
|
||||
then
|
||||
putvar $V
|
||||
fi
|
||||
}
|
||||
|
||||
msg "looking for configure programs"
|
||||
need_cmd cmp
|
||||
need_cmd mkdir
|
||||
need_cmd printf
|
||||
need_cmd cut
|
||||
need_cmd head
|
||||
need_cmd grep
|
||||
need_cmd xargs
|
||||
need_cmd cp
|
||||
need_cmd find
|
||||
need_cmd uname
|
||||
need_cmd date
|
||||
need_cmd tr
|
||||
need_cmd sed
|
||||
need_cmd cmake
|
||||
need_cmd make
|
||||
|
||||
CFG_SRC_DIR="$(cd $(dirname $0) && pwd)/"
|
||||
CFG_BUILD_DIR="$(pwd)/"
|
||||
CFG_SELF="$0"
|
||||
CFG_CONFIGURE_ARGS="$@"
|
||||
|
||||
OPTIONS=""
|
||||
HELP=0
|
||||
if [ "$1" = "--help" ]
|
||||
then
|
||||
HELP=1
|
||||
shift
|
||||
echo
|
||||
echo "Usage: $CFG_SELF [options]"
|
||||
echo
|
||||
echo "Options:"
|
||||
echo
|
||||
else
|
||||
msg "recreating config.tmp"
|
||||
echo '' >config.tmp
|
||||
|
||||
step_msg "processing $CFG_SELF args"
|
||||
fi
|
||||
|
||||
BOOL_OPTIONS=""
|
||||
VAL_OPTIONS=""
|
||||
|
||||
opt debug 1 "build with extra debug fun"
|
||||
opt optimize 1 "build with optimizations"
|
||||
opt verify-install 1 "verify installed binaries work"
|
||||
opt option-checking 1 "complain about unrecognized options in this configure script"
|
||||
opt cross-tests 1 "run cross-compilation tests"
|
||||
opt build-openssl 0 "compile OpenSSL at build time to link to"
|
||||
valopt prefix "/usr/local" "set installation prefix"
|
||||
valopt local-rust-root "" "set prefix for local rust binary"
|
||||
|
||||
if [ ! -z "${CFG_LOCAL_RUST_ROOT}" ]; then
|
||||
export LD_LIBRARY_PATH="${CFG_LOCAL_RUST_ROOT}/lib:$LD_LIBRARY_PATH"
|
||||
export DYLD_LIBRARY_PATH="${CFG_LOCAL_RUST_ROOT}/lib:$DYLD_LIBRARY_PATH"
|
||||
export LIBRARY_PATH="${CFG_LOCAL_RUST_ROOT}/lib:$LIBRARY_PATH"
|
||||
export PATH="${CFG_LOCAL_RUST_ROOT}/bin:$PATH"
|
||||
fi
|
||||
|
||||
valopt cargo "cargo" "cargo to bootstrap from"
|
||||
valopt rustc "rustc" "rustc to compile with"
|
||||
valopt rustdoc "rustdoc" "rustdoc to document with"
|
||||
|
||||
if [ $HELP -eq 0 ]; then
|
||||
probe_need CFG_CARGO $CFG_CARGO
|
||||
probe_need CFG_RUSTC $CFG_RUSTC
|
||||
probe_need CFG_RUSTDOC $CFG_RUSTDOC
|
||||
DEFAULT_BUILD=$("${CFG_RUSTC}" -vV | grep 'host: ' | sed 's/host: //')
|
||||
fi
|
||||
|
||||
valopt build "${DEFAULT_BUILD}" "GNUs ./configure syntax LLVM build triple"
|
||||
valopt host "${CFG_BUILD}" "GNUs ./configure syntax LLVM host triples"
|
||||
valopt target "${CFG_HOST}" "GNUs ./configure syntax LLVM target triples"
|
||||
|
||||
valopt localstatedir "/var/lib" "local state directory"
|
||||
valopt sysconfdir "/etc" "install system configuration files"
|
||||
valopt datadir "${CFG_PREFIX}/share" "install data"
|
||||
valopt infodir "${CFG_PREFIX}/share/info" "install additional info"
|
||||
valopt docdir "${CFG_PREFIX}/share/doc/cargo" "install extra docs"
|
||||
valopt mandir "${CFG_PREFIX}/share/man" "install man pages in PATH"
|
||||
valopt libdir "${CFG_PREFIX}/lib" "install libraries"
|
||||
|
||||
if [ -e ${CFG_SRC_DIR}.git ]
|
||||
then
|
||||
valopt release-channel "dev" "the name of the release channel to build"
|
||||
else
|
||||
msg "git: no git directory. Changing default release channel to stable"
|
||||
valopt release-channel "stable" "the name of the release channel to build"
|
||||
fi
|
||||
|
||||
if [ $HELP -eq 1 ]
|
||||
then
|
||||
echo
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Validate Options
|
||||
if [ -z "$CFG_DISABLE_OPTION_CHECKING" ]
|
||||
then
|
||||
step_msg "validating $CFG_SELF args"
|
||||
validate_opt
|
||||
fi
|
||||
|
||||
step_msg "looking for build programs"
|
||||
|
||||
probe_need CFG_CC cc gcc clang
|
||||
probe GIT git
|
||||
|
||||
# a little post-processing of various config values
|
||||
CFG_PREFIX=${CFG_PREFIX%/}
|
||||
CFG_DATADIR=${CFG_DATADIR%/}
|
||||
CFG_INFODIR=${CFG_INFODIR%/}
|
||||
CFG_DOCDIR=${CFG_DOCDIR%/}
|
||||
CFG_MANDIR=${CFG_MANDIR%/}
|
||||
CFG_LIBDIR=${CFG_LIBDIR%/}
|
||||
CFG_HOST="$(echo $CFG_HOST | tr ',' ' ')"
|
||||
CFG_TARGET="$(echo $CFG_TARGET | tr ',' ' ')"
|
||||
|
||||
# strip CFG_PREFIX from variables used for installation so that
|
||||
# install.sh's --prefix value can be used instead
|
||||
CFG_DATADIR=${CFG_DATADIR#${CFG_PREFIX}}
|
||||
CFG_INFODIR=${CFG_INFODIR#${CFG_PREFIX}}
|
||||
CFG_DOCDIR=${CFG_DOCDIR#${CFG_PREFIX}}
|
||||
CFG_MANDIR=${CFG_MANDIR#${CFG_PREFIX}}
|
||||
CFG_LIBDIR=${CFG_LIBDIR#${CFG_PREFIX}}
|
||||
|
||||
# copy host-triples to target-triples so that hosts are a subset of targets
|
||||
V_TEMP=""
|
||||
for i in $CFG_HOST $CFG_TARGET;
|
||||
do
|
||||
echo "$V_TEMP" | grep -qF $i || V_TEMP="$V_TEMP${V_TEMP:+ }$i"
|
||||
done
|
||||
CFG_TARGET=$V_TEMP
|
||||
|
||||
if [ "$CFG_SRC_DIR" != "$CFG_BUILD_DIR" ]; then
|
||||
CFG_CUSTOM_BUILD_DIR=$CFG_BUILD_DIR/target
|
||||
putvar CFG_CUSTOM_BUILD_DIR
|
||||
fi
|
||||
|
||||
step_msg "writing configuration"
|
||||
|
||||
putvar CFG_SRC_DIR
|
||||
putvar CFG_BUILD_DIR
|
||||
putvar CFG_CONFIGURE_ARGS
|
||||
putvar CFG_PREFIX
|
||||
putvar CFG_BUILD
|
||||
putvar CFG_HOST
|
||||
putvar CFG_TARGET
|
||||
putvar CFG_DATADIR
|
||||
putvar CFG_DOCDIR
|
||||
putvar CFG_INFODIR
|
||||
putvar CFG_MANDIR
|
||||
putvar CFG_LIBDIR
|
||||
putvar CFG_RUSTC
|
||||
putvar CFG_RUSTDOC
|
||||
putvar CFG_CARGO
|
||||
putvar CFG_GIT
|
||||
|
||||
msg
|
||||
copy_if_changed ${CFG_SRC_DIR}Makefile.in ./Makefile
|
||||
move_if_changed config.tmp config.mk
|
||||
rm -f config.tmp
|
||||
touch config.stamp
|
||||
|
||||
step_msg "complete"
|
||||
msg
|
@ -1,27 +0,0 @@
|
||||
FROM ubuntu:16.04
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
ca-certificates \
|
||||
cmake \
|
||||
curl \
|
||||
gcc \
|
||||
git \
|
||||
libc6-dev \
|
||||
make \
|
||||
pkg-config
|
||||
|
||||
WORKDIR /android
|
||||
RUN apt-get install -y --no-install-recommends \
|
||||
unzip \
|
||||
python && \
|
||||
curl -O https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip && \
|
||||
unzip -q android-ndk-r13b-linux-x86_64.zip && \
|
||||
./android-ndk-r13b/build/tools/make_standalone_toolchain.py \
|
||||
--install-dir /android-ndk/arm --arch arm --api 21 && \
|
||||
rm -rf ./android-ndk-r13b-linux-x86_64.zip ./android-ndk-r13b && \
|
||||
apt-get purge --auto-remove -y unzip python
|
||||
|
||||
ENV PATH=$PATH:/android-ndk/arm/bin
|
||||
|
||||
ENV CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER=arm-linux-androideabi-gcc
|
@ -1,18 +0,0 @@
|
||||
FROM alexcrichton/rust-slave-linux-cross:2017-02-02
|
||||
ENTRYPOINT []
|
||||
|
||||
ENV CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABI_LINKER=arm-linux-gnueabi-gcc \
|
||||
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \
|
||||
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=armv7-linux-gnueabihf-gcc \
|
||||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \
|
||||
CARGO_TARGET_I686_UNKNOWN_FREEBSD_LINKER=i686-unknown-freebsd10-gcc \
|
||||
CARGO_TARGET_X86_64_UNKNOWN_FREEBSD_LINKER=x86_64-unknown-freebsd10-gcc \
|
||||
CARGO_TARGET_X86_64_UNKNOWN_NETBSD_LINKER=x86_64-unknown-netbsd-gcc \
|
||||
CARGO_TARGET_MIPS_UNKNOWN_LINUX_GNU_LINKER=mips-linux-gnu-gcc \
|
||||
CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_GNU_LINKER=mipsel-linux-gnu-gcc \
|
||||
CARGO_TARGET_MIPS64_UNKNOWN_LINUX_GNUABI64_LINKER=mips64-linux-gnuabi64-gcc \
|
||||
CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_GNUABI64_LINKER=mips64el-linux-gnuabi64-gcc \
|
||||
CARGO_TARGET_POWERPC_UNKNOWN_LINUX_GNU_LINKER=powerpc-linux-gnu-gcc \
|
||||
CARGO_TARGET_POWERPC64_UNKNOWN_LINUX_GNU_LINKER=powerpc64-linux-gnu-gcc \
|
||||
CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_LINKER=powerpc64le-linux-gnu-gcc \
|
||||
CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER=s390x-linux-gnu-gcc
|
2
src/ci/docker/dist/Dockerfile
vendored
2
src/ci/docker/dist/Dockerfile
vendored
@ -1,2 +0,0 @@
|
||||
FROM alexcrichton/rust-slave-dist:2016-09-26
|
||||
ENTRYPOINT []
|
@ -1,51 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Copyright 2016 The Rust Project Developers. See the COPYRIGHT
|
||||
# file at the top-level directory of this distribution and at
|
||||
# http://rust-lang.org/COPYRIGHT.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
# option. This file may not be copied, modified, or distributed
|
||||
# except according to those terms.
|
||||
|
||||
set -e
|
||||
|
||||
script=`cd $(dirname $0) && pwd`/`basename $0`
|
||||
image=$1
|
||||
TARGET=$2
|
||||
|
||||
docker_dir="`dirname $script`"
|
||||
ci_dir="`dirname $docker_dir`"
|
||||
src_dir="`dirname $ci_dir`"
|
||||
root_dir="`dirname $src_dir`"
|
||||
|
||||
docker build \
|
||||
--rm \
|
||||
-t rust-ci \
|
||||
"`dirname "$script"`/$image"
|
||||
|
||||
mkdir -p $HOME/.cargo
|
||||
mkdir -p target
|
||||
|
||||
exec docker run \
|
||||
--user `id -u`:`id -g` \
|
||||
--volume "$root_dir:/checkout:ro" \
|
||||
--workdir /tmp \
|
||||
--env CFG_DISABLE_CROSS_TESTS=$CFG_DISABLE_CROSS_TESTS \
|
||||
--env MAKE_TARGETS="$MAKE_TARGETS" \
|
||||
--env SRC=/checkout \
|
||||
--env CARGO_HOME=/cargo \
|
||||
--env TRAVIS_BRANCH=$TRAVIS_BRANCH \
|
||||
--env TRAVIS_PULL_REQUEST_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH \
|
||||
--env ALLOW_PR=$ALLOW_PR \
|
||||
--env CI=$CI \
|
||||
--volume "$HOME/.cargo:/cargo" \
|
||||
--volume `rustc --print sysroot`:/rust:ro \
|
||||
--volume `pwd`/target:/tmp/target \
|
||||
rust-ci \
|
||||
sh -c "\
|
||||
PATH=\$PATH:/rust/bin \
|
||||
LD_LIBRARY_PATH=/rust/lib:\$LD_LIBRARY_PATH \
|
||||
/checkout/src/ci/run.sh $TARGET"
|
||||
|
@ -1,11 +0,0 @@
|
||||
FROM ubuntu:16.04
|
||||
|
||||
RUN apt-get update -y && apt-get install -y --no-install-recommends \
|
||||
cmake \
|
||||
make \
|
||||
gcc \
|
||||
musl-tools \
|
||||
curl \
|
||||
ca-certificates \
|
||||
libc6-dev \
|
||||
git
|
28
src/ci/dox.sh
Normal file
28
src/ci/dox.sh
Normal file
@ -0,0 +1,28 @@
|
||||
set -ex
|
||||
|
||||
DOCS="index faq config guide manifest build-script pkgid-spec crates-io \
|
||||
environment-variables specifying-dependencies source-replacement \
|
||||
policies external-tools"
|
||||
ASSETS="CNAME images/noise.png images/forkme.png images/Cargo-Logo-Small.png \
|
||||
stylesheets/all.css stylesheets/normalize.css javascripts/prism.js \
|
||||
javascripts/all.js stylesheets/prism.css images/circle-with-i.png \
|
||||
images/search.png images/org-level-acl.png images/auth-level-acl.png \
|
||||
favicon.ico"
|
||||
|
||||
for asset in $ASSETS; do
|
||||
mkdir -p `dirname target/doc/$asset`
|
||||
cp src/doc/$asset target/doc/$asset
|
||||
done
|
||||
|
||||
for doc in $DOCS; do
|
||||
rustdoc \
|
||||
--markdown-no-toc \
|
||||
--markdown-css stylesheets/normalize.css \
|
||||
--markdown-css stylesheets/all.css \
|
||||
--markdown-css stylesheets/prism.css \
|
||||
--html-in-header src/doc/html-headers.html \
|
||||
--html-before-content src/doc/header.html \
|
||||
--html-after-content src/doc/footer.html \
|
||||
-o target/doc \
|
||||
src/doc/$doc.md
|
||||
done
|
@ -1,69 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Copyright 2016 The Rust Project Developers. See the COPYRIGHT
|
||||
# file at the top-level directory of this distribution and at
|
||||
# http://rust-lang.org/COPYRIGHT.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
# option. This file may not be copied, modified, or distributed
|
||||
# except according to those terms.
|
||||
|
||||
set -ex
|
||||
|
||||
TARGET=$1
|
||||
|
||||
if [ -z "$SRC" ]; then
|
||||
SRC=.
|
||||
fi
|
||||
|
||||
BRANCH=$TRAVIS_BRANCH
|
||||
if [ "$BRANCH" = "" ]; then
|
||||
BRANCH=$APPVEYOR_REPO_BRANCH
|
||||
fi
|
||||
|
||||
if [ "$BRANCH" = "stable" ]; then
|
||||
CHANNEL=stable
|
||||
elif [ "$BRANCH" = "beta" ]; then
|
||||
CHANNEL=beta
|
||||
elif [ "$BRANCH" = "master" ]; then
|
||||
CHANNEL=nightly
|
||||
elif [ "$BRANCH" = "auto-cargo" ]; then
|
||||
CHANNEL=nightly
|
||||
else
|
||||
CHANNEL=dev
|
||||
fi
|
||||
|
||||
# We want to only run tests in a few situations:
|
||||
#
|
||||
# * All tests on the auto-cargo branch
|
||||
# * One test on PRs
|
||||
# * Any tests done locally
|
||||
#
|
||||
# This means that here if we're on CI, then we skip tests if it's not the right
|
||||
# branch or if we're not configured to run a test on PRs
|
||||
if [ -n "$CI" ] && [ "$BRANCH" != "auto-cargo" ] && [ "$ALLOW_PR" = "" ]; then
|
||||
echo no build necessary, skipping
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# For some unknown reason libz is not found in the android docker image, so we
|
||||
# use this workaround
|
||||
if [ "$TARGET" = armv7-linux-androideabi ]; then
|
||||
export DEP_Z_ROOT=/android-ndk/arm/sysroot/usr
|
||||
fi
|
||||
|
||||
$SRC/configure \
|
||||
--prefix=/tmp/obj/install \
|
||||
--target=$TARGET \
|
||||
--release-channel=$CHANNEL \
|
||||
--enable-build-openssl
|
||||
|
||||
make cargo-$TARGET
|
||||
make dist-$TARGET
|
||||
|
||||
if [ ! -z "$MAKE_TARGETS" ]; then
|
||||
for target in "$MAKE_TARGETS"; do
|
||||
make $target
|
||||
done
|
||||
fi
|
@ -1 +0,0 @@
|
||||
Subproject commit 4f994850808a572e2cc8d43f968893c8e942e9bf
|
Loading…
x
Reference in New Issue
Block a user