Skip to content

Conversation

@g-arjones
Copy link
Contributor

To ensure that a lock file always exists and is up-to-date in the prefix, BundlerManager#install must be called during all update operations.

Fixes #419

@g-arjones g-arjones requested a review from doudou August 22, 2025 00:38
@g-arjones
Copy link
Contributor Author

@doudou I'm also intrigued by run_package_managers_without_packages.

As far as I can see, resolve_and_partition_osdep_packages will never return an empty list unless the manager explicitly requires it (by implementing Manager#call_while_empty?), in which case manager.install should be called regardless of run_package_managers_without_packages. Do you remember the rationale for having this keyword argument?

@g-arjones g-arjones force-pushed the always_call_bundler_manager_install branch from 0301754 to 92e8a32 Compare August 22, 2025 13:40
@g-arjones
Copy link
Contributor Author

@doudou Ping

options = []
binstubs_path = File.join(root_dir, "bin")
if updated || !install_only || !File.file?("#{gemfile_path}.lock")
if updated || !File.file?("#{gemfile_path}.lock")
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand this one

"install_only" means "do not update". We are already checking if the gemfile got updated and run unconditionally, I don't understand why !install_only was removed.

Copy link
Contributor Author

@g-arjones g-arjones Nov 12, 2025

Choose a reason for hiding this comment

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

Hmm... I'm gonna have to go back to it. It's been a while (should have put a comment)

def install(
osdep_packages, all: nil, install_only: false,
run_package_managers_without_packages: false, **options
run_package_managers_without_packages: true, **options
Copy link
Member

Choose a reason for hiding this comment

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

I agree. It feels like this is duplicated with the call_while_empty? flag. I'm guessing it was two attempts at fixing the same issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wanna remove it or keep it for backwards compatibility (although this is a "very" private API...)?

Copy link
Member

Choose a reason for hiding this comment

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

I'm good with removing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bundle lockfile is not generated on prefix on workspaces with no gem osdeps

3 participants