Step 1Heat the oven to 275 degrees. Place the tomatoes, cut-side up, on a lightly oiled baking sheet and sprinkle with the sugar, salt and pepper. Bake until the tomatoes are shriveled slightly and are browned in places, 2 1/2 to 3 hours.
Step 1In a blender, puree the roasted tomatoes with one-fourth cup olive oil until fairly smooth. Set aside.
Step 2In a large, heavy skillet, heat the remaining olive oil over medium-high heat and add the onions, garlic and carrots, cooking until the vegetables are soft and the onions begin to caramelize, about 10 to 12 minutes.
Step 3Add the wine, fresh tomatoes, parsley, rosemary, thyme, oregano, basil and chili flakes, if using. Cook uncovered over medium-low heat, stirring occasionally, until most of the liquid has evaporated, 30 to 40 minutes.
Step 4Add the reserved roasted tomato puree and stir to combine. Continue to cook over low heat for an additional 15 minutes to allow the flavors to blend. Taste and season with 1 teaspoon salt and several grinds of pepper; add a little sugar if desired to sweeten. Serve immediately over pasta, or cool, then cover and refrigerate until needed, up to 5 days.