Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
picodata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
picodata
Merge requests
!60
chore(build): decrease build time a bit
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
chore(build): decrease build time a bit
chore/increase-build-speed
into
master
Overview
0
Commits
1
Pipelines
3
Changes
1
Merged
Alexey Protsenko
requested to merge
chore/increase-build-speed
into
master
3 years ago
Overview
0
Commits
1
Pipelines
3
Changes
1
Expand
don't patch if tarantool-sys/patch-applied exists
use a single build directory for
cargo build
&
cargo clippy
Edited
3 years ago
by
Alexey Protsenko
1
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
4ca5e9f2
1 commit,
3 years ago
1 file
+
26
−
17
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
build.rs
+
26
−
17
Options
@@ -6,6 +6,15 @@ fn main() {
}
fn
patch_tarantool
()
{
let
patch_check
=
Path
::
new
(
"tarantool-sys/patched-applied"
);
if
patch_check
.exists
()
{
println!
(
"cargo:warning='{}' exists, so patching step is skipped"
,
patch_check
.display
()
);
return
;
}
let
status
=
std
::
process
::
Command
::
new
(
"git"
)
.current_dir
(
"tarantool-sys"
)
.arg
(
"apply"
)
@@ -25,33 +34,33 @@ fn patch_tarantool() {
if
!
status
.success
()
{
panic!
(
"failed to apply tarantool patches"
)
}
let
_
=
std
::
fs
::
File
::
create
(
&
patch_check
)
.unwrap_or_else
(|
e
|
panic!
(
"failed to create '{}': {}"
,
patch_check
.display
(),
e
));
}
fn
build_tarantool
()
{
// $OUT_DIR = ".../target/<build-type>/build/picodata-<smth>/out"
let
out_dir
=
std
::
env
::
var
(
"OUT_DIR"
)
.unwrap
();
// cargo creates 2 different output directories when running `cargo build`
// and `cargo clippy`, which is stupid, so we're not going to use them
//
// build_dir = ".../target/<build-type>/build/tarantool-sys"
let
build_dir
=
Path
::
new
(
&
out_dir
)
.parent
()
.unwrap
()
.parent
()
.unwrap
()
.join
(
"tarantool-sys"
);
std
::
fs
::
create_dir_all
(
&
build_dir
)
.expect
(
"failed creating build directory"
);
let
dst
=
cmake
::
Config
::
new
(
"tarantool-sys/static-build"
)
.build_target
(
"tarantool"
)
.out_dir
(
build_dir
)
.build
();
let
build_dir
=
dst
.join
(
"build/tarantool-prefix/src/tarantool-build"
);
let
build_disp
=
build_dir
.display
();
// static-build/CMakeFiles.txt uses builds tarantool via the ExternalProject
// module, which doesn't rebuild tarantool if something is changed,
// therefore we do `cmake --build tarantool-prefix/src/tarantool-build`
// directly.
// XXX: this should only be done if the above command did not rebuild
// anything
let
status
=
std
::
process
::
Command
::
new
(
"cmake"
)
.arg
(
"--build"
)
.arg
(
build_disp
.to_string
())
.arg
(
"-j"
)
.status
()
.expect
(
"cmake couldn't be executed"
);
if
!
status
.success
()
{
panic!
(
"cmake failed"
)
}
// Don't build a shared object in case it's the default for the compiler
println!
(
"cargo:rustc-link-arg=-no-pie"
);
Loading