Skip to content

Commit dc4fa96

Browse files
committed
Moving back to using git submodule for xgboost, pointing to fork.
Fork has R/Java/Python modules removed, as symlinks were causing Rust packaging issues.
1 parent a22cbe6 commit dc4fa96

File tree

4 files changed

+7
-28
lines changed

4 files changed

+7
-28
lines changed

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "xgboost-sys/xgboost"]
2+
path = xgboost-sys/xgboost
3+
url = https://github.com/davechallis/xgboost
4+
branch = v0.80-modified

xgboost-sys/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,3 @@ libc = "0.2"
1313

1414
[build-dependencies]
1515
bindgen = "0.36"
16-
git2 = "0.7"

xgboost-sys/build.rs

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,12 @@
11
extern crate bindgen;
2-
extern crate git2;
32

43
use std::process::Command;
54
use std::env;
65
use std::path::PathBuf;
76

8-
// Contains symlinks, so cannot be included as a git submodule and packaged with cargo. Downloaded
9-
// at build time instead.
10-
static XGBOOST_SRC: &str = "https://github.com/dmlc/xgboost.git";
11-
static XGBOOST_SPEC: &str = "refs/tags/v0.80";
12-
137
fn main() {
14-
let target = env::var("TARGET").expect("Failed to read TARGET environment variable");
15-
16-
let xgb_root = std::path::Path::new("xgboost");
17-
18-
let repo = {
19-
if !xgb_root.exists() {
20-
match git2::Repository::clone_recurse(XGBOOST_SRC, "xgboost") {
21-
Ok(repo) => repo,
22-
Err(e) => panic!("failed to clone: {}", e),
23-
}
24-
} else {
25-
match git2::Repository::open("xgboost") {
26-
Ok(repo) => repo,
27-
Err(e) => panic!("failed to open: {}", e),
28-
}
29-
}
30-
};
31-
32-
repo.set_head(XGBOOST_SPEC).expect("failed to set head");
33-
34-
let xgb_root = xgb_root.canonicalize().unwrap();
8+
let xgb_root = std::fs::canonicalize("xgboost").unwrap();
9+
let target = env::var("TARGET").unwrap();
3510

3611
// TODO: allow for dynamic/static linking
3712
// TODO: check whether rabit should be built/linked

xgboost-sys/xgboost

Submodule xgboost added at 7ad10de

0 commit comments

Comments
 (0)