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
Commits
69313b7e
Commit
69313b7e
authored
2 years ago
by
Yaroslav Dynnikov
Browse files
Options
Downloads
Patches
Plain Diff
build: explain build tree structure
Also remove unnecessary subdir
parent
3bdda6d8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!458
build: refactor build.rs
Pipeline
#15414
passed
2 years ago
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
build.rs
+20
-4
20 additions, 4 deletions
build.rs
with
20 additions
and
4 deletions
build.rs
+
20
−
4
View file @
69313b7e
...
...
@@ -3,13 +3,29 @@ use std::path::Path;
use
std
::
process
::
Command
;
fn
main
()
{
// The file structure roughly looks as follows:
// .
// ├── build.rs // you are here
// ├── src/
// ├── tarantool-sys
// │ └── static-build
// │ └── CMakeLists.txt
// └── <target-dir>/<build-type>/build // <- build_root
// ├── picodata-<smth>/out // <- out_dir
// ├── tarantool-http
// └── tarantool-sys
// ├── ncurses-prefix
// ├── openssl-prefix
// ├── readline-prefix
// └── tarantool-prefix
//
let
out_dir
=
std
::
env
::
var
(
"OUT_DIR"
)
.unwrap
();
dbg!
(
&
out_dir
);
// "
$PWD/
target/<build-type>/build/picodata-<smth>/out"
dbg!
(
&
out_dir
);
// "
<
target
-dir>
/<build-type>/build/picodata-<smth>/out"
// Running `cargo build` and `cargo clippy` produces 2 different
// `out_dir` paths. This is stupid, we're not going to use them.
let
build_root
=
Path
::
new
(
&
out_dir
)
.parent
()
.unwrap
()
.parent
()
.unwrap
();
dbg!
(
&
build_root
);
// "
$PWD/
target/<build-type>/build"
dbg!
(
&
build_root
);
// "
<
target
-dir>
/<build-type>/build"
build_tarantool
(
build_root
);
build_http
(
build_root
);
...
...
@@ -22,7 +38,7 @@ fn build_http(build_root: &Path) {
let
build_dir
=
build_root
.join
(
"tarantool-http"
);
let
build_dir_str
=
build_dir
.display
()
.to_string
();
let
tarantool_dir
=
build_root
.join
(
"tarantool-sys/
build/
tarantool-prefix"
);
let
tarantool_dir
=
build_root
.join
(
"tarantool-sys/tarantool-prefix"
);
let
tarantool_dir_str
=
tarantool_dir
.display
()
.to_string
();
Command
::
new
(
"cmake"
)
...
...
@@ -46,7 +62,7 @@ fn build_http(build_root: &Path) {
}
fn
build_tarantool
(
build_root
:
&
Path
)
{
let
build_dir
=
build_root
.join
(
"tarantool-sys
/build
"
);
let
build_dir
=
build_root
.join
(
"tarantool-sys"
);
let
build_dir_str
=
build_dir
.display
()
.to_string
();
let
tarantool_prefix
=
"tarantool-prefix/src/tarantool-build"
;
...
...
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