Skip to content

Conversation

@dagood
Copy link
Member

@dagood dagood commented Oct 16, 2017

Fixes #239

@dagood dagood requested a review from weshaggard October 16, 2017 18:01
build.sh Outdated
"$SCRIPT_ROOT/init-tools.sh"
(
# init-tools.sh isn't compatible with these flags. Unset them in this subshell.
set +euo pipefail
Copy link
Member Author

Choose a reason for hiding this comment

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

CI failed and I had to add this workaround, still look ok @weshaggard?

Copy link
Member

Choose a reason for hiding this comment

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

Can we fix init-tools so it works with this option? What was the failure?

Copy link
Member Author

Choose a reason for hiding this comment

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

The first error is:

init-tools.sh: line 9: __BUILDTOOLS_SOURCE: unbound variable

I'll give fixing it a try (waiting for a different build to finish).

Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we should just remove the "u" option in the root script.

Copy link
Member Author

Choose a reason for hiding this comment

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

Personally, I really like how -u forces scripts to be clear if they expect the variable to be set at that point in time, and I think it's worth keeping. I haven't done a ton of work with it yet, though.

build.sh Outdated
export NUGET_PACKAGES="$SCRIPT_ROOT/packages/"

"$SCRIPT_ROOT/init-tools.sh"
. "$SCRIPT_ROOT/init-tools.sh"
Copy link
Member

Choose a reason for hiding this comment

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

Does it work to use the actual source "$DIR/common/_prettyprint.sh" command? That seems more obvious to me when reading the code than trying to see that little ..

Copy link
Member Author

Choose a reason for hiding this comment

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

source isn't part of POSIX, so . is in theory more portable.

Copy link
Member

@eerhardt eerhardt Oct 16, 2017

Choose a reason for hiding this comment

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

We have #!/bin/bash at the top...

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, more real than I thought: dash apparently doesn't support source. https://stackoverflow.com/a/13702876 https://wiki.ubuntu.com/DashAsBinSh#source

Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member Author

@dagood dagood Oct 16, 2017

Choose a reason for hiding this comment

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

(Whoops, didn't refresh and missed your comment.)

You're right that we do have that direct dependency on bash right now, and it would be ok to use source. A while back someone pointed out some bashisms in BuildTools and I think CoreFX. I've pointed out obvious ones like [[ since then (in PRs), but I don't know if there's a higher-level drive to avoid a bash dependency.

Copy link
Member

Choose a reason for hiding this comment

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

Right now we are definitely dependent on bash.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll go ahead and change it to source then--the readability concern also came up in the CoreFX PR. It's not like this would be hard to spot/fix if we do want to work on non-bash.

@dagood dagood merged commit a680f36 into dotnet:dev/release/2.0 Oct 17, 2017
@dagood dagood deleted the source-init-tools branch October 17, 2017 00:26
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.

3 participants