Skip to content

Commit

Permalink
fix: Slightly change how locks are used. (#707)
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj authored Jan 24, 2025
1 parent 36b4831 commit 05efe8e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@

#### 🐞 Fixes

- Fixed an issue where generating all the `~/.proto/bin` files for a tool may result in missing file warnings. Previously, we assumed that the exe locations from the resolved version would apply to all the versions being linked, but this isn't always true and isn't backwards compatible. We've now updated the bin linking to make a WASM API call for _each_ version being linked when locating exes, in hopes that this now finds the correct locations.
- Fixed an issue where generating all the `~/.proto/bin` files for a tool may result in missing file warnings.
- Previously, we assumed that the exe locations from the resolved version would apply to all the versions being linked, but this isn't always true and isn't backwards compatible.
- We've now updated the bin linking to make a WASM API call for _each_ version being linked when locating exes, in hopes that this now finds the correct locations.
- Fixed some directory unlocking issues.

#### 🧩 Plugins

Expand Down
4 changes: 2 additions & 2 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 @@ -57,7 +57,7 @@ starbase_console = { version = "0.4.6", features = [
starbase_sandbox = { version = "0.8.2" }
starbase_shell = { version = "0.6.13", features = ["miette"] }
starbase_styles = { version = "0.4.11" }
starbase_utils = { version = "0.10.0", default-features = false, features = [
starbase_utils = { version = "0.10.1", default-features = false, features = [
"json",
"miette",
"net",
Expand Down
6 changes: 4 additions & 2 deletions crates/core/src/flow/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ impl Tool {

// Only lock the directory and create shims if necessary
if !to_create.is_empty() {
let _lock = fs::lock_directory(&self.proto.store.shims_dir)?;
// let _lock = fs::lock_directory(&self.proto.store.shims_dir)?;
fs::create_dir_all(&self.proto.store.shims_dir)?;

for shim_path in to_create {
self.proto.store.create_shim(&shim_path)?;
Expand Down Expand Up @@ -155,7 +156,8 @@ impl Tool {

// Only lock the directory and create bins if necessary
if !to_create.is_empty() {
let _lock = fs::lock_directory(&self.proto.store.bin_dir)?;
// let _lock = fs::lock_directory(&self.proto.store.bin_dir)?;
fs::create_dir_all(&self.proto.store.bin_dir)?;

for (input_path, output_path) in to_create {
debug!(
Expand Down
3 changes: 2 additions & 1 deletion crates/core/src/proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ impl ProtoEnvironment {
let mut options = config.settings.http.clone();
options.cache_dir = Some(self.store.cache_dir.join("requests"));

let mut loader = PluginLoader::new(&self.store.plugins_dir, &self.store.temp_dir);
let mut loader =
PluginLoader::new(&self.store.plugins_dir, self.store.temp_dir.join("plugins"));
loader.set_client_options(&options);
loader.set_offline_checker(is_offline);

Expand Down

0 comments on commit 05efe8e

Please sign in to comment.