mirror of
https://github.com/Noratrieb/nixos.git
synced 2026-01-14 19:55:08 +01:00
fuck python probing
This commit is contained in:
parent
ae6b7cc81b
commit
cbb2b5bdbd
2 changed files with 8 additions and 12 deletions
|
|
@ -7,7 +7,7 @@
|
||||||
nativeBuildInputs = with pkgs; [ rustc ];
|
nativeBuildInputs = with pkgs; [ rustc ];
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
rustc -Copt-level=3 -Cembed-bitcode=false $src --out-dir $out/bin
|
PYTHON=${pkgs.python3} rustc -Copt-level=3 -Cembed-bitcode=false $src --out-dir $out/bin
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with pkgs.lib; {
|
meta = with pkgs.lib; {
|
||||||
|
|
|
||||||
|
|
@ -11,13 +11,13 @@
|
||||||
//! We also don't use `pwsh` on Windows, because it is not installed by default;
|
//! We also don't use `pwsh` on Windows, because it is not installed by default;
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
env, io,
|
env,
|
||||||
path::Path,
|
process::{self, Command},
|
||||||
process::{self, Command, ExitStatus},
|
|
||||||
os::unix::process::CommandExt,
|
os::unix::process::CommandExt,
|
||||||
};
|
};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
println!("{}", env!("PYTHON"));
|
||||||
match env::args().skip(1).next().as_deref() {
|
match env::args().skip(1).next().as_deref() {
|
||||||
Some("--wrapper-version") => {
|
Some("--wrapper-version") => {
|
||||||
println!("0.1.0");
|
println!("0.1.0");
|
||||||
|
|
@ -36,14 +36,10 @@ fn main() {
|
||||||
for dir in current.ancestors() {
|
for dir in current.ancestors() {
|
||||||
let candidate = dir.join("x.py");
|
let candidate = dir.join("x.py");
|
||||||
if candidate.exists() {
|
if candidate.exists() {
|
||||||
let shell_script_candidate = dir.join("x");
|
let mut cmd = Command::new(env!("PYTHON"));
|
||||||
let mut cmd: Command;
|
cmd.arg(dir.join("x.py"));
|
||||||
if shell_script_candidate.exists() {
|
cmd.args(env::args().skip(1)).current_dir(dir);
|
||||||
cmd = Command::new(dir.join("x"));
|
|
||||||
cmd.args(env::args().skip(1)).current_dir(dir);
|
|
||||||
} else {
|
|
||||||
panic!("error: cry about it");
|
|
||||||
}
|
|
||||||
let error = cmd.exec();
|
let error = cmd.exec();
|
||||||
eprintln!("Failed to invoke `{:?}`: {}", cmd, error);
|
eprintln!("Failed to invoke `{:?}`: {}", cmd, error);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue