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

Build fails if there are spaces in path name #691

Open
Zajn opened this issue Dec 2, 2016 · 6 comments
Open

Build fails if there are spaces in path name #691

Zajn opened this issue Dec 2, 2016 · 6 comments

Comments

@Zajn
Copy link

Zajn commented Dec 2, 2016

I've encountered several issues trying to build omnisharp on Windows 10 x64, but now have gotten stuck. The furthest I've gotten into the build.cake script is Restore, which fails as such:

Executing task: Restore
Restoring packages in C:\<workspace_dir>\omnisharp-roslyn....
Failed to load the dll from [], HRESULT: 0x80070057

An error occurred when executing task 'Restore'.
Error: Failed to restore projects under working directory.

Here was the list of the issues I encountered:

I ran the build.ps1 install script in PowerShell, and get an error very similar to #484 where the script complains that the cake executable is not available.

However, upon further investigation with -verbose, it appears that there is something wonky with the NuGet command to fetch the tools. This is the error I see:

VERBOSE: Using experimental version of Roslyn.
VERBOSE: Restoring tools from NuGet...
VERBOSE: install: invalid arguments.
usage: NuGet install packageId|pathToPackagesConfig [options]

Installs a package using the specified sources. If no sources are specified, all sources defined in the NuGet configuration file are used. If the configuration file specifies no sources

 Specify the id and optionally the version of the package to install. If a path to a packages.config file is used instead of an id, all the packages it contains are installed.

I got past this by running:

nuget install .\scripts\packages.config -ExcludeVersion -OutputDirectory .\.tools\

but then the build.cake script complains about dotnet not being available in the .dotnet directory.

Symlinking the system dotnet to this directory seems to fix that. I did try modifying the build.json to use the System dotnet instead, but then script will complain that it can't find the dotnet executable for some reason.

Once I symlinked dotnet under .dotnet, I got to the error in the Restore task.

Any idea where I might be going wrong? I think I have all the correct dependencies installed. I don't have a lot of experience with development on Windows, so I might missing something easy.

@DustinCampbell
Copy link
Contributor

Hey @Zajn: I just noticed this issue. Is still a problem for you?

@DustinCampbell
Copy link
Contributor

On Windows 10, I would expect that running build.cmd from the OmniSharp root directory would do the trick.

@Zajn
Copy link
Author

Zajn commented Apr 28, 2017

It's not the same error, but I still cannot build immediately after cloning.

I pulled the latest, and ran build.cmd from the root directory like you said.
Here was the output:

Preparing to run build script...
Running build script...
Analyzing build script...
Processing build script...
Installing addins...
Downloading and installing Roslyn (experimental)...
Installing packages (using https://packages.nuget.org/api/v2)...
Downloading package Microsoft.CodeAnalysis.Scripting (1.0.0-rc2)...
Downloading package Microsoft.CodeAnalysis.CSharp (1.0.0-rc2)...
Copying files...
Copying Microsoft.CodeAnalysis.dll...
Copying Microsoft.CodeAnalysis.Scripting.CSharp.dll...
Copying Microsoft.CodeAnalysis.Scripting.dll...
Copying Microsoft.CodeAnalysis.Desktop.dll...
Copying Microsoft.CodeAnalysis.CSharp.dll...
Copying Microsoft.CodeAnalysis.CSharp.Desktop.dll...
Copying System.Collections.Immutable.dll...
Copying System.Reflection.Metadata.dll...
Deleting installation directory...
Compiling build script...

========================================
Cleanup
========================================
Executing task: Cleanup
Creating directory C:/Users/Zach Jones/workspace/OmnisharpRoslyn/artifacts
Creating directory C:/Users/Zach Jones/workspace/OmnisharpRoslyn/artifacts/logs
Creating directory C:/Users/Zach Jones/workspace/OmnisharpRoslyn/artifacts/package
Creating directory C:/Users/Zach Jones/workspace/OmnisharpRoslyn/artifacts/scripts
Finished executing task: Cleanup

========================================
BuildEnvironment
========================================
Executing task: BuildEnvironment
Creating directory C:/Users/Zach Jones/workspace/OmnisharpRoslyn/.dotnet
Creating directory C:/Users/Zach Jones/workspace/OmnisharpRoslyn/.dotnet-legacy
An error occurred when executing task 'BuildEnvironment'.
Error: Failed to run 'dotnet --info'

Running dotnet --info outside the context of this script seems to work:

.NET Command Line Tools (1.0.0-preview4-004174)

Product Information:
 Version:            1.0.0-preview4-004174
 Commit SHA-1 hash:  ecfd970045

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.14393
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\1.0.0-preview4-004174

@DustinCampbell
Copy link
Contributor

DustinCampbell commented Apr 28, 2017

Try running .dotnet/dotnet --info from the omnisharp-roslyn directory

@DustinCampbell
Copy link
Contributor

Ah -- I'm betting the problem is with spaces in the path name.

@DustinCampbell DustinCampbell changed the title Unable to build on Windows 10 x64: HRESULT 0x80070057 Build fails if there are spaces in path name Apr 28, 2017
@Zajn
Copy link
Author

Zajn commented Apr 29, 2017

Hah, looks like you're right!
Running from C:\workspace\OmnisharpRoslyn yields a successful build.

If I have time in the next few days, I could try and create a PR to address that.

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

2 participants