Heat oven to 400ºF.
Using a sharp chef knife or serrated knife at a 45º angle to cut out the top of the squash. Use a spoon to scoop out the seeds and discard. Rub the inside of the squash and top of the lid with the stem with olive oil and arrange on a baking sheet. Roast until the squash is soft, about 35 minutes.
Let the squash cool to the touch then use a spoon to scrape the flesh from the inside until you have 1 cup of squash and set aside.
Heat a large saucepan over medium heat, add the butter and allow to melt. Add the rosemary stirring occasionally until fragrant, about 30 seconds. Stir in the flour and cook until pale golden brown then whisk in the milk. Bring the mixture to a boil then lower the heat to medium-low. Cook, stirring occasionally, until the sauce coats the back of a spoon, about 5 minutes.
Slowly add 1½ cups of the gruyere stirring until all the cheese has been completely incorporated. Remove from heat and let cool slightly. Add the mixture and the squash to a blender and blend until smooth. Return to the pot.
Bring a large pot of water to the boil; add the salt and bring back to the boil. Add the pasta to the boiling water and cook, stirring occasionally, until al dente, about 10 minutes. Drain the pasta and return to the pot. Pour the squash and cheese sauce over the pasta, stirring to combine.
Heat broiler on high. Arrange the roasted squash bowls on a baking sheet. Divide the pasta among the roasted squash serving bowls and top with the remaining gruyere. Broil until the cheese is golden brown, about 2 minutes.