gpt4 book ai didi

julia - 如何在 MacOS 上使用 PackageSpec() 进行 Julia 测试?

转载 作者:行者123 更新时间:2023-12-04 10:58:37 25 4
gpt4 key购买 nike

在我的 Travis 构建脚本中,我有以下内容:

- run: julia --color=yes  -e 'using Pkg; Pkg.develop(PackageSpec(path=string(pwd(),"Name_Of_Package"))); Pkg.instantiate()'

但是,正如 here 所述,这不是与平台无关的命令。 .除了 Linux 之外,如何使此命令在 MacOS 上工作?

注意:这是我得到的错误:
 [2] #clone#2(::Nothing, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::String, ::String) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.0/Pkg/src/GitTools.jl:107
9
[3] clone at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.0/Pkg/src/GitTools.jl:88 [inlined]
10
[4] (::getfield(Pkg.Types, Symbol("##26#29")){Bool,Pkg.Types.Context,Array{Pkg.Types.PackageSpec,1}})(::LibGit2.CachedCredentials) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Types.jl:547
11
[5] shred!(::getfield(Pkg.Types, Symbol("##26#29")){Bool,Pkg.Types.Context,Array{Pkg.Types.PackageSpec,1}}, ::LibGit2.CachedCredentials) at ./secretbuffer.jl:184
12
[6] #handle_repos_develop!#25 at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Types.jl:513 [inlined]
13
[7] #handle_repos_develop! at ./none:0 [inlined]
14
[8] #add_or_develop#15(::Symbol, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:57
15
[9] #add_or_develop at ./none:0 [inlined]
16
[10] #add_or_develop#14 at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:34 [inlined]
17
[11] #add_or_develop at ./none:0 [inlined]
18
[12] #add_or_develop#10 at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:32 [inlined]
19
[13] #add_or_develop at ./none:0 [inlined]
20
[14] #develop#21 at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:75 [inlined]
21
[15] develop(::Pkg.Types.PackageSpec) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:75
22
[16] top-level scope at none:0
23
25l25h
24
##[error]Process completed with exit code 1.

编辑:

我更新为使用 joinpath 并仍然得到以下信息:
Run julia --color=yes -e 'using Pkg; Pkg.develop(PackageSpec(path=joinpath(pwd(),"/nameOfPackage"))); Pkg.instantiate()' 2s
24
##[error]Process completed with exit code 1.
1
Run julia --color=yes -e 'using Pkg; Pkg.develop(PackageSpec(path=joinpath(pwd(),"/nameOfPackage"))); Pkg.instantiate()'
4
Cloning git-repo `/nameOfPackage `
5
ERROR: failed to clone from /nameOfPackage, error: GitError(Code:ERROR, Class:Net, unsupported URL protocol)
6
Stacktrace:

最佳答案

path=string(pwd(),"Name_Of_Package")



使用 joinpath 加入路径。

关于julia - 如何在 MacOS 上使用 PackageSpec() 进行 Julia 测试?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58997298/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com