-
Notifications
You must be signed in to change notification settings - Fork 12
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
Import std/log environment; CI: Update Ubuntu #103
Conversation
why only add this to |
I didn't knew where to put it, actually, now if you check the CI its broken for the same reason |
mm that looks quite annoying 😅 sounds like something a library shouldn't have to worry about, right? |
@NotTheDr01ds thoughts on how to get rid of this error? |
well after some investigation I found out that when you have a module like this example.nu use std/log
export def test_cmd [param: string, ] {
log info $param
} then running the imported function is working but the env vars aren't
but
this one works maybe its a bug in env isolation |
Apologies - missed the notification again. @FMotalleb Thanks for pinning this down - Your MRE showed me what's happening ... This goes back to nushell/nushell#13403. I'm not sure if it's a bug or design, but importing a module within another module doesn't re-export the parent's The workaround is to make sure the parent module re-exports the child module's ( use std/log
export-env {
use std/log []
}
export def test_cmd [param: string, ] {
log info $param
} |
I thought about defining these at startup and just taking them out of Technically, it's also a problem for the It would be great if the root issue could be fixed, but perhaps we work around it for now by defining those environment variables during startup? The performance impact for that should be minimal. |
Yeah, that was my thought in nushell/nushell#13403 |
If I understand correctly, the problem is that environment variables from |
well "It Doesn't work on my machine" 😂
I still face the same error ( |
oh my bad there was another export-env after my block |
OK, looks good, thanks! |
Will fix this issue but its not a good fix anyway
Description
This is a hotfix PR to address an unusual issue with the
std log
package in Nushell. When the log is imported during the initialization stage, it doesn’t persist long enough to be fully available at runtime, specifically, the environment variables seem to disappear, although the log function itself remains accessible. This is a temporary fix and might not be the final solution. It could potentially be a bug in Nushell, but unfortunately, I don't have the time to investigate it further.for more information please check this issue
I think this fix changes the output of the nupm, Plz close this PR if you found any real solution