Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
felixmoebius
libc
Commits
d706b4db
Unverified
Commit
d706b4db
authored
4 years ago
by
Yuki Okushi
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #1837 from JohnTitor/xbuild
Use `build-std` feature instead of using `cargo-xbuild`
parents
f944fce9
45317a0c
Loading
Loading
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ci/build.sh
+28
-14
28 additions, 14 deletions
ci/build.sh
ci/dox.sh
+3
-3
3 additions, 3 deletions
ci/dox.sh
ci/run-docker.sh
+1
-2
1 addition, 2 deletions
ci/run-docker.sh
with
32 additions
and
19 deletions
ci/build.sh
+
28
−
14
View file @
d706b4db
...
...
@@ -15,7 +15,6 @@ RUST=${TOOLCHAIN}
echo
"Testing Rust
${
RUST
}
on
${
OS
}
"
if
[
"
${
TOOLCHAIN
}
"
=
"nightly"
]
;
then
cargo +nightly
install
cargo-xbuild
rustup component add rust-src
fi
...
...
@@ -41,29 +40,46 @@ test_target() {
fi
# Test that libc builds without any default features (no libstd)
cargo
"+
${
RUST
}
"
"
${
BUILD_CMD
}
"
-vv
--no-default-features
--target
"
${
TARGET
}
"
if
[
"
${
NO_STD
}
"
!=
"1"
]
;
then
cargo
"+
${
RUST
}
"
"
${
BUILD_CMD
}
"
-vv
--no-default-features
--target
"
${
TARGET
}
"
else
cargo
"+
${
RUST
}
"
"
${
BUILD_CMD
}
"
-Z
build-std
=
core,alloc
-vv
--no-default-features
--target
"
${
TARGET
}
"
fi
# Test that libc builds with default features (e.g. libstd)
# if the target supports libstd
if
[
"
$NO_STD
"
!=
"1"
]
;
then
cargo
"+
${
RUST
}
"
"
${
BUILD_CMD
}
"
-vv
--target
"
${
TARGET
}
"
else
cargo
"+
${
RUST
}
"
"
${
BUILD_CMD
}
"
-Z
build-std
=
core,alloc
-vv
--target
"
${
TARGET
}
"
fi
# Test that libc builds with the `extra_traits` feature
cargo
"+
${
RUST
}
"
"
${
BUILD_CMD
}
"
-vv
--no-default-features
--target
"
${
TARGET
}
"
\
if
[
"
${
NO_STD
}
"
!=
"1"
]
;
then
cargo
"+
${
RUST
}
"
"
${
BUILD_CMD
}
"
-vv
--no-default-features
--target
"
${
TARGET
}
"
\
--features
extra_traits
else
cargo
"+
${
RUST
}
"
"
${
BUILD_CMD
}
"
-Z
build-std
=
core,alloc
-vv
--no-default-features
\
--target
"
${
TARGET
}
"
--features
extra_traits
fi
# Test the 'const-extern-fn' feature on nightly
if
[
"
${
RUST
}
"
=
"nightly"
]
;
then
cargo
"+
${
RUST
}
"
"
${
BUILD_CMD
}
"
-vv
--no-default-features
--target
"
${
TARGET
}
"
\
--features
const-extern-fn
if
[
"
${
NO_STD
}
"
!=
"1"
]
;
then
cargo
"+
${
RUST
}
"
"
${
BUILD_CMD
}
"
-vv
--no-default-features
--target
"
${
TARGET
}
"
\
--features
const-extern-fn
else
cargo
"+
${
RUST
}
"
"
${
BUILD_CMD
}
"
-Z
build-std
=
core,alloc
-vv
--no-default-features
\
--target
"
${
TARGET
}
"
--features
const-extern-fn
fi
fi
# Also test that it builds with `extra_traits` and default features:
if
[
"
$NO_STD
"
!=
"1"
]
;
then
cargo
"+
${
RUST
}
"
"
${
BUILD_CMD
}
"
-vv
--target
"
${
TARGET
}
"
\
--features
extra_traits
else
cargo
"+
${
RUST
}
"
"
${
BUILD_CMD
}
"
-Z
build-std
=
core,alloc
-vv
--target
"
${
TARGET
}
"
\
--features
extra_traits
fi
}
...
...
@@ -166,7 +182,7 @@ case "${OS}" in
esac
for
TARGET
in
$TARGETS
;
do
if
echo
"
$TARGET
"
|grep
-q
"
$FILTER
"
;
then
if
echo
"
$TARGET
"
|grep
-q
"
$FILTER
"
;
then
test_target build
"
$TARGET
"
fi
done
...
...
@@ -193,6 +209,7 @@ i686-unknown-haiku \
i686-unknown-netbsd
\
i686-unknown-openbsd
\
mips-unknown-linux-uclibc
\
mipsel-sony-psp
\
mipsel-unknown-linux-uclibc
\
mips64-unknown-linux-muslabi64
\
mips64el-unknown-linux-muslabi64
\
...
...
@@ -229,13 +246,10 @@ powerpc64-wrs-vxworks \
if
[
"
${
RUST
}
"
=
"nightly"
]
&&
[
"
${
OS
}
"
=
"linux"
]
;
then
for
TARGET
in
$RUST_LINUX_NO_CORE_TARGETS
;
do
if
echo
"
$TARGET
"
|grep
-q
"
$FILTER
"
;
then
test_target
x
build
"
$TARGET
"
1
if
echo
"
$TARGET
"
|grep
-q
"
$FILTER
"
;
then
test_target build
"
$TARGET
"
1
fi
done
# Sony PSP
cargo xbuild
--target
mipsel-sony-psp
fi
RUST_OSX_NO_CORE_TARGETS
=
"
\
...
...
@@ -248,7 +262,7 @@ i686-apple-darwin \
if
[
"
${
RUST
}
"
=
"nightly"
]
&&
[
"
${
OS
}
"
=
"osx"
]
;
then
for
TARGET
in
$RUST_OSX_NO_CORE_TARGETS
;
do
if
echo
"
$TARGET
"
|
grep
-q
"
$FILTER
"
;
then
test_target
x
build
"
$TARGET
"
1
test_target build
"
$TARGET
"
1
fi
done
fi
This diff is collapsed.
Click to expand it.
ci/dox.sh
+
3
−
3
View file @
d706b4db
...
...
@@ -19,7 +19,6 @@ if ! rustc --version | grep -E "nightly" ; then
fi
rustup component add rust-src
cargo +nightly
install
cargo-xbuild
# List all targets that do currently build successfully:
# shellcheck disable=SC1003
...
...
@@ -50,10 +49,11 @@ while read -r target; do
# Enable extra configuration flags:
export
RUSTDOCFLAGS
=
"--cfg freebsd11"
# If cargo doc fails, then try
xargo
:
# If cargo doc fails, then try
with unstable feature
:
if
!
cargo doc
--target
"
${
target
}
"
\
--no-default-features
--features
extra_traits
;
then
cargo xdoc
--target
"
${
target
}
"
\
cargo doc
--target
"
${
target
}
"
\
-Z
build-std
=
core,alloc
\
--no-default-features
--features
extra_traits
fi
...
...
This diff is collapsed.
Click to expand it.
ci/run-docker.sh
+
1
−
2
View file @
d706b4db
...
...
@@ -62,7 +62,6 @@ build_switch() {
kvm
=
""
fi
cargo +nightly
install
cargo-xbuild
cp
"
$(
which rustup
)
"
"
$(
rustc
--print
sysroot
)
/bin"
docker run
\
...
...
@@ -82,7 +81,7 @@ build_switch() {
libc
\
sh
-c
"HOME=/tmp RUSTUP_HOME=/tmp PATH=
\$
PATH:/rust/bin rustup default nightly
\
&& rustup component add rust-src --target ci/switch.json
\
&& cargo
x
build --target ci/switch.json"
&& cargo build
-Z build-std=core,alloc
--target ci/switch.json"
}
if
[
-z
"
${
1
}
"
]
;
then
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment