Skip to content

Commit 389209d

Browse files
authored
Merge pull request #80 from rust-math/remove-xdg-home-store-feature
Remove xdg-data-home experimental feature
2 parents fa423c9 + 89f008a commit 389209d

File tree

6 files changed

+5
-33
lines changed

6 files changed

+5
-33
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ This crate seeks system MKL libraries, e.g. installed by [apt], [yum], or offici
5555
```
5656
pkg-config --libs mkl-dynamic-lp64-iomp
5757
```
58-
- (experimental) Seek `${XDG_DATA_HOME}/intel-mkl-tool`
5958
- Seek a directory set by `${MKLROOT}` environment variable
6059
- Seek default installation path
6160
- `/opt/intel/mkl` for Linux

intel-mkl-src/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ mkl-dynamic-ilp64-seq = []
3131

3232
# Enable downloading from AWS S3 when system MKL not found
3333
download = ["intel-mkl-tool/archive"]
34-
# (Experimental) Cache download archive ad $XDG_DATA_HOME/intel-mkl-tool/
35-
xdg-data-home = []
3634

3735
[build-dependencies]
3836
anyhow = "1.0.58"

intel-mkl-src/build.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,7 @@ fn main() -> Result<()> {
5555
// download if not found
5656
#[cfg(feature = "download")]
5757
{
58-
let path = if cfg!(feature = "xdg-data-home") {
59-
xdg_home_path()
60-
} else {
61-
PathBuf::from(env::var("OUT_DIR").unwrap())
62-
};
58+
let path = PathBuf::from(env::var("OUT_DIR").unwrap());
6359
println!(
6460
r#"cargo:warning="Download Intel MKL archive into {}""#,
6561
path.display()

intel-mkl-tool/src/cli.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,12 @@ enum Opt {
1111
/// Archive name, e.g. "mkl-static-lp64-iomp". Download all archives if None
1212
#[structopt(long = "name")]
1313
name: Option<String>,
14-
/// Install destination. Default is `$XDG_DATA_HOME/intel-mkl-tool/${MKL_VERSION}/`
14+
/// Install destination
1515
#[structopt(short = "o", long = "path")]
16-
path: Option<PathBuf>,
16+
path: PathBuf,
1717
},
1818

1919
/// Seek Intel-MKL library
20-
///
21-
/// 1. pkg-config
22-
/// 2. `$XDG_DATA_HOME/intel-mkl-tool`
23-
/// will be sought.
2420
Seek {},
2521

2622
/// Package Intel MKL libraries into an archive
@@ -37,7 +33,6 @@ fn main() -> Result<()> {
3733

3834
match opt {
3935
Opt::Download { name, path } => {
40-
let path = path.unwrap_or(xdg_home_path());
4136
if let Some(name) = name {
4237
let cfg = Config::from_str(&name)?;
4338
cfg.download(&path.join(cfg.to_string()))?;

intel-mkl-tool/src/entry.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::{mkl, xdg_home_path, Config, LinkType, VALID_CONFIGS};
1+
use crate::{mkl, Config, LinkType, VALID_CONFIGS};
22
use anyhow::{bail, Result};
33
use derive_more::Deref;
44
use std::{
@@ -72,8 +72,6 @@ impl Entry {
7272
/// - This exists only when the previous build downloads archive here
7373
/// - pkg-config `${name}`
7474
/// - Installed by package manager or official downloader
75-
/// - `$XDG_DATA_HOME/intel-mkl-tool/${name}`
76-
/// - Downloaded by this crate
7775
///
7876
/// Returns error if no library found
7977
///
@@ -97,10 +95,6 @@ impl Entry {
9795
});
9896
}
9997

100-
// $XDG_DATA_HOME/intel-mkl-tool
101-
let path = xdg_home_path().join(config.to_string());
102-
targets.seek(&path);
103-
10498
// $MKLROOT
10599
let mkl_root = std::env::var("MKLROOT").map(PathBuf::from);
106100
if let Ok(path) = mkl_root {
@@ -156,7 +150,7 @@ impl Entry {
156150

157151
/// Get MKL version info from its C header
158152
///
159-
/// - This will not work for OUT_DIR, XDG_DATA_HOME, or Pkgconfig entry,
153+
/// - This will not work for OUT_DIR, or Pkgconfig entry,
160154
/// and returns Error in these cases
161155
pub fn version(&self) -> Result<(u32, u32)> {
162156
for (path, _) in &self.found_files() {

intel-mkl-tool/src/lib.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@
9292
9393
#![cfg_attr(not(feature = "archive"), allow(dead_code))]
9494

95-
use std::path::PathBuf;
96-
9795
mod config;
9896
mod entry;
9997

@@ -146,11 +144,3 @@ fn s3_addr() -> String {
146144
mkl::VERSION_UPDATE
147145
)
148146
}
149-
150-
pub fn xdg_home_path() -> PathBuf {
151-
dirs::data_local_dir().unwrap().join(format!(
152-
"intel-mkl-tool/{}.{}",
153-
mkl::VERSION_YEAR,
154-
mkl::VERSION_UPDATE
155-
))
156-
}

0 commit comments

Comments
 (0)