-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nu-0.59.1 build failure #4861
Comments
It looks like we may need to have a noop for systems other than macos, linux, and windows in nu-system maybe? |
@jntrnr I can try tonight or, if I don't have time, early tomorrow. |
@jntrnr do you mean to remove the whole section from line 74 until the end of In that case, I get this
Just for the record, |
I'm thinking you might need some conditional compilation maybe like this in #[cfg(target_os = "linux")]
mod linux;
#[cfg(target_os = "macos")]
mod macos;
#[cfg(not(target_os = "linux"))]
#[cfg(not(target_os = "macos"))]
#[cfg(not(target_os = "windows"))]
mod other;
#[cfg(target_os = "windows")]
mod windows;
#[cfg(target_os = "linux")]
pub use self::linux::*;
#[cfg(target_os = "macos")]
pub use self::macos::*;
#[cfg(not(target_os = "linux"))]
#[cfg(not(target_os = "macos"))]
#[cfg(not(target_os = "windows"))]
pub use self::other::*;
#[cfg(target_os = "windows")]
pub use self::windows::*; and add an use std::time::Duration;
pub struct ProcessInfo;
pub fn collect_proc(_interval: Duration, _with_thread: bool) -> Vec<ProcessInfo> {
vec![]
} this way, when ps calls |
@fdncred Thanks! I can test this, would it possible to get these in patch format? Forgot to add that
EDIT: This is on |
my changes are for 0.59.1 and higher |
@fdncred yes, I know this. I'm trying to build from the latest git-commit in the main branch. I was just pointing out the historical trouble with |
oh, ok. i'm sorry, i misunderstood you. the 0.59.1 uses a combination of procs and sysinfo and other stuff we found. i don't know how to generate a patch. |
😄 I've already patched Let's see if I also need to patch |
|
I've tested your changes and appreciate your help.
|
It looks like the easiest solution from here may be to change fn run_ps(engine_state: &EngineState, call: &Call) -> Result<PipelineData, ShellError> {
let mut output = vec![];
let span = call.head;
let long = call.has_flag("long");
let process_info = nu_system::collect_proc(Duration::from_millis(100), false);
if !process_info.is_empty() {
for proc in process_info {
let mut cols = vec![];
let mut vals = vec![];
cols.push("pid".to_string());
vals.push(Value::Int {
val: proc.pid() as i64,
span,
});
cols.push("name".to_string());
vals.push(Value::String {
val: proc.name(),
span,
});
#[cfg(not(windows))]
{
// Hide status on Windows until we can find a good way to support it
cols.push("status".to_string());
vals.push(Value::String {
val: proc.status(),
span,
});
}
cols.push("cpu".to_string());
vals.push(Value::Float {
val: proc.cpu_usage(),
span,
});
cols.push("mem".to_string());
vals.push(Value::Filesize {
val: proc.mem_size() as i64,
span,
});
cols.push("virtual".to_string());
vals.push(Value::Filesize {
val: proc.virtual_size() as i64,
span,
});
if long {
cols.push("command".to_string());
vals.push(Value::String {
val: proc.command(),
span,
});
#[cfg(windows)]
{
cols.push("cwd".to_string());
vals.push(Value::String {
val: proc.cwd(),
span,
});
cols.push("environment".to_string());
vals.push(Value::List {
vals: proc
.environ()
.iter()
.map(|x| Value::string(x.to_string(), span))
.collect(),
span,
});
}
}
output.push(Value::Record { cols, vals, span });
}
}
Ok(output
.into_iter()
.into_pipeline_data(engine_state.ctrlc.clone()))
} |
@fdncred started another build, will report back. |
I will double check all the patches and re-try. The last build failed in the same way as the previous. |
that's odd - i would think that |
@fdncred I'm building from a fork I've created to make patching more flexibel. You can check the diffs and see if you spot anything obvious, https://github.com/0323pin/nushell |
a quick glance at your changes and i think they look right. i'm not sure what is going on. |
Maybe @jntrnr can spot something. Thanks for looking. |
Just from looking at the error, it seems like there isn't any *bsd support for |
Are you using an external crate for these or, internal code? I've imported nushell-0.34.0 into NetBSD and have been using it since. It would be sad if we can't keep updating the package. |
I already knew this but for the record the build fails on a clean build environment with the following error,
|
@grtcdr Hi my friend, thanks for jumping in, appreciated. The failing build has all the above patches included though.
|
Has the patch helped in getting a successful build? |
The patch needs to implement all the methods that are reported as not having been defined in the crate. |
At this point, the patch should just be added to a |
@grtcdr I'd have to agree with this |
We'd be happy to take a PR to |
I could help you achieve that, but I'll have to setup a new NetBSD environment from scratch, which could take me a while due to my terrible internet connection. Would you like me to do that? |
@grtcdr that would be awesome. |
The first thing that comes to mind for me is to lay out a barebones implementation of ProcessInfo, where we can make use of a handy macro that Rust provides called I'll begin by setting up my NetBSD environment, after which I'll fork the repository and make a draft PR. |
Closing this now as a potential solution is more complex than what I can handle. @grtcdr thank you for looking and for your patches, the build now fails to compile the
|
@0323pin - you could leave this open and see if someone else with bsd experience can help. |
@jntrnr Appreciate your thought, I'll re-open this. |
I'm actually thinking that a NetBSD implementation might be closer to the existing implementation for MacOS, rather than the Linux one. I might kick a build after the weekend using,
|
@jntrnr Ok, the above won't really work at the moment, neither Lets take one step at the time, though. I found someone willing to help :) |
@0323pin if you look at this function, you can see what each platform (Mac, linux, windows) is returning by looking at the cols.push() lines. nushell/crates/nu-command/src/system/ps.rs Lines 69 to 149 in 8a9cc33
|
@fdncred Thanks. |
This was unexpected ... yes, looking at the changes, it should have fixed it. |
@hustcer So, I couldn't wait that long 😄 I've just built from git-HEAD with the following features enabled, I will try also enabling EDIT: Forgot to mention it, the resulting binary works fine. Man, I have a lot to get used to after 6 months on |
@jntrnr Any hint on when 0.67.1 will be released? We are still providing pre-compiled binaries for 0.44.0 and it would be nice to bump this to the 0.6x.x series. |
Alright, I'll close this issue now. The Thanks! |
@0323pin We plan on releasing 0.68.0 on Sept 6 |
Describe the bug
nu
-0.59.1 from commit 9db356e fails to build on NetBSD.First attempt to build fails since NetBSD
libc
doesn't supporttrash-support
I've disabled this feature at build time and have the following features enabled, "plugin", "which", "zip-support".
But, I'm hitting the following build error,
How to reproduce
Build
nu
from git-HEADExpected behavior
Build finishes successfully.
Screenshots
No response
Configuration
No response
Additional context
OS: NetBSD-current (9.99.94)
Rust: 1.59.0
The text was updated successfully, but these errors were encountered: