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

Improvements to Roslyn command-line build experience #23959

Open
3 tasks
KirillOsenkov opened this issue Dec 28, 2017 · 6 comments
Open
3 tasks

Improvements to Roslyn command-line build experience #23959

KirillOsenkov opened this issue Dec 28, 2017 · 6 comments

Comments

@KirillOsenkov
Copy link
Member

  • If one forgot to run Restore.cmd before build, detect that and print an error message: "You need to restore before building"
  • If running Build.cmd from Developer Command Prompt, print a yellow warning: "WARNING: you are building from a Developer Command Prompt. We are bypassing isolated reproducible build and using the MSBuild and SDK from your command prompt instead. This may fail and is unsupported. Use a regular command prompt for a reliable reproducible build."
  • Build.cmd should support a command-line argument to force reproducible build even if in Dev command prompt: -ignoreDevCommandPrompt
@jasonmalinowski
Copy link
Member

@KirillOsenkov Should we break these out into separate issues? One issue means I can't assign to different people or say a commit fixes one issue in particular.

@KirillOsenkov
Copy link
Member Author

I think it's up to @jaredpar - he asked me to file these.

@tannergooding
Copy link
Member

One issue means I can't assign to different people

Can't you multi-assign an issue or PR?

@jaredpar
Copy link
Member

Working on this today. Here is the conclusions I've come to about the builds

If one forgot to run Restore.cmd before build, detect that and print an error message: "You need to restore before building"

This is not possible to do correctly. Or rather doing a restore up to date check is as expensive as doing restore.

If running Build.cmd from Developer Command Prompt, print a yellow warning: "WARNING: you are building from a Developer Command Prompt. We are bypassing isolated reproducible build and using the MSBuild and SDK from your command prompt instead. This may fail and is unsupported. Use a regular command prompt for a reliable reproducible build."

Thought about this a lot over the last two days and decided on the following approach.

  • If the Developer Command Prompt points to a compatible MSBuild instance then use that.
  • else exit build.ps1 with at error saying the command prompt is incompatible.

I decided against using our xcopy MSBuild in this scenario. Due to the massive amount of environment changes in the Developer Command prompt it's hard to guarantee that this will work correctly.

Build.cmd should support a command-line argument to force reproducible build even if in Dev command prompt: -ignoreDevCommandPrompt

In order to implement this I would need to know the full set of environment variables set by the developer command prompt so that they could be unset. That is an ever changing list though hence not really possible. The version I could see doing here is knowing the set of allowed envirnoment variables and resetting the environment to that before building. In that case though we'd need to call it something like -cleanEnvironment.

@KirillOsenkov
Copy link
Member Author

Understood.

If the Developer Command Prompt points to a compatible MSBuild instance then use that.
else exit build.ps1 with at error saying the command prompt is incompatible.

This is good enough.

@jaredpar
Copy link
Member

#24544

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants