Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Stack Overflow when using a project with a dependency from an executable

to a library with cabal-dev fixed
(#92)
  • Loading branch information...
commit 6be0a67e26869ddd4bf7440030911060a896bd80 1 parent d906fe0
@JPMoresmau authored
View
29 docs/releasenotes/net.sf.eclipsefp.haskell_2.5.2.txt
@@ -0,0 +1,29 @@
+EclipseFP Haskell 2.5.2
+
+Release Notes
+
+
+Necessary Haskell packages:
+
+ - EclipseFP relies on BuildWrapper, a Haskell IDE library, for a lot of its functionality. See https://github.com/JPMoresmau/BuildWrapper for more information. Version 0.7.1 of buildwrapper has been validated with this version of EclipseFP
+ - EclipseFP also uses scion-browser. Version 0.2.13 has been validated with this version of EclipseFP
+
+
+Fixes:
+ - Cabal editor allows a dependency from an executable or a test class to a library via the add dependency UI
+ - Stack Overflow when using a project with a dependency from an executable to a library with cabal-dev fixed (https://github.com/JPMoresmau/eclipsefp/issues/92)
+
+Features:
+
+
+Internal:
+
+
+Upgrade notes:
+ - Upgrade via the Eclipse install site http://eclipsefp.sf.net/updates.
+
+
+Known issues:
+
+Thanks to all bug reporters and users for their feedback.
+Thanks to all the people that expressed interest in EclipseFP and want to see it stay alive and improve!
View
4 net.sf.eclipsefp.haskell-feature/feature.xml
@@ -81,7 +81,7 @@ available at http://www.eclipse.org/legal/epl-v10.html.
id="net.sf.eclipsefp.haskell.core"
download-size="0"
install-size="0"
- version="2.5.0"
+ version="2.5.2"
unpack="false"/>
<plugin
@@ -158,7 +158,7 @@ available at http://www.eclipse.org/legal/epl-v10.html.
id="net.sf.eclipsefp.haskell.buildwrapper"
download-size="0"
install-size="0"
- version="2.5.1"
+ version="2.5.2"
unpack="false"/>
<plugin
View
2  net.sf.eclipsefp.haskell.buildwrapper/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-SymbolicName: net.sf.eclipsefp.haskell.buildwrapper;singleton:=true
-Bundle-Version: 2.5.1
+Bundle-Version: 2.5.2
Bundle-Activator: net.sf.eclipsefp.haskell.buildwrapper.BuildWrapperPlugin
Bundle-Vendor: %bundleVendor
Bundle-Localization: plugin
View
62 net.sf.eclipsefp.haskell.buildwrapper/src/net/sf/eclipsefp/haskell/buildwrapper/SandboxHelper.java
@@ -5,7 +5,9 @@
*/
package net.sf.eclipsefp.haskell.buildwrapper;
+import java.util.HashSet;
import java.util.LinkedList;
+import java.util.Set;
import net.sf.eclipsefp.haskell.buildwrapper.types.BuildOptions;
import net.sf.eclipsefp.haskell.buildwrapper.types.CabalImplDetails.SandboxType;
@@ -45,8 +47,10 @@ public static void installDeps(BWFacade f) throws CoreException{
switch (st){
case CABAL_DEV:
IProject p=f.getProject();
+ Set<IProject> processed=new HashSet<IProject>();
+ processed.add(p);
for (IProject pR:p.getReferencedProjects()){
- installDeps(f,pR);
+ installDeps(f,pR,processed);
}
LinkedList<String> args=new LinkedList<String>();
args.add("install-deps");
@@ -60,17 +64,20 @@ public static void installDeps(BWFacade f) throws CoreException{
* install given project as a dependency on the given facade
* @param sandboxFacade the facade
* @param p the project
+ * @param processed the set of already processed projects, in case of loops
* @throws CoreException
*/
- private static void installDeps(BWFacade sandboxFacade,IProject p) throws CoreException{
- for (IProject pR:p.getReferencedProjects()){
- installDeps(sandboxFacade,pR);
+ private static void installDeps(BWFacade sandboxFacade,IProject p,Set<IProject> processed) throws CoreException{
+ if (processed.add(p)){
+ for (IProject pR:p.getReferencedProjects()){
+ installDeps(sandboxFacade,pR,processed);
+ }
+ LinkedList<String> args=new LinkedList<String>();
+ args.add("install");
+ args.add(p.getLocation().toOSString());
+ args.add("--force-reinstalls");
+ sandboxFacade.runCabal(args);
}
- LinkedList<String> args=new LinkedList<String>();
- args.add("install");
- args.add(p.getLocation().toOSString());
- args.add("--force-reinstalls");
- sandboxFacade.runCabal(args);
}
/**
@@ -84,8 +91,10 @@ public static void updateUsing(BWFacade f) throws CoreException{
switch (st){
case CABAL_DEV:
IProject p=f.getProject();
+ Set<IProject> processed=new HashSet<IProject>();
+ processed.add(p);
for (IProject pR:p.getReferencingProjects()){
- updateUsing(p,pR);
+ updateUsing(p,pR,processed);
}
break;
}
@@ -96,23 +105,26 @@ public static void updateUsing(BWFacade f) throws CoreException{
* update a given project using a changed project
* @param changedProject the changed project
* @param p the project to update with the new version of the changed project
+ * @param processed the set of already processed projects, in case of loops
* @throws CoreException
*/
- private static void updateUsing(IProject changedProject,IProject p) throws CoreException{
- BWFacade f=BuildWrapperPlugin.getFacade(p);
- if (f!=null && isSandboxed(f)){
- LinkedList<String> args=new LinkedList<String>();
- args.add("install");
- args.add(changedProject.getLocation().toOSString());
- args.add("--force-reinstalls");
- f.runCabal(args); // install the changed project
- f.cleanGenerated(); // all generated files are wrong
- f.configure(new BuildOptions().setConfigure(true));
- f.closeAllProcesses(); // GHC needs to reload the changes
- //f.clean(new NullProgressMonitor());
- }
- for (IProject pR:p.getReferencingProjects()){
- updateUsing(changedProject,pR);
+ private static void updateUsing(IProject changedProject,IProject p,Set<IProject> processed) throws CoreException{
+ if (processed.add(p)){
+ BWFacade f=BuildWrapperPlugin.getFacade(p);
+ if (f!=null && isSandboxed(f)){
+ LinkedList<String> args=new LinkedList<String>();
+ args.add("install");
+ args.add(changedProject.getLocation().toOSString());
+ args.add("--force-reinstalls");
+ f.runCabal(args); // install the changed project
+ f.cleanGenerated(); // all generated files are wrong
+ f.configure(new BuildOptions().setConfigure(true));
+ f.closeAllProcesses(); // GHC needs to reload the changes
+ //f.clean(new NullProgressMonitor());
+ }
+ for (IProject pR:p.getReferencingProjects()){
+ updateUsing(changedProject,pR,processed);
+ }
}
}
View
2  net.sf.eclipsefp.haskell.core/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-Name: %bundleName
Bundle-SymbolicName: net.sf.eclipsefp.haskell.core;singleton:=true
-Bundle-Version: 2.5.0
+Bundle-Version: 2.5.2
Bundle-Activator: net.sf.eclipsefp.haskell.core.HaskellCorePlugin
Bundle-Vendor: %bundleVendor
Bundle-Localization: plugin
View
9 net.sf.eclipsefp.haskell.core/src/net/sf/eclipsefp/haskell/core/builder/HaskellBuilder.java
@@ -161,10 +161,11 @@ public static void addProjectDependencies(final BWFacade f,final IProject prj){
}
Set<IProject> deps=new HashSet<IProject>();
for (String pkg:pkgs){
- IProject p=root.getProject( pkg );
- if (ResourceUtil.hasHaskellNature( p )){
- deps.add(p);
- }
+ IProject p=root.getProject( pkg );
+ // avoid reference to itself
+ if (ResourceUtil.hasHaskellNature( p ) && p!=prj){
+ deps.add(p);
+ }
}
if (deps.size()>0){
Please sign in to comment.
Something went wrong with that request. Please try again.