-
Notifications
You must be signed in to change notification settings - Fork 711
Search upwards for package directory #2810
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
Comments
Implementation issues/notes:
|
Fwiw, things like |
Yup, and the problem is... properly handling CWD has some potentially thorny issues:
A possible workaround would be to export an environment variable (like |
If we're going to do a forking type thing, an interesting idea might be to follow git's model of handling subcommands, namely just compiling each subcommand into a separate executable and then calling that from the main command. That would automatically "protect" the user's CWD from any interference by subcommands. What do you think about that idea? (I realize that such a change definitely isn't trivial, but is it totally crazy?) |
As I mentioned in #2349, why do we need to restore the CWD at all during |
Hm. Now that I think about it... maybe we don't. I think I just did a brain fart. |
so one less problem to worry about =) I previously asked on #2811
I'd be interested in what you plan because I want to understand how the locations of sandbox-configs and |
Right, so right now the algorithm is literally what you see in I think the most important thing here is to try to keep things as simple as possible. In particular there will be no magical merging of .cabal files, configurations or any such. In the absence of sandbox-related command line flags, the only difference over current behavior should be that:
Now, the various flags complicate things a little, but the behavior I've implemented is this:
I believe this is faithful to the way cabal-install behaves without my changes. (The flag handling is the main reason that I combined the sandbox directory and config file paths into the SandboxMetadata data type -- without this unification the various control flows were getting absurdly hard to follow and were getting very deep. It was getting really hard to decide when to do a search, for instance.) Does this make sense? EDIT: Minor clarification |
Regarding GIT_DISCOVERY_ACROSS_FILESYSTEM: I think it might be a useful thing to have, but I don't see it as particularly necessary since users typically don't have mulitple file systems in their home directories[1], and I don't see evil sysadmins putting .cabal files in /, or /home. (This would apply even if your $HOME is on NFS, I think.) In the case of git, I think it would be more likely to have .git folders in various obscure directories for various sysadmin-related reasons and so the above reasoning wouldn't apply. (My search code does cross filesystems, but I don't see it as particularly dangerous for the above reasons.) [1] This may have changed with fuse, though. I guess it's worth considering defaulting to not crossing file system boundaries, though I don't know how easy it would be to do in Haskell. I'm guessing we'd need some platform-dependent code at the very least. (I'm guessing git uses device number comparison.) |
This is turning into lots of fun... I just discovered that |
Closing since it's mostly redundant when we have nix-local-build. (And would have to be reworked entirely, anyway.) |
The idea here is that if the user's current working directory is somewhere inside a cabal package, then cabal-install should automatically find the .cabal file in one of the parent directories, instead of forcing the user to change to that directory.
The text was updated successfully, but these errors were encountered: