Obama signs spending bill after rare Washington compromise