Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix relative paths in bytecode compilation #11177

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crates/uv-installer/src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ pub async fn compile_tree(
) -> Result<usize, CompileError> {
debug_assert!(
dir.is_absolute(),
"compileall doesn't work with relative paths"
"compileall doesn't work with relative paths: `{}`",
dir.display()
);
let worker_count = std::thread::available_parallelism().unwrap_or_else(|err| {
warn_user!("Couldn't determine number of cores, compiling with a single thread: {err}");
Expand Down
3 changes: 2 additions & 1 deletion crates/uv/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub(crate) use tool::update_shell::update_shell as tool_update_shell;
pub(crate) use tool::upgrade::upgrade as tool_upgrade;
use uv_cache::Cache;
use uv_distribution_types::InstalledMetadata;
use uv_fs::Simplified;
use uv_fs::{Simplified, CWD};
use uv_installer::compile_tree;
use uv_normalize::PackageName;
use uv_python::PythonEnvironment;
Expand Down Expand Up @@ -153,6 +153,7 @@ pub(super) async fn compile_bytecode(
let start = std::time::Instant::now();
let mut files = 0;
for site_packages in venv.site_packages() {
let site_packages = CWD.join(site_packages);
files += compile_tree(&site_packages, venv.python_executable(), cache.root())
.await
.with_context(|| {
Expand Down
Loading