Skip to content

Commit

Permalink
Auto merge of rust-lang#97887 - matthiaskrgr:rollup-ym5k7kb, r=matthi…
Browse files Browse the repository at this point in the history
…askrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#97507 (Move rustfmt downloads from bootstrap.py to rustbuild)
 - rust-lang#97813 (Sync rustc_codegen_gcc)
 - rust-lang#97878 (Add regression test for anonymous lifetimes)
 - rust-lang#97879 (remove unneeded code)
 - rust-lang#97880 (Fix typo: fo->for)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Jun 8, 2022
2 parents 09d52bc + c374529 commit 263d868
Show file tree
Hide file tree
Showing 52 changed files with 8,218 additions and 733 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,15 @@ dependencies = [
"cmake",
"filetime",
"getopts",
"hex 0.4.2",
"ignore",
"libc",
"once_cell",
"opener",
"pretty_assertions 0.7.2",
"serde",
"serde_json",
"sha2",
"sysinfo",
"tar",
"toml",
Expand Down
24 changes: 23 additions & 1 deletion compiler/rustc_codegen_gcc/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
libgccjit_version: ["libgccjit.so", "libgccjit_without_int128.so"]
libgccjit_version: ["libgccjit.so", "libgccjit_without_int128.so", "libgccjit12.so"]

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -78,12 +78,21 @@ jobs:
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain') }}

- name: Build
if: matrix.libgccjit_version != 'libgccjit12.so'
run: |
./prepare_build.sh
./build.sh
cargo test
./clean_all.sh
- name: Build
if: matrix.libgccjit_version == 'libgccjit12.so'
run: |
./prepare_build.sh
./build.sh --no-default-features
cargo test --no-default-features
./clean_all.sh
- name: Prepare dependencies
run: |
git config --global user.email "user@example.com"
Expand All @@ -98,6 +107,7 @@ jobs:
args: --release

- name: Test
if: matrix.libgccjit_version != 'libgccjit12.so'
run: |
# Enable backtraces for easier debugging
export RUST_BACKTRACE=1
Expand All @@ -107,3 +117,15 @@ jobs:
export RUN_RUNS=2
./test.sh --release
- name: Test
if: matrix.libgccjit_version == 'libgccjit12.so'
run: |
# Enable backtraces for easier debugging
export RUST_BACKTRACE=1
# Reduce amount of benchmark runs as they are slow
export COMPILE_RUNS=2
export RUN_RUNS=2
./test.sh --release --no-default-features
4 changes: 4 additions & 0 deletions compiler/rustc_codegen_gcc/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ perf.data.old
/rust
/simple-raytracer
/regex
/rand
gimple*
*asm
res
test-backend
gcc_path
benchmarks
tools/llvm-project
tools/llvmint
tools/llvmint-2
1 change: 1 addition & 0 deletions compiler/rustc_codegen_gcc/.rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
disable_all_formatting = true
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_gcc/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ dependencies = [
[[package]]
name = "gccjit"
version = "1.0.0"
source = "git+https://github.com/antoyo/gccjit.rs#bdecdecfb8a02ec861a39a350f990faa33bd31c3"
source = "git+https://github.com/antoyo/gccjit.rs#bdb86fb5092895ff5589726b33250010c64d93f6"
dependencies = [
"gccjit_sys",
]

[[package]]
name = "gccjit_sys"
version = "0.0.1"
source = "git+https://github.com/antoyo/gccjit.rs#bdecdecfb8a02ec861a39a350f990faa33bd31c3"
source = "git+https://github.com/antoyo/gccjit.rs#bdb86fb5092895ff5589726b33250010c64d93f6"
dependencies = [
"libc 0.1.12",
]
Expand Down
12 changes: 10 additions & 2 deletions compiler/rustc_codegen_gcc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@ license = "MIT OR Apache-2.0"
crate-type = ["dylib"]

[[test]]
name = "lang_tests"
path = "tests/lib.rs"
name = "lang_tests_debug"
path = "tests/lang_tests_debug.rs"
harness = false
[[test]]
name = "lang_tests_release"
path = "tests/lang_tests_release.rs"
harness = false

[features]
default = ["master"]
master = ["gccjit/master"]

[dependencies]
gccjit = { git = "https://github.com/antoyo/gccjit.rs" }
Expand Down
25 changes: 14 additions & 11 deletions compiler/rustc_codegen_gcc/build.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/bin/bash
#!/usr/bin/env bash

#set -x
set -e

codegen_channel=debug
sysroot_channel=debug

flags=

while [[ $# -gt 0 ]]; do
case $1 in
--release)
Expand All @@ -16,6 +18,15 @@ while [[ $# -gt 0 ]]; do
sysroot_channel=release
shift
;;
--no-default-features)
flags="$flags --no-default-features"
shift
;;
--features)
shift
flags="$flags --features $1"
shift
;;
*)
echo "Unknown option $1"
exit 1
Expand All @@ -33,21 +44,13 @@ fi
export LD_LIBRARY_PATH="$GCC_PATH"
export LIBRARY_PATH="$GCC_PATH"

features=

if [[ "$1" == "--features" ]]; then
shift
features="--features $1"
shift
fi

if [[ "$codegen_channel" == "release" ]]; then
export CHANNEL='release'
CARGO_INCREMENTAL=1 cargo rustc --release $features
CARGO_INCREMENTAL=1 cargo rustc --release $flags
else
echo $LD_LIBRARY_PATH
export CHANNEL='debug'
cargo rustc $features
cargo rustc $flags
fi

source config.sh
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_gcc/build_sysroot/build_sysroot.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Requires the CHANNEL env var to be set to `debug` or `release.`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e
cd $(dirname "$0")

Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_gcc/cargo.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

if [ -z $CHANNEL ]; then
export CHANNEL='debug'
Expand All @@ -20,4 +20,4 @@ fi
cmd=$1
shift

RUSTDOCFLAGS="$RUSTFLAGS" cargo +${TOOLCHAIN} $cmd --target $TARGET_TRIPLE $@
RUSTDOCFLAGS="$RUSTFLAGS" cargo +${TOOLCHAIN} $cmd $@
3 changes: 2 additions & 1 deletion compiler/rustc_codegen_gcc/clean_all.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash --verbose
#!/usr/bin/env bash
set -e
set -v

rm -rf target/ build_sysroot/{sysroot/,sysroot_src/,target/,Cargo.lock} perf.data{,.old}
rm -rf regex/ simple-raytracer/
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_gcc/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ set -e

export CARGO_INCREMENTAL=0

if [ -f ./gcc_path ]; then
if [ -f ./gcc_path ]; then
export GCC_PATH=$(cat gcc_path)
else
echo 'Please put the path to your custom build of libgccjit in the file `gcc_path`, see Readme.md for details'
Expand Down Expand Up @@ -38,7 +38,7 @@ if [[ "$HOST_TRIPLE" != "$TARGET_TRIPLE" ]]; then
fi
fi

export RUSTFLAGS="$linker -Cpanic=abort -Csymbol-mangling-version=v0 -Cdebuginfo=2 -Clto=off -Zpanic-abort-tests -Zcodegen-backend=$(pwd)/target/${CHANNEL:-debug}/librustc_codegen_gcc.$dylib_ext --sysroot $(pwd)/build_sysroot/sysroot"
export RUSTFLAGS="$CG_RUSTFLAGS $linker -Cpanic=abort -Csymbol-mangling-version=v0 -Cdebuginfo=2 -Clto=off -Zpanic-abort-tests -Zcodegen-backend=$(pwd)/target/${CHANNEL:-debug}/librustc_codegen_gcc.$dylib_ext --sysroot $(pwd)/build_sysroot/sysroot"

# FIXME(antoyo): remove once the atomic shim is gone
if [[ `uname` == 'Darwin' ]]; then
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From a8fb97120d71252538b6b026695df40d02696bdb Mon Sep 17 00:00:00 2001
From: bjorn3 <bjorn3@users.noreply.github.com>
Date: Sat, 15 Aug 2020 20:04:38 +0200
Subject: [PATCH] [rand] Disable failing test

---
src/distributions/uniform.rs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/distributions/uniform.rs b/src/distributions/uniform.rs
index 480b859..c80bb6f 100644
--- a/src/distributions/uniform.rs
+++ b/src/distributions/uniform.rs
@@ -1085,7 +1085,7 @@ mod tests {
_ => panic!("`UniformDurationMode` was not serialized/deserialized correctly")
}
}
-
+
#[test]
#[cfg(feature = "serde1")]
fn test_uniform_serialization() {
@@ -1314,6 +1314,7 @@ mod tests {
not(target_arch = "wasm32"),
not(target_arch = "asmjs")
))]
+ #[ignore] // FIXME
fn test_float_assertions() {
use super::SampleUniform;
use std::panic::catch_unwind;
--
2.20.1
Loading

0 comments on commit 263d868

Please sign in to comment.