Fix python root resolution logic in build step.