mirror of
https://github.com/vosen/ZLUDA.git
synced 2025-08-04 23:30:53 +00:00
Fix Windows build, add Cargo.lock
This commit is contained in:
parent
c207d75f50
commit
4d83190594
3 changed files with 2575 additions and 9 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,5 +1,4 @@
|
||||||
target/
|
target/
|
||||||
Cargo.lock
|
|
||||||
|
|
||||||
.vscode/
|
.vscode/
|
||||||
.idea/
|
.idea/
|
2561
Cargo.lock
generated
Normal file
2561
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -262,7 +262,10 @@ mod os {
|
||||||
use crate::Workspace;
|
use crate::Workspace;
|
||||||
use cargo_metadata::camino::Utf8PathBuf;
|
use cargo_metadata::camino::Utf8PathBuf;
|
||||||
use flate2::{write::GzEncoder, Compression};
|
use flate2::{write::GzEncoder, Compression};
|
||||||
use std::{fs::File, time::{Duration, SystemTime}};
|
use std::{
|
||||||
|
fs::File,
|
||||||
|
time::{Duration, SystemTime},
|
||||||
|
};
|
||||||
|
|
||||||
pub(crate) fn create_dump_dir_and_symlinks(workspace: &Workspace) {
|
pub(crate) fn create_dump_dir_and_symlinks(workspace: &Workspace) {
|
||||||
use std::fs;
|
use std::fs;
|
||||||
|
@ -325,7 +328,9 @@ mod os {
|
||||||
let gz_file = File::create(target_file).unwrap();
|
let gz_file = File::create(target_file).unwrap();
|
||||||
let gz = GzEncoder::new(gz_file, Compression::default());
|
let gz = GzEncoder::new(gz_file, Compression::default());
|
||||||
let mut tar = tar::Builder::new(gz);
|
let mut tar = tar::Builder::new(gz);
|
||||||
let time = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap_or(Duration::ZERO);
|
let time = SystemTime::now()
|
||||||
|
.duration_since(SystemTime::UNIX_EPOCH)
|
||||||
|
.unwrap_or(Duration::ZERO);
|
||||||
for project in workspace.projects {
|
for project in workspace.projects {
|
||||||
if project.skip_zip {
|
if project.skip_zip {
|
||||||
continue;
|
continue;
|
||||||
|
@ -395,12 +400,13 @@ fn tar_header_symlink(time: Duration) -> tar::Header {
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
mod os {
|
mod os {
|
||||||
use crate::Workspace;
|
use crate::Workspace;
|
||||||
|
use std::{convert::TryFrom, fs::File};
|
||||||
|
|
||||||
// This is 100% intentional, we don't want symlinks on Windows since
|
// This is 100% intentional, we don't want symlinks on Windows since
|
||||||
// we use a completely different scheme for injections there
|
// we use a completely different scheme for injections there
|
||||||
pub(crate) fn create_dump_dir_and_symlinks(_: &Workspace) {}
|
pub(crate) fn create_dump_dir_and_symlinks(_: &Workspace) {}
|
||||||
|
|
||||||
pub fn zip(workspace: Workspace) -> i32 {
|
pub(crate) fn zip(workspace: Workspace) -> i32 {
|
||||||
fn get_zip_entry_options(
|
fn get_zip_entry_options(
|
||||||
f: &File,
|
f: &File,
|
||||||
time_offset: time::UtcOffset,
|
time_offset: time::UtcOffset,
|
||||||
|
@ -438,6 +444,6 @@ mod os {
|
||||||
std::io::copy(&mut src_file, &mut zip_writer).unwrap();
|
std::io::copy(&mut src_file, &mut zip_writer).unwrap();
|
||||||
}
|
}
|
||||||
zip_writer.finish().unwrap();
|
zip_writer.finish().unwrap();
|
||||||
Ok(0)
|
0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue