Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Changing dev workflow scripts to use the Run Command Tool #10231

Merged
merged 5 commits into from
Jul 28, 2016

Conversation

maririos
Copy link
Member

This PR updates the dev workflow scripts that we have, to use the Run Command Tool.
As PR dotnet/coreclr#6400 states, "This is a first step to move towards consuming the run tool to synchronize the dev workflow across the dotnet repos."

For more information about the dev workflow please read here.
For information about the Run Command Tool, please read here.

We are working on updating the documentation of CoreFx too.

cc: @Priya91 @weshaggard @jaredpar @markwilkie @Chrisboh @joperezr @sokket @TyOverby

FYI: Because the changes involve updating the netci.groovy script, the CI builds are expected to fail. Once we merge the changes, we can validate the change. I did tests locally in a Windows and an Ubuntu machine.

@maririos
Copy link
Member Author

@dotnet-bot test ci please

@mmitche
Copy link
Member

mmitche commented Jul 22, 2016

@maririos We can do some testing of this by running the generated jobs from @dotnet-bot test ci please.

@mmitche
Copy link
Member

mmitche commented Jul 22, 2016

@dotnet-bot test ci please

@@ -0,0 +1,2 @@
@call %~dp0run.cmd build-managed -nodoReuse -binclashWindows %*
Copy link
Member

Choose a reason for hiding this comment

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

Do we have documentation for the build-managed command? The docs only refer to build to my knowledge at this point.

Copy link
Member Author

Choose a reason for hiding this comment

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

build-native and build-managed are a detail of implementation in this repo.
For the common dev workflow Build is the task that encapsulates this work and that is why Build is calling them.

If all of our .NET Core repos need this behavior, then we can update the dev workflow, but I don't think this is true.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe I'm misunderstanding how this is used. I saw the call to run build-managed and assumed it was now a top level supported command. I completely agree it's an implementation detail that shouldn't be exposed.

But that also makes me not understand this sample. If it's an implementation detail why is it going through run.cmd at all? Why not skip the middle man and go directly to a build-managed command. What value is run.cmd providing here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Each command needs one tool to run. Build-managed and Build native used different tools so we divided them into different commands.
The developers are not going to call run build-native but will call build.cm/sh which is what we want.
If they want to be more specific and do special things for only one type of build, they have the possibility.

@maririos
Copy link
Member Author

@mmitche just explained to me how to test it, so I'm doing it right now. I'll update the PR later with more information about the tests

@maririos
Copy link
Member Author

@dotnet-bot test ci please

echo /s - Deletes the untracked files under src directory (git clean src -xdf).
echo /e - Kills and/or stops the processes that are still running, for example VBCSCompiler.exe
echo /all - Combines all of the above.
echo -b - Deletes the binary output directory. It uses the Run Command Tool to do it.
Copy link
Member

Choose a reason for hiding this comment

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

Can the usage come from run? Then only "all" needs to be handled by this script. The usage I think should just say what it is doing and there isn't any need for mentioning the run command tool.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure! I'll change it

Copy link
Member

Choose a reason for hiding this comment

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

Unless I'm missing something it doesn't look like the usage is coming from run, it is still in the 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.

I was thinking on how to show the -all option to the user in a way that will fit with the format the run tool uses for help, but the only way that I see is to leave it in the script, but not print it. So no ones is calling the Usage function anymore.

@maririos
Copy link
Member Author

@dotnet-bot test ci please

fi

lowerI="$(echo $1 | awk '{print tolower($0)}')"
case $lowerI in
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason this cannot be in dir.props and not in the sh script? I would hope all we would need in the sh script is a placeholder for the OS to pass to msbuild.

Copy link
Member

Choose a reason for hiding this comment

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

If we do it in dir.props then these properties would be overridable, so if we decide to do it there, then we should just make sure that the values are correct.

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 also want it to be in dir.props. There is a section where we are already defining TestNugetRuntimeId but as @joperezr pointed out, when calling this variables from the scripts they overwrite all the places were we have them. Just putting them in dir.props is not the same behavior.
I haven't test it to see if it would be a breaking change. But for a next iteration we could do it.

@weshaggard
Copy link
Member

This is looking good. Lets make sure we don't break the builds and get it merged.

@maririos
Copy link
Member Author

@dotnet-bot test ci please

@maririos
Copy link
Member Author

After testing the changes in the CI, only one job is failing: linuxarmemulator_cross.
I started a thread with Sjsujin and @leemgs to understand why this is happening and how we can fix it.

@leemgs
Copy link

leemgs commented Jul 26, 2016

@sjsujin Take a look at this, Please.

@sjsinju
Copy link
Contributor

sjsinju commented Jul 27, 2016

@dotnet-bot test Innerloop Linux ARM Emulator Release Cross Build

@leemgs
Copy link

leemgs commented Jul 27, 2016

@dotnet-bot test Innerloop Linux ARM Emulator Release Cross Build

Is it correct? Until now, I think that I have to use "@dotnet-bot test ... please" as follows.

@maririos
Copy link
Member Author

Is it correct? Until now, I think that I have to use "@dotnet-bot test ... please" as follows.

Yes. If you go to the details of that test you'll see the error and the log I've sent you on email.
We can actually trust in this CI run, because I'm not changing how we call the arm32-ci-script.sh in the netci.groovy.
I'm applying the changes directly in the arm32-ci-script.sh script

@maririos
Copy link
Member Author

@dotnet-bot test ci please

@maririos
Copy link
Member Author

I updated the documentation of CoreFx on how to build and how to use the dev workflow scripts with PR #10231

@sjsinju
Copy link
Contributor

sjsinju commented Jul 28, 2016

@dotnet-bot test Innerloop Linux ARM Emulator Release Cross Build

@sjsinju
Copy link
Contributor

sjsinju commented Jul 28, 2016

/CC @prajwal-aithal

ROOTFS_DIR="$__ARMRootfsMountPath" CPLUS_INCLUDE_PATH=$LINUX_ARM_INCPATH CXXFLAGS=$LINUX_ARM_CXXFLAGS ./build.sh $__buildArch clean cross $__verboseFlag $__buildConfig skiptests
ROOTFS_DIR="$__ARMRootfsMountPath" CPLUS_INCLUDE_PATH=$LINUX_ARM_INCPATH CXXFLAGS=$LINUX_ARM_CXXFLAGS
BUILD_NATIVE="$ROOTFS_DIR" ./build-native.sh -buildArch=$__buildArch -$__buildConfig -- cross $__verboseFlag
BUILD_MANAGED="$ROOTFS_DIR" ./build-managed.sh -buildArch=$__buildArch -$__buildConfig -skipTests

Copy link
Contributor

@sjsinju sjsinju Jul 28, 2016

Choose a reason for hiding this comment

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

In this case, ROOTFS_DIR is empty in 'build-native.sh' and 'build-managed.sh'
So I suggest below each lines. From ROOTFS_DIR to verboseFlag have to the one line.

ROOTFS_DIR="$__ARMRootfsMountPath" CPLUS_INCLUDE_PATH=$LINUX_ARM_INCPATH CXXFLAGS=$LINUX_ARM_CXXFLAGS BUILD_NATIVE="$ROOTFS_DIR" ./build-native.sh -buildArch=$__buildArch -$__buildConfig -- cross clean $__verboseFlag

ROOTFS_DIR="$__ARMRootfsMountPath" CPLUS_INCLUDE_PATH=$LINUX_ARM_INCPATH CXXFLAGS=$LINUX_ARM_CXXFLAGS BUILD_MANAGED="$ROOTFS_DIR" ./build-managed.sh -buildArch=$__buildArch -$__buildConfig -skipTests

And I wonder where 'BUILD_NATIVE' and 'BUILD_MANAGED' are used in. I cannot find the place using those values.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed with PR #10407 . Thanks @sjsinju

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.

10 participants