Skip to content
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
40 changes: 19 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ anstream = { version = "0.6.15" }
anyhow = { version = "1.0.89" }
arcstr = { version = "1.2.0" }
arrayvec = { version = "0.7.6" }
astral-tokio-tar = { version = "0.5.1" }
astral-tokio-tar = { version = "0.5.2" }
async-channel = { version = "2.3.1" }
async-compression = { version = "0.4.12", features = ["bzip2", "gzip", "xz", "zstd"] }
async-trait = { version = "0.1.82" }
Expand Down
5 changes: 5 additions & 0 deletions crates/uv-extract/src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ pub async fn untar_gz<R: tokio::io::AsyncRead + Unpin>(
)
.set_preserve_mtime(false)
.set_preserve_permissions(false)
.set_allow_external_symlinks(false)
.build();
Ok(untar_in(archive, target.as_ref()).await?)
}
Expand All @@ -255,6 +256,7 @@ pub async fn untar_bz2<R: tokio::io::AsyncRead + Unpin>(
)
.set_preserve_mtime(false)
.set_preserve_permissions(false)
.set_allow_external_symlinks(false)
.build();
Ok(untar_in(archive, target.as_ref()).await?)
}
Expand All @@ -274,6 +276,7 @@ pub async fn untar_zst<R: tokio::io::AsyncRead + Unpin>(
)
.set_preserve_mtime(false)
.set_preserve_permissions(false)
.set_allow_external_symlinks(false)
.build();
Ok(untar_in(archive, target.as_ref()).await?)
}
Expand All @@ -293,6 +296,7 @@ pub async fn untar_xz<R: tokio::io::AsyncRead + Unpin>(
)
.set_preserve_mtime(false)
.set_preserve_permissions(false)
.set_allow_external_symlinks(false)
.build();
untar_in(archive, target.as_ref()).await?;
Ok(())
Expand All @@ -311,6 +315,7 @@ pub async fn untar<R: tokio::io::AsyncRead + Unpin>(
tokio_tar::ArchiveBuilder::new(&mut reader as &mut (dyn tokio::io::AsyncRead + Unpin))
.set_preserve_mtime(false)
.set_preserve_permissions(false)
.set_allow_external_symlinks(false)
.build();
untar_in(archive, target.as_ref()).await?;
Ok(())
Expand Down
4 changes: 3 additions & 1 deletion crates/uv/tests/it/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1754,13 +1754,14 @@ fn build_with_symlink() -> Result<()> {
build-backend = "hatchling.build"
"#})?;
fs_err::os::unix::fs::symlink(
context.temp_dir.child("pyproject.toml.real"),
"pyproject.toml.real",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably reject this when building?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least with the uv build backend we support it by adding the real file instead, it's useful when you have e.g. a shared readme or license file in a monorepo.

context.temp_dir.child("pyproject.toml"),
)?;
context
.temp_dir
.child("src/softlinked/__init__.py")
.touch()?;
fs_err::remove_dir_all(&context.venv)?;
uv_snapshot!(context.filters(), context.build(), @r###"
success: true
exit_code: 0
Expand Down Expand Up @@ -1799,6 +1800,7 @@ fn build_with_hardlink() -> Result<()> {
.temp_dir
.child("src/hardlinked/__init__.py")
.touch()?;
fs_err::remove_dir_all(&context.venv)?;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@konstin -- It looks like in this case, we're including the .venv in the sdist. I'm not sure why. Doesn't hatchling typically filter out .gitignore?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's usually respecting the git configuration, maybe it's something about how we're setting up our tests, possibly because we don't have git repo? I'd have to dig a bit to figure that out.

uv_snapshot!(context.filters(), context.build(), @r###"
success: true
exit_code: 0
Expand Down
Loading