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

dotnet-host-build compilation throwing NullReferenceException #2588

Closed
wjk opened this issue Feb 6, 2017 · 7 comments
Closed

dotnet-host-build compilation throwing NullReferenceException #2588

wjk opened this issue Feb 6, 2017 · 7 comments
Assignees
Labels
Milestone

Comments

@wjk
Copy link
Contributor

wjk commented Feb 6, 2017

Steps to reproduce

  1. Clone my fork of core-setup.
  2. Run build_projects/dotnet-host-build/build.sh --build-driver-only.

Expected behavior

dotnet-host-build should compile.

Actual behavior

When dotnet-host-build is compiled, dotnet compile-csc fails with no output other than "Object reference not set to an instance of an object."

Environment data

This is the output from the copy of dotnet downloaded by the core-setup build script, and not the one I use for all other tasks. This old copy is being used mostly because it still supports project.json, which dotnet-host-build uses.

.NET Command Line Tools (1.0.0-preview3-003886)

Product Information:
 Version:            1.0.0-preview3-003886
 Commit SHA-1 hash:  4b0c2f5ebe

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.12
 OS Platform: Darwin
 RID:         osx.10.11-x64
@wjk
Copy link
Contributor Author

wjk commented Feb 6, 2017

Note: I am using a fork of core-setup because I am integrating it into a (closed-source) script that builds all of .NET Core from source. Some patches were already required to make core-setup interact correctly with this script, and those patches would not be acceptable pushed to upstream. (However, if a patch is suitable to merged with upstream, such as the one in dotnet/core-setup#1458, I will readily open a PR.)

@gkhanna79
Copy link
Member

@jyoungyun Can you please take a look at this as you helped add the support for this switch?

CC @hqueue

@wjk
Copy link
Contributor Author

wjk commented Feb 6, 2017

@gkhanna79 This happens whether or not the --build-driver-only switch is passed; I simply included it because the running of dotnet-host-build is not relevant to the bug I am reporting.

@jyoungyun
Copy link
Contributor

@gkhanna79 I think this issue is not related to --build-driver-only switch.
@wjk According to your error log, the error occured during the dotnet restore process (https://github.com/dotnet/core-setup/blob/master/build_projects/dotnet-host-build/build.sh#L165) , and you should check if your environment is capable of dotnet restore.

@gkhanna79
Copy link
Member

In that case, I have noticed that it happens if you have not done a clean build. If you do "git clean -xdf" and then reattempt the build, you should not see it.

@hqueue
Copy link
Member

hqueue commented Feb 6, 2017

@wjk I also sometimes faced the same exception and use git clean -xdf to resolve the exception. Just make sure backup any unstaged changes before clean.

@wjk
Copy link
Contributor Author

wjk commented Feb 6, 2017

Yep, git clean -xdf solved it for me. I'm going to close this issue now. Thanks!

@wjk wjk closed this as completed Feb 6, 2017
@msftgits msftgits transferred this issue from dotnet/core-setup Jan 30, 2020
@msftgits msftgits added this to the Future milestone Jan 30, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants