Changes between Version 16 and Version 17 of PackageEnvironments

Show
Ignore:
Timestamp:
09/16/12 07:25:08 (8 months ago)
Author:
tibbe
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PackageEnvironments

    v16 v17  
    243243 
    244244Cabal-meta combines listing the location of packages with constraints for those packages. It's not clear if that's a good idea. However it does seem like a good idea to be able to have them in the same file at least. Perhaps instead of just allowing `local-repo: ./cabalenv/index.tar` and the links only being mentioned in there, we should allow listing them directly in this file. This would have the limitation that you cannot include whole .cabal files or tarballs by value, but you could still list links to local packages. 
     245 
     246== sandbox command == 
     247 
     248 
     249Sandboxes are created, inspected, modified, and deleted through the 
     250`cabal sandox` command: 
     251 
     252 * `cabal sandbox init` creates a new sandbox. 
     253 
     254 * `cabal sandbox delete` deleted the sandbox, including all packages 
     255   installed in the sandbox (i.e. in `.cabal-sandbox`). 
     256 
     257 * `cabal sandbox add-source` adds a source package to the sandbox 
     258   package database. 
     259 
     260 * In the future we might add commands for showing the packages 
     261   installed in the sandbox, the sandbox location (i.e. directory), 
     262   etc. 
     263 
     264`sandbox init` creates a new sandbox by creating a specially named 
     265file, `cabal.sandbox.config`, in the root directory of the package. 
     266This file contains a `local-repo` and a `install-dirs` `prefix` that 
     267points to the sandbox (i.e. to `.cabal-sandbox/packages` and 
     268`.cabal-sandbox` respectively). If this file is present, all builds in 
     269the package's directory will use the sandbox. 
     270 
     271The `cabal.sandbox.config` file is not normally edited by users and 
     272should contain a warning on top of the file saying that it's machine 
     273generated. If the user wants to add e.g. package constraints she 
     274should use the (new) `cabal.config` file, which doesn't exist by 
     275default but can be added to the package's root directory by the user. 
     276 
     277By using two different package environment files (both recognized by 
     278Cabal through their special names) allows us to have one file that the 
     279user can edit without worrying about the system overwriting any 
     280changes she made (including comments and whitespace layout). 
     281 
     282Even though the `cabal.sandbox.config` file is normally not edited by 
     283the user we decided to keep it visible (i.e. not in `.cabal-sandbox`) 
     284so the user can edit it if desired. We can revisit this choice in the 
     285future if this proves to confuse users. 
     286 
     287The config files have the following priorities, from higher to lower: 
     288 
     289 1. `cabal.sandbox.config` 
     290 2. `cabal.config` 
     291 3. `~/.cabal/config` 
     292 
     293Once a sandbox have been created, all cabal commands (e.g. configure, 
     294build, and install) will make use of it automatically. 
     295 
     296Source packages that have been added ("linked") into the sandbox by 
     297`add-source` are rebuilt (and reconfigured, if needed) and installed 
     298into the sandbox each time the main package is built. We most likely 
     299want to optimize this process some time in the future, to avoid 
     300rebuilding/relinkining when neccesary.