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

establish immutable source for RUST_CONFIGURE_ARGS #69894

Merged
merged 4 commits into from
Mar 24, 2020

Conversation

vtbassmatt
Copy link
Contributor

fixes #68671

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @pietroalbini (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 10, 2020
@rust-highfive

This comment has been minimized.

@nellshamrell
Copy link
Contributor

Sweet! Currently we only run Linux tests on PRs, but I will fork this and run the Windows and Mac tests on it as well. Will update on the results here by EOD or early tomorrow :)

@@ -85,7 +85,7 @@ jobs:

dist-x86_64-apple:
SCRIPT: ./x.py dist
RUST_CONFIGURE_ARGS: --target=aarch64-apple-ios,x86_64-apple-ios --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc
IINTIAL_RUST_CONFIGURE_ARGS: --target=aarch64-apple-ios,x86_64-apple-ios --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc
Copy link
Contributor

@nellshamrell nellshamrell Mar 12, 2020

Choose a reason for hiding this comment

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

Suggested change
IINTIAL_RUST_CONFIGURE_ARGS: --target=aarch64-apple-ios,x86_64-apple-ios --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc
INITIAL_RUST_CONFIGURE_ARGS: --target=aarch64-apple-ios,x86_64-apple-ios --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc

@vtbassmatt
Copy link
Contributor Author

Well that's embarrassing. I'm not near a capable machine right now but will get that fixed.

@vtbassmatt
Copy link
Contributor Author

Fixed it.

@pietroalbini
Copy link
Member

r? @nellshamrell

@nellshamrell
Copy link
Contributor

Testing in #69963

bors added a commit that referenced this pull request Mar 14, 2020
Test azure vars

Please disregard this pull request - I am opening it only to run all builds on #69894
bors added a commit that referenced this pull request Mar 16, 2020
Test azure vars

Please disregard this pull request - I am opening it only to run all builds on #69894
@nellshamrell
Copy link
Contributor

All Windows builds pass! Running on the mac builds and then I think this is good to go!

@nellshamrell
Copy link
Contributor

nellshamrell commented Mar 18, 2020

Unfortunately, MacOS builds are currently failing for this change https://dev.azure.com/rust-lang/rust/_build/results?buildId=23626&view=logs&j=1c64c3ff-4c37-56fe-a133-b407354bbfbf&t=4e7ef4c5-557b-57f3-58fa-8cf5d2629d9a&l=16

The reason is MacOS ships with Bash 3.163.1. This line:

src/ci/scripts/setup-environment.sh

if [[ -v INITIAL_RUST_CONFIGURE_ARGS ]]; then

Will only work with Bash 4.2 and above (when the ability to define [[ -v FOO ]] was added).

@vtbassmatt
Copy link
Contributor Author

Ah, dang it, of course.

Can anyone suggest a Bash 3-compatible way of testing for the existence of a variable? Everything else I found failed under set -u.

@nellshamrell
Copy link
Contributor

I think I've got one here

if [[ -z "${INITIAL_RUST_CONFIGURE_ARGS+x}" ]]; then
    INITIAL_RUST_CONFIG=""
    echo "No initial Rust Configure Args set"
else
    INITIAL_RUST_CONFIG="${INITIAL_RUST_CONFIGURE_ARGS}"
    ciCommandSetEnv RUST_CONFIGURE_ARGS "${INITIAL_RUST_CONFIG}"
fi

Working on testing it

bors added a commit that referenced this pull request Mar 18, 2020
Test azure vars

Please disregard this pull request - I am opening it only to run all builds on #69894
Comment on lines 11 to 16
# Since matrix variables are readonly in Azure Pipelines, we take
# INITIAL_RUST_CONFIGURE_ARGS and establish RUST_CONFIGURE_ARGS
# which downstream steps can alter
if [[ -v INITIAL_RUST_CONFIGURE_ARGS ]]; then
ciCommandSetEnv RUST_CONFIGURE_ARGS "${INITIAL_RUST_CONFIGURE_ARGS}"
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# Since matrix variables are readonly in Azure Pipelines, we take
# INITIAL_RUST_CONFIGURE_ARGS and establish RUST_CONFIGURE_ARGS
# which downstream steps can alter
if [[ -v INITIAL_RUST_CONFIGURE_ARGS ]]; then
ciCommandSetEnv RUST_CONFIGURE_ARGS "${INITIAL_RUST_CONFIGURE_ARGS}"
fi
# Since matrix variables are readonly in Azure Pipelines, we take
# INITIAL_RUST_CONFIGURE_ARGS and establish RUST_CONFIGURE_ARGS
# which downstream steps can alter
# MacOS ships with Bash 3.16, which means we cannot use
# if [[ -v FOO ]], as that was introduced in Bash 4.2
if [[ -z "${INITIAL_RUST_CONFIGURE_ARGS+x}" ]]; then
INITIAL_RUST_CONFIG=""
echo "No initial Rust Configure Args set"
else
INITIAL_RUST_CONFIG="${INITIAL_RUST_CONFIGURE_ARGS}"
ciCommandSetEnv RUST_CONFIGURE_ARGS "${INITIAL_RUST_CONFIG}"
fi

Copy link
Contributor

Choose a reason for hiding this comment

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

Confirmed through testing that this block works with Linux, Mac, and Windows builds!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Shamelessly stealing now!

@nellshamrell
Copy link
Contributor

This is good to merge!

@nellshamrell
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Mar 23, 2020

📌 Commit 6db4bb6 has been approved by nellshamrell

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 23, 2020
@bors
Copy link
Contributor

bors commented Mar 24, 2020

⌛ Testing commit 6db4bb6 with merge 4e44081dc4b4d9560beb1e6e8c6d2aee267a8255...

@Centril
Copy link
Contributor

Centril commented Mar 24, 2020

@bors retry yielding to r0llup

@bors
Copy link
Contributor

bors commented Mar 24, 2020

⌛ Testing commit 6db4bb6 with merge 1add455...

@bors
Copy link
Contributor

bors commented Mar 24, 2020

☀️ Test successful - checks-azure
Approved by: nellshamrell
Pushing 1add455 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 24, 2020
@bors bors merged commit 1add455 into rust-lang:master Mar 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

readonly variable warning on Azure pipelines
6 participants