#7427 closed feature request (fixed)
Proposal: Add setEnv/unsetEnv to System.Environment
Reported by: | SimonHengel | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.8.1 |
Component: | libraries/base | Version: | 7.6.1 |
Keywords: | Cc: | ||
Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
Type of failure: | None/Unknown | Test Case: | |
Blocked By: | Blocking: | ||
Related Tickets: | Differential Rev(s): | ||
Wiki Page: |
Description
I propose to add setEnv/unsetEnv to System.Environment, so that it is easier to write applications that behave the same on POSIX and Windows systems.
Here is the corresponding thread on the libraries mailing list. The proposal was overall supported.
A patch is attached.
Attachments (1)
Change History (8)
Changed 6 years ago by
Attachment: | 0001-Add-setEnv-unsetEnv-to-System.Environment.patch added |
---|
comment:1 Changed 6 years ago by
comment:2 Changed 6 years ago by
The patch has been validated on Linux (amd64). I tested the Windows code in the context of a standalone package, but I have no means to run GHC's validate script on Windows. It would be awesome if somebody can help with that.
Corresponding Hspec tests are here: https://github.com/sol/setenv/blob/master/test/System/SetEnvSpec.hs
It was not obvious how to integrate them into GHC's build process. I tried a couple of things, but it's still not clear to me if/how I can run QC properties within GHC's build system. Let me know if you can help with that.
comment:3 Changed 6 years ago by
difficulty: | → Unknown |
---|---|
Milestone: | → 7.8.1 |
Status: | new → patch |
Thanks for the patch; we'll take a look.
comment:4 Changed 6 years ago by
Hmm, this patch duplicates some ugly configure code from the unix package. If we're going to split base up before 7.8, then it might be better to do that first, and then implement this code on top of unix.
comment:5 Changed 6 years ago by
In that case we can use my implementation from https://github.com/sol/setenv. It depends on unix and does not require any configure code.
If the split up does not happen in time, I would still vote for applying this patch.
comment:6 Changed 6 years ago by
Resolution: | → fixed |
---|---|
Status: | patch → closed |
The base split is now scheduled or post-7.8-branch, and as the amount of duplication is small I went ahead and applied this.
comment:7 Changed 6 years ago by
I've updated the setenv package to re-export these symbols here, https://github.com/sol/setenv/pull/2
A summary of the proposal is here: http://www.haskell.org/pipermail/cvs-ghc/2012-November/078442.html