我正在使用 Azure Pipelines在 Windows 中为 Raku(以前称为 Perl 6)构建Rakudo二进制文件。
这是我的azure-pipelines.yml
文件:
jobs:
- job: Windows
pool:
vmImage: 'vs2017-win2016'
steps:
- bash: |
mkdir -p $(Build.SourcesDirectory)/rakudo-win
curl -L https://github.com/rakudo/rakudo/releases/download/2019.07.1/rakudo-2019.07.1.tar.gz | tar xz
mv rakudo-2019.07.1 rakudo
cd rakudo
C:/Strawberry/perl/bin/perl Configure.pl --gen-moar --gen-nqp --backends=moar --prefix=$(Build.SourcesDirectory)/rakudo-win
make
make install
- bash: |
echo "##vso[task.prependpath]$(Build.SourcesDirectory)/rakudo-win/bin"
- bash: |
perl6 -v
管道脚本在文件夹内构建perl6
二进制$(Build.SourcesDirectory)/rakudo-win/bin
文件。perl6.exe
里面确实有$(Build.SourcesDirectory)/rakudo-win/bin
。为了使其可用,我通过在 bash 脚本中添加路径来设置路径。但是当我尝试运行 commandperl6 -v
时,构建在这一步失败。
我在 SO here、here、here中搜索了类似的问题。
我仍然无法解决我的问题。任何帮助如何使perl6
二进制文件可用PATH
?
已编辑
接下来我做的是创建另一个.yml
脚本,如下所示:
jobs:
- job: Windows
pool:
vmImage: 'vs2017-win2016'
steps:
- script: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
- pwsh: |
mkdir -p C:\rakudo-win
Invoke-WebRequest -Uri "https://github.com/rakudo/rakudo/releases/download/2019.07.1/rakudo-2019.07.1.tar.gz" -OutFile "rakudo.tar.gz"
tar -xvf .\rakudo.tar.gz
cd rakudo-2019.07.1
C:\Strawberry\perl\bin\perl Configure.pl --gen-moar --gen-nqp --backends=moar --prefix=C:\rakudo-win
make
make install
- pwsh: |
$oldpath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).path
$newpath = "C:\rakudo-win\bin;$oldpath"
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $newpath
- script: |
SET PATH=C:\rakudo-win\bin;%PATH%
- script: |
perl6 -v
并尝试在 powershell 和 cmdline 中更改 PATH两次。但它仍然会引发以下错误:
'perl6' is not recognized as an internal or external command,
operable program or batch file.
有什么帮助吗?