1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 01:36:01 +02:00

bug 401116: Built-in compiler settings cannot be scanner-discovered prior to a build by non-shared language settings providers

This commit is contained in:
Andrew Gvozdev 2013-02-18 14:18:29 -05:00
parent b5d0a617f2
commit e4966b7c0c
4 changed files with 10 additions and 3 deletions

View file

@ -325,9 +325,9 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
@Override @Override
protected URI getBuildDirURI(URI mappedRootURI) { protected URI getBuildDirURI(URI mappedRootURI) {
// Do not calculate buildDirURI for each line
if (buildDirURI == null) { if (buildDirURI == null) {
buildDirURI = super.getBuildDirURI(mappedRootURI); // do not use build directory from MBS which could be not-existent when the provider runs
buildDirURI = currentProject != null ? currentProject.getLocationURI() : null;
} }
return buildDirURI; return buildDirURI;
} }
@ -347,7 +347,7 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
super.startup(cfgDescription, cwdTracker); super.startup(cfgDescription, cwdTracker);
mappedRootURI = null; mappedRootURI = null;
buildDirURI = super.getBuildDirURI(mappedRootURI); buildDirURI = getBuildDirURI(mappedRootURI);
} }
@Override @Override

View file

@ -25,6 +25,7 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Platform;
import org.eclipse.osgi.util.NLS; import org.eclipse.osgi.util.NLS;
@ -184,6 +185,10 @@ public class CommandLauncher implements ICommandLauncher {
} }
File dir = workingDirectory != null ? workingDirectory.toFile() : null; File dir = workingDirectory != null ? workingDirectory.toFile() : null;
if (dir != null && !dir.isDirectory()) {
CCorePlugin.logStackTrace(IStatus.ERROR, NLS.bind(Messages.CommandLauncher_InvalidWorkingDirectory, dir));
dir = null;
}
try { try {
fProcess = ProcessFactory.getFactory().exec(fCommandArgs, env, dir); fProcess = ProcessFactory.getFactory().exec(fCommandArgs, env, dir);

View file

@ -17,6 +17,7 @@ public class Messages extends NLS {
public static String Util_unexpectedError; public static String Util_unexpectedError;
public static String Addr_valueOutOfRange; public static String Addr_valueOutOfRange;
public static String CommandLauncher_CommandCancelled; public static String CommandLauncher_CommandCancelled;
public static String CommandLauncher_InvalidWorkingDirectory;
public static String CommandLauncher_ProgramNotFoundInPath; public static String CommandLauncher_ProgramNotFoundInPath;
public static String convention_illegalIdentifier; public static String convention_illegalIdentifier;
public static String convention_invalid; public static String convention_invalid;

View file

@ -48,6 +48,7 @@ Util_unexpectedError=Unexpected error
Addr_valueOutOfRange=Address is outside valid range. Addr_valueOutOfRange=Address is outside valid range.
CommandLauncher_CommandCancelled=Command canceled CommandLauncher_CommandCancelled=Command canceled
CommandLauncher_InvalidWorkingDirectory=Launch attempt in non existent working directory "{0}"
CommandLauncher_ProgramNotFoundInPath=Error: Program "{0}" not found in PATH CommandLauncher_ProgramNotFoundInPath=Error: Program "{0}" not found in PATH
XmlUtil_InternalErrorLoading=Internal error while trying to load XML document XmlUtil_InternalErrorLoading=Internal error while trying to load XML document