-
Notifications
You must be signed in to change notification settings - Fork 31
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
Let the cabal build "dist" directory alone #32
Comments
The problem lies in Snap making an assumption about the buildDir. |
probably, but still I can't see any good reason to change the dist directory name. |
One dist directory per hsenv is the desired behavior. An hsenv is an isolated environment. If you create multiple hsenv and do different configurations in each hsenv you will expect different build results. It is not as simple but it is the only reasonable behavior. |
I see your point. From my point of view, since tipically a hsenv env is associate to one and only one project (aka folder) I don't expect to have multiple dist folders, but only one. I struggle to find an example where it could be useful to fireup two or more isolated environment for the same project, maybe to test different build versions? I suspect that most depends on the expected behavior for the final user though. |
Would it be useful to have an option to pass to the |
yes, it might work. The only nuisance is that if you invoke "cabal clean", as far as I remember, it wipes out the /dist directory, and so our symlink :( |
What I think would be good for that most common case (i.e. having only one hsenv) is to restore the unnamed hsenv folder. I thought it was better when an invocation of |
How about leaving the default behavior the way it is currently, but adding an option to organize the directories the old way? So using something like I agree with you about the older way being more commonly useful, but I would be reluctant to change the default behavior that other users may now be relying on. |
+1 |
I think the new behavior is counter intuitive when you use the other equivalent tools such as virtualenv for python. You should have to use a flag only when you want a special behavior. As @adinapoli pointed, the new name for dist is not the desired default behavior and it is fairly rare that one person wants multiple hsenvs. When you want multiple hsenvs then playing with the options is not much of a problem. The new behavior was put in hsenv only because of an issue: Paczesiowa/virthualenv#34 and it does not feel that it was done in an optimal way. |
I think that, if we remove the dist SUFFIX whilst retaining the hsenv_<env_name> we can have the cake and eat it too: this means that the user will still have MULTIPLE environments (because has multiple hsenv_* folders) but everytime he build he will create one and only one dist dir. It's unlikely that the final user bothers about not having separate dist directiories, as long as at least an executable gets build! :) |
The default naming of .hsenv_<name_of_containing_dir> is still a little weird. What is so special about the name of the containing dir? |
@adinapoli I don't think we can get away with multiple I think we can probably change the default behavior back to the old, single-sandbox way of doing things, as long as we provide an option to keep the current behavior for those who need it. The name of the containing directory is only special in that it is assumed to be the name of the project. Even in the current version, you can explicitly specify a suffix for your hsenv when initializing it on the command line. |
This is exactly what I think we should do. And keep the |
This issue has now been addressed in my fork of hsenv. The default behavior when initializing a new sandbox is to omit the suffix from the |
Nice @tmhedberg , ty. |
@dudebout gets the credit. He wrote the patch. I just merged it. :) |
So cheers @dudebout 🍻 |
Hi,
I don't know if this is a specifc hsenv issue of is related to the way cabal works or is sandboxed. A common problem an hsenv user has is that cabal build puts its output in the dist directory. With hsenv activated instead, the fold is renamed dist_<env-name>.
The problem is that this breaks a lot of scripts (for example the ones Snap framework uses for running test coverage), because this scripts expect to find the dist directory, without the trailing suffix.
One solution is to symlink the dist_<env-name> to point to dist, but this solution is not elegant due to the fact it binds the script to the presence of hsenv. The process should be agnostic.
How to reproduce it:
Expected Behaviour:
Real Behaviour:
Cheers,
Alfredo
The text was updated successfully, but these errors were encountered: