添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

When I run the prepare-workspace script, I'm getting an error

bash prepare-workspace.sh
: invalid option name line 2: set: pipefail

This is this spatial diagnose output

spatial diagnose
A newer version of spatial is available. Run 'spatial update' to get the latest version.
For more information, see https://docs.improbable.io/reference/latest/shared/release-policy#spatial-cli-releases
Microsoft Visual C++ (MSVC) Redistributable
[SUCCESS]

  • Found version 14.13.26020.
    Network access
    [SUCCESS]
  • All checks passed
  • Installed at 'C:\Users\Admin.improbable\spatial\spatial.exe'.
    Project's SpatialOS SDK
    [SUCCESS]
  • Found version 13.0.1.
    Spatial CLI SDK plugin
    [SUCCESS]
  • Installed at 'C:\Users\Admin\AppData\Local.improbable\bin\plugins\sdk\13.0.1\sdk.exe'.
  • Found version 13.0.1.
    Spatial CLI tool
    [SUCCESS]
  • Installed at 'C:\Users\Admin.improbable\spatial\spatial.exe'.
  • Found version 20180611.121722.
  • Results
    All diagnostic checks passed successfully.
    'spatial diagnose' succeeded (4.8s)

    GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)
    License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html

    This is free software; you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.

    Shot in the dark, but are the shell scripts checked out with CRLF line endings? I've been trolled by this in the past. Afaik bash implementations expect LF line endings.

    If you've checked out the repository using Powershell or some Git GUI tool, its likely that they are CRLF.

    k, better but still fails further on.

    D:\spatial\UnityGDK>bash ./prepare-workspace.sh
    ++ dirname ./prepare-workspace.sh

  • cd ./
  • cp hooks/pre-push .git/hooks/
  • ci/codegen.sh
    ++ dirname ci/codegen.sh
  • cd ci/../
  • source ci/includes/pinned-tools.sh
    ++ dotnet --version
    ci/includes/pinned-tools.sh: line 23: dotnet: command not found
  • D:\spatial\UnityGDK>dotnet

    Usage: dotnet [options]
    Usage: dotnet [path-to-application]

    Options:
    -h|--help Display help.
    --info Display .NET Core information.
    --list-sdks Display the installed SDKs.
    --list-runtimes Display the installed runtimes.

    path-to-application:
    The path to an application .dll file to execute.

    As you can see I have dotnet installed, and visual studio 2017.

    Ah! Judging on the GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu) output, it looks like the version of bash on your path is the Windows Subsystem for Linux.

    That explains why the script cannot find dotnet, as WSL will have its own path.

    As a short term workaround: you could try running something like c:\Program Files\Git\bin\bash.exe prepare-workspace.sh (or wherever you have Git installed) which should produce the correct output.

    We should soon have ps1 scripts available for Windows users to avoid this sort of issue.

    +++ uname -s
    ++ [[ MINGW64_NT-10.0 == \D\a\r\w\i\n ]]
    ++ export 'MSBuildSDKsPath=C:\Program Files/dotnet/sdk/2.1.302/Sdks'
    ++ MSBuildSDKsPath='C:\Program Files/dotnet/sdk/2.1.302/Sdks'
  • source ci/includes/profiling.sh
  • markStartOfBlock 'Generating code'
  • echo -e '\x23\x23teamcity[blockOpened name='''Generating code''']'
    ##teamcity[blockOpened name='Generating code']
  • dotnet run -p code_generator/GdkCodeGenerator/GdkCodeGenerator.csproj -- --schema-path=schema --schema-path=schema_standard_library --json-dir=workers/unity/Temp/ImprobableJson --native-output-dir=workers/unity/Assets/Generated/Source --network-types-output-dir=workers/unity/Assets/Improbable.Generated.NetworkTypes/Generated
  • markEndOfBlock 'Generating code'
  • echo -e '\x23\x23teamcity[blockClosed name='''Generating code''']'
    ##teamcity[blockClosed name='Generating code']
  •