Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make MSVC detection ludicrously robust #34492

Merged
merged 1 commit into from Jul 2, 2016

Conversation

Projects
None yet
5 participants
@retep998
Copy link
Member

retep998 commented Jun 26, 2016

Resurrection of #31158

r? @alexcrichton

}
} else { None }
} else { vec![] }

This comment has been minimized.

@alexcrichton

alexcrichton Jun 27, 2016

Member

Perhaps this could just be:

match (arch, host_arch()) {
    // ... 
}

Can you also add docs as to what's being returned here? It's not clear to me at least what these are vectors of nor what each element of the pair is.

}).and_then(|((mut cmd, host), sub)| {
get_ucrt_dir().map(|dir| {
debug!("Found Universal CRT {:?}", dir);
add_lib(&mut cmd, &dir.join("ucrt").join(sub));

This comment has been minimized.

@alexcrichton

alexcrichton Jun 27, 2016

Member

This is pretty confusing using map and and_then purely for the side effect of calling add_lib, can this switch to using a macro or the original form of control flow?

@retep998 retep998 force-pushed the retep998:please-be-robust-already branch from f460adc to 40a7175 Jun 27, 2016

@retep998

This comment has been minimized.

Copy link
Member Author

retep998 commented Jun 27, 2016

Updated bin_subdir and the comments for it.

Also added a commit with one function converted to use otry!. Can you tell me what you think and whether I should apply that style to the rest of the functions?

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Jun 28, 2016

Yeah the logic has gotten complicated enough in a few places that I'd be fine using that macro for most of the functions, other than that looks good to me!

@retep998 retep998 force-pushed the retep998:please-be-robust-already branch from 19ebd6b to 570fd7a Jun 28, 2016

@retep998

This comment has been minimized.

Copy link
Member Author

retep998 commented Jun 28, 2016

I've converted what I could to using the macro.

Some(val) => val,
None => return None,
})
}

This comment has been minimized.

@kennytm

kennytm Jun 28, 2016

Member

This macro has been written at least twice in librustc under different names 😆

This comment has been minimized.

@retep998

retep998 Jun 28, 2016

Author Member

Clearly this just indicates the need for this sort of macro in libstd. Sure would be nice if the new ? stuff supported Option.

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Jun 28, 2016

Tidy looks like it's failing on travis, but otherwise r=me

Make MSVC detection ludicrously robust
Should fix a few more edge cases

Fixes #31151
Fixes #32159
Fixes #34484
Improves rust-lang-deprecated/rust-packaging#50

Signed-off-by: Peter Atashian <retep998@gmail.com>

@retep998 retep998 force-pushed the retep998:please-be-robust-already branch from 570fd7a to a1b33b4 Jun 28, 2016

@retep998

This comment has been minimized.

Copy link
Member Author

retep998 commented Jun 29, 2016

Travis appears to have passed.

@sfackler

This comment has been minimized.

Copy link
Member

sfackler commented Jun 29, 2016

@bors r=alexcrichton

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jun 29, 2016

📌 Commit a1b33b4 has been approved by alexcrichton

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jul 1, 2016

⌛️ Testing commit a1b33b4 with merge ed33659...

bors added a commit that referenced this pull request Jul 1, 2016

Auto merge of #34492 - retep998:please-be-robust-already, r=alexcrichton
Make MSVC detection ludicrously robust

Resurrection of #31158

r? @alexcrichton
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jul 1, 2016

💔 Test failed - auto-win-msvc-64-opt-rustbuild

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Jul 1, 2016

@bors: retry

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Jul 1, 2016

@bors: retry

  • v

On Fri, Jul 1, 2016 at 5:38 AM, bors notifications@github.com wrote:

💔 Test failed - auto-win-msvc-64-opt-rustbuild
https://buildbot.rust-lang.org/builders/auto-win-msvc-64-opt-rustbuild/builds/1626


You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
#34492 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AAD95Laha4Rqk-EAzk9d8w8-n1iLQqWrks5qRQoogaJpZM4I-q8o
.

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jul 1, 2016

⌛️ Testing commit a1b33b4 with merge 23095ae...

bors added a commit that referenced this pull request Jul 1, 2016

Auto merge of #34492 - retep998:please-be-robust-already, r=alexcrichton
Make MSVC detection ludicrously robust

Resurrection of #31158

r? @alexcrichton
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jul 1, 2016

💔 Test failed - auto-win-msvc-64-opt-rustbuild

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Jul 1, 2016

@bors: retry

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jul 2, 2016

⌛️ Testing commit a1b33b4 with merge 7e07e31...

bors added a commit that referenced this pull request Jul 2, 2016

Auto merge of #34492 - retep998:please-be-robust-already, r=alexcrichton
Make MSVC detection ludicrously robust

Resurrection of #31158

r? @alexcrichton

@bors bors merged commit a1b33b4 into rust-lang:master Jul 2, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.