Skip to content

Build dir made more unique by adding arch and board #5130

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions arduino-core/src/processing/app/BaseNoGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public class BaseNoGui {
}

private static DiscoveryManager discoveryManager = new DiscoveryManager();

// these are static because they're used by Sketch
static private File examplesFolder;
static private File toolsFolder;
Expand Down Expand Up @@ -129,7 +129,8 @@ static public File getBuildFolder(SketchData data) throws IOException {
buildFolder = absoluteFile(PreferencesData.get("build.path"));
Files.createDirectories(buildFolder.toPath());
} else {
buildFolder = FileUtils.createTempFolder("build", DigestUtils.md5Hex(data.getMainFilePath()) + ".tmp");
PreferencesMap targetBoardPrefs = getTargetBoard().getPreferences();
buildFolder = FileUtils.createTempFolder("build", DigestUtils.md5Hex(data.getMainFilePath() + targetBoardPrefs.get("build.arch") + targetBoardPrefs.get("build.board")) + ".tmp");
DeleteFilesOnShutdown.add(buildFolder);
}
return buildFolder;
Expand All @@ -140,7 +141,7 @@ static public PreferencesMap getBoardPreferences() {
if (board == null)
return null;
String boardId = board.getId();

PreferencesMap prefs = new PreferencesMap(board.getPreferences());

String extendedName = prefs.get("name");
Expand Down Expand Up @@ -399,7 +400,7 @@ static public void init(String[] args) throws Exception {
parser.parseArgumentsPhase1();

String sketchbookPath = getSketchbookPath();

// If no path is set, get the default sketchbook folder for this platform
if (sketchbookPath == null) {
if (BaseNoGui.getPortableFolder() != null)
Expand All @@ -421,7 +422,7 @@ static public void init(String[] args) throws Exception {
for (String path: parser.getFilenames()) {
// Correctly resolve relative paths
File file = absoluteFile(path);

// Fix a problem with systems that use a non-ASCII languages. Paths are
// being passed in with 8.3 syntax, which makes the sketch loader code
// unhappy, since the sketch folder naming doesn't match up correctly.
Expand All @@ -445,7 +446,7 @@ static public void init(String[] args) throws Exception {
showError(null, mess, 2);
}
}

// Save the preferences. For GUI mode, this happens in the quit
// handler, but for other modes we should also make sure to save
// them.
Expand Down Expand Up @@ -771,7 +772,7 @@ static public void main(String args[]) throws Exception {
getPlatform().init();

initPortableFolder();

initParameters(args);

checkInstallationFolder();
Expand Down