Pasta with Spicy Cabbage

Cook pasta according to package directions.
While pasta is cooking, in a large skillet, melt the butter over medium-high heat. Add the sugar and cook, stirring, until it dissolves, 2 minutes. Add the onion and cook, stirring, until the onion is lightly caramelized, about 12 minutes. Add the cabbage, cumin, and cayenne and cook, stirring, until the cabbage softens slightly, about 5 minutes.
Drain the pasta and add to the cabbage. Cook the pasta and cabbage, stirring, until combined, about 1 minute.
Season the pasta with salt and pepper, transfer to a serving bowl, and serve while hot.