Heat the oven to 375 degrees. Arrange the tomatoes cut side down in a large glass baking dish in a single layer (you may need to use two). Scatter the onions, garlic, sugar, salt, and herbs on top of the tomatoes and drizzle with the olive oil.
Roast until the tomatoes shrivel and collapse and their juices start pooling in the bottom of the baking dish, about 2 hours, though the time can vary greatly depending on the size and consistency of the tomatoes.
Let the roasted tomatoes cool slightly, and then scrape everything into a blender or food processor and process until smooth. If you want to remove the skins and seeds (which is unnecessary, though it makes for a prettier, smoother sauce), run the sauce through a food mill. Taste and adjust the seasoning with more salt or sugar.