2 oz. (1/4 cup) unsalted butter, more for the baking sheet
4 medium-large yellow onions (about 2 lb.), thinly sliced (8 cups)
Kosher salt and freshly ground black pepper
1 tsp. granulated sugar
1 small baguette (1/2 lb.), cut into 1/2-inch slices
2 quarts or lower-salt canned beef or chicken broth
1 bay leaf
2 cups grated Gruyère
Melt the butter in a 4-quart pot over medium heat. Stir in the onions and season with 1 tsp. salt and a few grinds of pepper. Reduce the heat to low. Press a piece of foil onto the onions to cover them completely, cover the pot with a lid, and cook, stirring occasionally (you will have to lift the foil), until the onions are very soft but not falling apart, 40 to 50 minutes. Remove the lid and foil, raise the heat to medium high, and stir in the sugar. Cook, stirring often, until very deeply browned, 10 to 15 minutes.
Meanwhile, to make the croûtes (baguette toasts), position a rack in the center of the oven and heat the oven to 350°F. Butter a rimmed baking sheet and arrange the baguette slices on the sheet in a single layer. Bake until the bread is crisp and lightly browned, turning once, 15 to 20 minutes. Set aside.
Add the broth and bay leaf to the caramelized onions and bring the soup to a boil over medium-high heat. Reduce the heat to medium low and simmer for 10 minutes to blend the flavors. Discard the bay leaf and season to taste with salt and pepper.
To serve, position a rack 6 inches from the broiler and heat the broiler to high. Put 6 to 8 broilerproof soup bowls or crocks on a baking sheet. Put 2 or 3 croûtes in each bowl and ladle the hot soup on top. Sprinkle with the cheese and broil until the top is browned and bubbly, 2 to 5 minutes. Serve immediately.