Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesChen0823 committed Sep 9, 2023
2 parents fc78d2f + 2f0c709 commit 4bef001
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 8 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ that were not yet released.

_Unreleased_

- The order of git submodule initialization was changed. This improves the
automatic author detection when `includeIf` is used. #443

- The linux shim installer code will no longer fall back to symlinks when a
hardlink cannot be created. This is done as a symlinked shim will not
ever function correctly on Linux. This prevents the shim executables like
`python` to instead act as if they are `rye`. The fallback behavior is now
to copy the executable instead. #441

- The installer now detects `fish` and will spit out additional instructions
for configuring the shell.

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ folder that contains a non Rye managed project.

As such the answer is a clear **yes!**

## Wheels Appar to be Missing Files
## Wheels Appear to be Missing Files

You might be encountering missing files in wheels when running `rye build` and you
are using hatchling. The reason for this is that `rye build` uses
Expand Down
22 changes: 16 additions & 6 deletions rye/src/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,23 @@ fn do_update(output: CommandOutput, venv_dir: &Path, app_dir: &Path) -> Result<(
pub fn update_core_shims(shims: &Path, this: &Path) -> Result<(), Error> {
#[cfg(unix)]
{
let use_softlinks = !cfg!(target_os = "linux");
fs::remove_file(shims.join("python")).ok();
if use_softlinks || fs::hard_link(this, shims.join("python")).is_err() {
// on linux we cannot symlink at all, as this will misreport. We will try to do
// hardlinks and if that fails, we fall back to copying the entire file over. This
// for instance is needed when the rye executable is placed on a different volume
// than ~/.rye/shims
if cfg!(target_os = "linux") {
if fs::hard_link(this, shims.join("python")).is_err() {
fs::copy(this, shims.join("python")).context("tried to copy python shim")?;
}
fs::remove_file(shims.join("python3")).ok();
if fs::hard_link(this, shims.join("python3")).is_err() {
fs::copy(this, shims.join("python2")).context("tried to copy python3 shim")?;
}

// on other unices we always use symlinks
} else {
fs::remove_file(shims.join("python")).ok();
symlink_file(this, shims.join("python")).context("tried to symlink python shim")?;
}
fs::remove_file(shims.join("python3")).ok();
if use_softlinks || fs::hard_link(this, shims.join("python3")).is_err() {
symlink_file(this, shims.join("python3")).context("tried to symlink python3 shim")?;
}
}
Expand Down
1 change: 0 additions & 1 deletion rye/src/cli/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,6 @@ pub fn execute(cmd: Args) -> Result<(), Error> {
}
}


echo!(
"{} Initialized project in {}",
style("success:").green(),
Expand Down

0 comments on commit 4bef001

Please sign in to comment.