Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Consistent lockfiles #7264

Merged
3 commits merged into from
Aug 5, 2019
Merged

Consistent lockfiles #7264

3 commits merged into from
Aug 5, 2019

Conversation

deivid-rodriguez
Copy link
Member

@deivid-rodriguez deivid-rodriguez commented Jul 24, 2019

What was the end-user problem that led to this PR?

The problem was that when a Gemfile would specify path sources with paths starting with "./", the generated lockfile would be inconsistent on bundle install and bundle update.

What was your diagnosis of the problem?

My diagnosis was that when running bundle update, the bundle would be unlocked, and bundler would order the path sources according to the path present in the Gemfile ("./aaa" for example). On the other hand, when running bundle install, bundler would read the relative paths from the lockfile, where they are normalized ("aaa" for example).

What is your fix for the problem, implemented in this PR?

My fix is to normalize relative paths when creating the source list, so that "aaa" is always used over "./aaa".

Why did you choose this fix out of the possible options?

I chose this fix because it fixes the problem and it's backwards compatible (as in, it doesn't break any specs that assert for specific lockfiles).

Fixes #7262.

When Gemfile would specify path sources as relative paths starting with
"./", the lockfile would have inconsistent order on `bundle install` and
`bundle update`.
@deivid-rodriguez
Copy link
Member Author

Not sure who to request a review from here, specially since @segiddins is usually very busy. If I don't get any reviews in a few days, I'll go ahead and merge, since this fixes a bug and includes a regression spec.

@SolaWing Did you confirm that this fixes your issue, by the way?

@SolaWing
Copy link

SolaWing commented Aug 1, 2019

@deivid-rodriguez yes, I have patched the code and confirmed it

@deivid-rodriguez
Copy link
Member Author

@bundlerbot r+

ghost pushed a commit that referenced this pull request Aug 4, 2019
7264: Consistent lockfiles r=deivid-rodriguez a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that when a Gemfile would specify path sources with paths starting with "./", the generated lockfile would be inconsistent on `bundle install` and `bundle update`.

### What was your diagnosis of the problem?

My diagnosis was that when running `bundle update`, the bundle would be unlocked, and bundler would order the path sources according to the path present in the Gemfile ("./aaa" for example). On the other hand, when running `bundle install`, bundler would read the relative paths from the lockfile, where they are normalized ("aaa" for example).

### What is your fix for the problem, implemented in this PR?

My fix is to normalize relative paths when creating the source list, so that "aaa" is always used over "./aaa".

### Why did you choose this fix out of the possible options?

I chose this fix because it fixes the problem and it's backwards compatible (as in, it doesn't break any specs that assert for specific lockfiles).

Fixes #7262.

Co-authored-by: David Rodríguez <[email protected]>
@ghost
Copy link

ghost commented Aug 4, 2019

Build failed

@deivid-rodriguez
Copy link
Member Author

I really need to investigate this flaky... 😠

@bundlerbot retry

ghost pushed a commit that referenced this pull request Aug 4, 2019
7264: Consistent lockfiles r=deivid-rodriguez a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that when a Gemfile would specify path sources with paths starting with "./", the generated lockfile would be inconsistent on `bundle install` and `bundle update`.

### What was your diagnosis of the problem?

My diagnosis was that when running `bundle update`, the bundle would be unlocked, and bundler would order the path sources according to the path present in the Gemfile ("./aaa" for example). On the other hand, when running `bundle install`, bundler would read the relative paths from the lockfile, where they are normalized ("aaa" for example).

### What is your fix for the problem, implemented in this PR?

My fix is to normalize relative paths when creating the source list, so that "aaa" is always used over "./aaa".

### Why did you choose this fix out of the possible options?

I chose this fix because it fixes the problem and it's backwards compatible (as in, it doesn't break any specs that assert for specific lockfiles).

Fixes #7262.

Co-authored-by: David Rodríguez <[email protected]>
@ghost
Copy link

ghost commented Aug 4, 2019

Build failed

@deivid-rodriguez
Copy link
Member Author

@bundlerbot retry

@deivid-rodriguez
Copy link
Member Author

@bundlerbot r+

ghost pushed a commit that referenced this pull request Aug 5, 2019
7264: Consistent lockfiles r=deivid-rodriguez a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that when a Gemfile would specify path sources with paths starting with "./", the generated lockfile would be inconsistent on `bundle install` and `bundle update`.

### What was your diagnosis of the problem?

My diagnosis was that when running `bundle update`, the bundle would be unlocked, and bundler would order the path sources according to the path present in the Gemfile ("./aaa" for example). On the other hand, when running `bundle install`, bundler would read the relative paths from the lockfile, where they are normalized ("aaa" for example).

### What is your fix for the problem, implemented in this PR?

My fix is to normalize relative paths when creating the source list, so that "aaa" is always used over "./aaa".

### Why did you choose this fix out of the possible options?

I chose this fix because it fixes the problem and it's backwards compatible (as in, it doesn't break any specs that assert for specific lockfiles).

Fixes #7262.

Co-authored-by: David Rodríguez <[email protected]>
@ghost
Copy link

ghost commented Aug 5, 2019

Build succeeded

@ghost ghost merged commit c7532ce into master Aug 5, 2019
@ghost ghost deleted the consistent_lockfiles branch August 5, 2019 23:07
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

update's lock file order should same with install
2 participants