-
Notifications
You must be signed in to change notification settings - Fork 685
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
No way of specifying a remote-repo in a sandbox #1884
Comments
An issue I ran across might have the same cause: if you generate a cabal.config with |
Not sure what the best thing is, but |
A few questions:
|
|
This should be fixed to make sandboxes work as intended. As it is now, they are a somewhat leaky concept. |
I have implemented the behaviour for Since there appears to be interest in fixing this, I'll split out the patch within a few days and submit it before the rest of the GHCJS patch. Does anyone object to the behaviour where |
@luite Thanks for all that! In my opinion, the only problem with that behavior is that it might be very surprising and perplexing to some people, so it needs to be documented. In fact, from the discussion above, the opposite behavior might be just as surprising to some other people, so it's even more important for whatever we implement to be documented. The trouble is, I'm not sure where the right place is to put that documentation so that people who need to know about this will have some reasonable chance of seeing it. |
Whether things in the local config overrides the global or not is currently rather unclear (to users I mean). What I'd like to see is that we introduce a mechanism to make this fully explicit, and then there's no more confusion. We should have an "include" or similar, and then by default have local config files include the per-user ~/.cabal/config one (or not, depending on the desired behaviour). Similarly, the sandbox config vs the local config, we should not implicitly include both, but have one very explicitly include the other. If we need a mechanism for selective including then fine. |
An "include" statement feels a bit coarse-grained. I think that this mechanism should work on per-option basis. For example:
|
I like the idea of include. Inserting the contents of a config file would have the same effect as an include directive at the same location, which makes things nice and clear. Selective imports sound a bit tricky though. Having a way to reset a field to a default value might be better:
where your syntax could be usable as a shortcut for unset followed by a new value. |
Any progress on this ? |
I think most people were at ICFP last week, which could've been the reason for the low activity. I'm back now, and unless anyone has objections or steps up I'll try to implement the approach from my last message next weekend. |
I have an almost complete but very untested implementation of the override idea, where the types of "appendable" fields have been changed to something that supports the notion of Duncan's explicit imports idea is orthogonal and I think that even without overriding (or filtering) on a per-field basis it's already quite usable. Just have both your |
I'd like to switch to stackage but don't want to give up on sandboxes - is there any hack/patch/workaround that would me allow that until it's properly implemented ? |
Here is one suggestion: Have a different global cabal config files your different projects, and write a front end script for cabal that runs Something else I did in the past: have a script that initializes work with a specific project by swapping the global cabal config to the right one for that project. You have to remember to run that script though. Anyway, that did work for me. |
Due to the lack of a voting mechanism on issues: 1st-class support for cabal sandboxes + remote-repo 🙏 |
What I'm really concerned about is that:
Can someone who has the authority to make a move on this issue comment on how we can precede? This doesn't seem to be stalled due to any lack of energy towards fixing it, but simply due to lack of a clear process. |
Where? I don't see a pull request.
The process is simple: send us pull requests, and we'll either merge them (usually) or reject them (sometimes) after a code review. |
@luite implemented it, see: #1884 (comment) |
Well, it's up to @luite then to send a pull request when he thinks that the patch is ready to be merged. |
@23Skidoo There's a discussion (which you participated in) following @luite's comment above which demonstrates that it is premature to make a pull request, as neither you nor @dcoutts seem satisfied with what @luite has implemented so far. So we seem to be in a situation where:
Put another way: if I knew the cabal codebase backwards and forwards and was willing to invest the next 20 hours straight in getting this implemented, I'd still have no idea where to start. So I'm asking: how do we get this process unstuck? |
Some possible solutions:
|
I'm looking into this now, and just noting an extra problem: |
This follows @23Skidoo's option (3) at: haskell/cabal#1884 (comment) If a config file has a repo name that begins with `!`, it's treated as *overriding*, meaning that any previous repos are ignored. This allows a sandbox to either add additional repos (by omitting the `!`), or ignore the main config's repos and use a separate repo (which is currently the use case I'm trying to design for).
This follows @23Skidoo's option (3) at: haskell#1884 (comment) If a config file has a repo name that begins with `!`, it's treated as *overriding*, meaning that any previous repos are ignored. This allows a sandbox to either add additional repos (by omitting the `!`), or ignore the main config's repos and use a separate repo (which is currently the use case I'm trying to design for).
This follows @23Skidoo's option (3) at: haskell#1884 (comment) If a config file has a repo name that begins with `!`, it's treated as *overriding*, meaning that any previous repos are ignored. This allows a sandbox to either add additional repos (by omitting the `!`), or ignore the main config's repos and use a separate repo (which is currently the use case I'm trying to design for).
The patch that I mentioned required more changes in the data types than I was comfortable with, since it supported an I personally still like the idea of explicitly including things best, even when keeping it simple (no partial imports), since it's easy to explain and understand and immediately works for all fields. Unfortunately I didn't complete the implementation since I ran out of time, and many other things here have been taking more time than I hoped (like making GHCJS work with GHC HEAD again) recently. I'll dig up what i got for my include implementation this weekend, I'm don't remember how close to ready it is or what it still takes to finish it, but I guess letting it sit on my hard drive only delays a solution. Somewhat off-topic: Since GHC 7.10 is nearing, I feel that there must be more problems similar to this one that we really want fixed before the branch for 7.10 is cut, but are in need of some attention to get unstuck. I can spend some time on this, Sunday-Wednesday for example, be online on IRC (google talk or other is ok too) and try to help others navigating the source and discuss solutions. Should we do something like this, agree on a bunch of higher priority tickets and do a distributed "mini-hackathon"? |
Fixes haskell#1884. See comments in the code for more details.
Fixes haskell#1884. See code comments for more details.
Fixes haskell#1884. See code comments for more details.
Note that I have backported @23Skidoo's patch to cabal 1.20 and am now using it on my local system with Stackage, and it appears to work just fine. |
Fixes haskell#1884. See code comments for more details.
Fixes haskell#1884. See code comments for more details.
Great, thanks for doing the work! |
I initially asked this as a Stack Overflow questions. Apologies if this is not in fact a bug, but I can't seem to find any way to accomplish what I'm trying to do.
I would like to work on a project in a cabal sandbox. But instead of using the same
remote-repo
as my non-sandboxed code (i.e., Hackage), I'd like to point to a different remote repo. I tried creating acabal.config
file in the project directory with aremote-repo
line, but it seemed to have no effect; runningcabal update
after that indicated that Hackage was being downloaded, but not my custom repo.Is this use case supported, and if so, how do I achieve it?
The text was updated successfully, but these errors were encountered: