Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
syscall: plan9 environment variable handling #8849
While adding syscall.Unsetenv, I notice that plan9's environment handling in pkg syscall seems inconsistent. It sometimes does copyenv, but sometimes not. And things like Getenv can lazily populate it. It seems like there are possible bugs with different orderings, but I didn't look too hard. Talking to Russ, he points out that plan9 processes can share environments, so keeping a cached copy of anything in syscall is probably wrong. I will do the bare minimum to keep plan9 compiling, but somebody should probably own cleaning this up.
Sorry, I did end up breaking plan9 with https://golang.org/cl/82040044 I think the reason is that Getenv and Setenv update the cached environment but don't update the envi map I added. I would try to fix this, but I don't have a way to test and in my opinion this code needs an overhaul, so I'll leave it to people who can test. I would be happy to review, though.