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

General improvements to Linux story #23507

Merged
merged 5 commits into from
Dec 7, 2017
Merged

Conversation

khyperia
Copy link
Contributor

  • Delete files that are no longer being used
    • build/linux folder
    • build/unix folder
    • build/scripts/unzip.sh
  • auto-install dotnet if missing or wrong version (allows user to walk up and ./build.sh --restore --build --test on a clean machine, or a machine with 2.0.x installed globally)
  • move cibuild.sh to build/scripts/cibuild.sh (to match cibuild.ps1), and significantly simplify it
  • add shorthands to --restore, --build, and --test
  • fix bug where build_configuration wasn't propogated to tests.sh

Let me know if this should target features/compiler instead of master

@khyperia
Copy link
Contributor Author

khyperia commented Dec 4, 2017

@jaredpar Something I'd specifically like feedback on is the "auto-install dotnet" point. Automatically doing stuff seems iffy - I can put it behind a flag (--install-dotnet? But that's not really a good name). There's a lot of use cases here, and balancing them all is difficult:

  • New contributor walking up to the repo and trying to build. This should be as simple as possible, and hopefully using minimal flags.
  • Existing developer doing an inner dev loop - fine control perhaps should be allowed (e.g. not auto-installing dotnet if missing/wrong version, for whatever reason)
  • CI build - verbosity of parameters here isn't a problem, but perhaps not to the point of providing a --ci flag that subtly changes behavior of things.

Actually, one helpful point that could help the "new contributor" case is when no arguments are given (just ./build.sh), either error with a message giving a how-to-build command ("Error blah no args blah: build with ./build.sh --install-dotnet --restore --build --test), or default to sane arguments and keep going (perhaps printing the "virtual arguments" used).

Edit: Oh, I could also gate it inside the --restore flag. That seems pretty reasonable...

Edit 2: Also important to note is that ./obtain_dotnet.sh doesn't necessarily install the CLI. If dotnet is already in the PATH, AND is the correct version (the one specified in tools.props), then we just return immediately.

@jaredpar
Copy link
Member

jaredpar commented Dec 4, 2017

New contributor walking up to the repo and trying to build. This should be as simple as possible, and hopefully using minimal flags

This is the experience I give the most weight too. I should be able to go up to any repo clone it and build with 0 hassle.

Something I'd specifically like feedback on is the "auto-install dotnet" point. Automatically doing stuff seems iffy

The experience you're advocating here is essentially the experience we have on Windows today. I had similar misgivings when I set that experience up but so far the feedback's been overwhelmingly positive. Until we get strong feedback otherwise I think we should continue with the approach of "just make it work".

@@ -55,15 +54,15 @@ do
build_configuration=Release
shift 1
;;
--restore)
--restore|-r)
Copy link
Member

Choose a reason for hiding this comment

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

Did you consider allowing -restore as well? That would mean there was at least one argument form that worked across windows and linux (build.cmd and build.sh respectively). Alternatively we could try and make the -- syntax work in Windows as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah 🙁. This is a very ugh-inducing catch-22. The very, very standard Linux (unix?) convention is that single-dash arguments can be combined (something that I should implement here) - for example, ./build.sh -rbt == ./build.sh -r -b -t). So theoretically, ./build.sh -restore is equivalent to ./build.sh -r -e -s -t -o -r -e, which is... not what one wants. However, the Windows convention here is single-dash, which as you say, hopefully should be identical across platforms... 😢

The best thing would probably be to just say screw linux convention and make -arg==--arg, which makes me a sad panda, but oh well.

Copy link
Member

Choose a reason for hiding this comment

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

The best thing would probably be to just say screw linux convention and make -arg==--arg, which makes me a sad panda, but oh well.

Hmm. Lets keep it as is for now. We can revisit later when we discuss other unification aspects.

build.sh Outdated
if [[ "${stop_vbcscompiler}" == true ]]
then
echo "Stopping VBCSCompiler"
dotnet "${bootstrap_path}"/bincore/VBCSCompiler.dll -shutdown
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't the path being used here be different depending on whether ${use_bootstrap} is set?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah... although finding VBCSCompiler.dll is pretty difficult when ${use_bootstrap} is false. Because stop_vbcscompiler is a pretty niche feature, I'm tempted to just make it be an error to (${use_bootstrap} == false && ${stop_vbcscompiler} == true)

Copy link
Member

Choose a reason for hiding this comment

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

Hmm. Hadn't thought about that. It actually needs to be first class supported because it's critical to having a sane infrastructure. All the cases we stop the server in our infra are cases where others may need to as well.

Lets work with the CLI team separately from this PR to figure that out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's moments like these where I really wish the architecture of the server was per-msbuild-invocation and had a strict parent/child relationship and msbuild was responsible for cleaning up the server... oh well, I can see the argument for the perf bonus on multiple repeated invocations on small solutions.

mozroots --import --machine --sync
echo "Y" | certmgr -ssl https://go.microsoft.com
echo "Y" | certmgr -ssl https://nugetgallery.blob.core.windows.net
echo "Y" | certmgr -ssl https://nuget.org
Copy link
Member

Choose a reason for hiding this comment

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

Oh wow ... this takes me back. 😄

build.sh Outdated
echo "Stopping VBCSCompiler"
dotnet "${bootstrap_path}"/bincore/VBCSCompiler.dll -shutdown
else
echo "--stop-vbcscompiler requires --use-bootstrap. Ignoring and continuing anyway..."
Copy link
Member

Choose a reason for hiding this comment

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

Prefer we exit here. The caller asked for --stop-vbcscompiler and we were unable to fulfill their wishes. We should exit to make sure they're aware of it.

@khyperia khyperia closed this Dec 6, 2017
@khyperia khyperia reopened this Dec 6, 2017
@khyperia khyperia merged commit 2c1d648 into dotnet:master Dec 7, 2017
@khyperia khyperia deleted the linux_stuff branch December 7, 2017 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants