Okay, here is what I did, step by step:
$ brew uninstall julia
$ brew install julia
$ julia
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.6.2 (2021-07-14)
_/ |\__'_|_|_|\__'_| | Built by Homebrew (v1.6.2_1)
|__/ |
julia> import Pkg
julia> Pkg.add("PkgTemplates")
julia> Pkg.add("CSV")
julia> Pkg.add("DataFrames")
julia> using PkgTemplates
julia> t = Template(;user="connormeaton")
Template:
authors: ["Connor and contributors"]
dir: "~/.julia/dev"
host: "github.com"
julia: v"1.0.0"
user: "connormeaton"
plugins:
CompatHelper:
file: "~/.julia/packages/PkgTemplates/2jJdD/templates/github/workflows/CompatHelper.yml"
destination: "CompatHelper.yml"
cron: "0 0 * * *"
Git:
ignore: String[]
name: nothing
email: nothing
branch: nothing
ssh: false
jl: true
manifest: false
gpgsign: false
License:
path: "~/.julia/packages/PkgTemplates/2jJdD/templates/licenses/MIT"
destination: "LICENSE"
ProjectFile:
version: v"0.1.0"
Readme:
file: "~/.julia/packages/PkgTemplates/2jJdD/templates/README.md"
destination: "README.md"
inline_badges: false
badge_order: DataType[Documenter{GitHubActions}, Documenter{GitLabCI}, Documenter{TravisCI}, GitHubActions, GitLabCI, TravisCI, AppVeyor, DroneCI, CirrusCI, Codecov, Coveralls, BlueStyleBadge, ColPracBadge]
badge_off: DataType[]
SrcDir:
file: "~/.julia/packages/PkgTemplates/2jJdD/templates/src/module.jl"
TagBot:
file: "~/.julia/packages/PkgTemplates/2jJdD/templates/github/workflows/TagBot.yml"
destination: "TagBot.yml"
trigger: "JuliaTagBot"
token: Secret("GITHUB_TOKEN")
ssh: Secret("DOCUMENTER_KEY")
ssh_password: nothing
changelog: nothing
changelog_ignore: nothing
gpg: nothing
gpg_password: nothing
registry: nothing
branches: nothing
dispatch: nothing
dispatch_delay: nothing
Tests:
file: "~/.julia/packages/PkgTemplates/2jJdD/templates/test/runtests.jl"
project: false
julia> t("MyTestPkg")
[ Info: Running prehooks
[ Info: Running hooks
Activating environment at `~/.julia/dev/MyTestPkg/Project.toml`
Updating registry at `~/.julia/registries/General`
No Changes to `~/.julia/dev/MyTestPkg/Project.toml`
No Changes to `~/.julia/dev/MyTestPkg/Manifest.toml`
Precompiling project...
1 dependency successfully precompiled in 1 seconds
Activating environment at `~/.julia/environments/v1.6/Project.toml`
[ Info: Running posthooks
[ Info: New package is at /Users/connor/.julia/dev/MyTestPkg
(@v1.6) pkg> activate .julia\\dev\\MyTestPkg
Activating environment at `~/connor/juliaRppgPacakge/.julia\\dev\\MyTestPkg/Project.toml`
(.julia\\dev\\MyTestPkg) pkg> add DataFrames,CSV
Resolving package versions...
No Changes to `~/connor/juliaRppgPacakge/.julia\\dev\\MyTestPkg/Project.toml`
Updating `~/connor/juliaRppgPacakge/.julia\\dev\\MyTestPkg/Manifest.toml`
[692b3bcd] - JLLWrappers v1.3.0
[21216c6a] - Preferences v1.2.2
[8e850b90] - libblastrampoline_jll v3.0.4+0
[0dad84c5] ~ ArgTools v1.1.1 ⇒
[f43a241f] ~ Downloads v1.4.0 ⇒
[b27032c2] ~ LibCURL v0.6.2 ⇒
[ca575930] ~ NetworkOptions v1.2.0 ⇒
[44cfe95a] ~ Pkg v1.6.0 ⇒
[fa267f1f] ~ TOML v1.0.0 ⇒
[a4e569a6] ~ Tar v1.9.1 ⇒
[deac9b47] ~ LibCURL_jll v7.73.0+4 ⇒
[29816b5a] ~ LibSSH2_jll v1.9.1+2 ⇒
[c8ffd9c3] ~ MbedTLS_jll v2.24.0+2 ⇒
[14a3606d] ~ MozillaCACerts_jll v2020.7.22 ⇒
[83775a58] ~ Zlib_jll v1.2.12+1 ⇒
[8e850ede] ~ nghttp2_jll v1.41.0+1 ⇒
[3f19e933] ~ p7zip_jll v16.2.1+1 ⇒
This all worked well. Here I come across my first error:
julia> using MyTestPkg
ERROR: ArgumentError: Package MyTestPkg not found in current path:
- Run `import Pkg; Pkg.add("MyTestPkg")` to install the MyTestPkg package.
So I thought moving to the right path would help …
julia> pwd()
"/Users/connor/Testing"
julia> cd("../../.julia/dev/MyTestPkg/")
julia> pwd()
"/Users/connor/.julia/dev/MyTestPkg"
julia> using MyTestPkg
ERROR: ArgumentError: Package MyTestPkg not found in current path:
- Run `import Pkg; Pkg.add("MyTestPkg")` to install the MyTestPkg package.
Stacktrace:
[1] require(into::Module, mod::Symbol)
@ Base ./loading.jl:893
As you can see, I still get an error on this command. Alas, I just moved on. Maybe this is the cause of the issue?
julia> Pkg.add("PackageCompiler")
Resolving package versions...
Updating `~/connor/juliaRppgPacakge/.julia\\dev\\MyTestPkg/Project.toml`
[9b87118b] + PackageCompiler v1.2.7
Updating `~/connor/juliaRppgPacakge/.julia\\dev\\MyTestPkg/Manifest.toml`
[9b87118b] + PackageCompiler v1.2.7
Precompiling project...
1 dependency successfully precompiled in 1 seconds (23 already precompiled)
julia> using PackageCompiler
julia> create_app("../MyTestPkg", "MyTestPkgApp";force=true)
┌ Warning: it is not recommended to create an app without a preexisting manifest
â”” @ PackageCompiler ~/.julia/packages/PackageCompiler/BjVzm/src/PackageCompiler.jl:642
0 dependencies successfully precompiled in 0 seconds
1 dependency errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the package
[ Info: PackageCompiler: creating base system image (incremental=false)...
error during bootstrap:
LoadError(at "/usr/local/Cellar/julia/1.6.2_1/share/julia/base/compiler/compiler.jl" line 3: LoadError(at "compiler/bootstrap.jl" line 8: InterruptException()))
jl_typeinf_end at /usr/local/Cellar/julia/1.6.2_1/lib/julia/libjulia-internal.1.6.dylib (unknown line)
unknown function (ip: 0x1116f93ff)
jl_apply_generic at /usr/local/Cellar/julia/1.6.2_1/lib/julia/libjulia-internal.1.6.dylib (unknown line)
unknown function (ip: 0x1116f440e)
jl_toplevel_eval_flex at /usr/local/Cellar/julia/1.6.2_1/lib/julia/libjulia-internal.1.6.dylib (unknown line)
jl_parse_eval_all at /usr/local/Cellar/julia/1.6.2_1/lib/julia/libjulia-internal.1.6.dylib (unknown line)
jl_load_ at /usr/local/Cellar/julia/1.6.2_1/lib/julia/libjulia-internal.1.6.dylib (unknown line)
unknown function (ip: 0x1116c4a54)
jl_apply_generic at /usr/local/Cellar/julia/1.6.2_1/lib/julia/libjulia-internal.1.6.dylib (unknown line)
unknown function (ip: 0x1116c4925)
jl_apply_generic at /usr/local/Cellar/julia/1.6.2_1/lib/julia/libjulia-internal.1.6.dylib (unknown line)
do_call at /usr/local/Cellar/julia/1.6.2_1/lib/julia/libjulia-internal.1.6.dylib (unknown line)
eval_body at /usr/local/Cellar/julia/1.6.2_1/lib/julia/libjulia-internal.1.6.dylib (unknown line)
jl_interpret_toplevel_thunk at /usr/local/Cellar/julia/1.6.2_1/lib/julia/libjulia-internal.1.6.dylib (unknown line)
top-level scope at /usr/local/Cellar/julia/1.6.2_1/share/julia/base/compiler/compiler.jl:125
jl_toplevel_eval_flex at /usr/local/Cellar/julia/1.6.2_1/lib/julia/libjulia-internal.1.6.dylib (unknown line)
jl_toplevel_eval_flex at /usr/local/Cellar/julia/1.6.2_1/lib/julia/libjulia-internal.1.6.dylib (unknown line)
jl_toplevel_eval_in at /usr/local/Cellar/julia/1.6.2_1/lib/julia/libjulia-internal.1.6.dylib (unknown line)
unknown function (ip: 0x1116c3b94)
jl_apply_generic at /usr/local/Cellar/julia/1.6.2_1/lib/julia/libjulia-internal.1.6.dylib (unknown line)
do_call at /usr/local/Cellar/julia/1.6.2_1/lib/julia/libjulia-internal.1.6.dylib (unknown line)
eval_body at /usr/local/Cellar/julia/1.6.2_1/lib/julia/libjulia-internal.1.6.dylib (unknown line)
jl_interpret_toplevel_thunk at /usr/local/Cellar/julia/1.6.2_1/lib/julia/libjulia-internal.1.6.dylib (unknown line)
top-level scope at /usr/local/Cellar/julia/1.6.2_1/share/julia/base/compiler/compiler.jl:3
jl_toplevel_eval_flex at /usr/local/Cellar/julia/1.6.2_1/lib/julia/libjulia-internal.1.6.dylib (unknown line)
jl_parse_eval_all at /usr/local/Cellar/julia/1.6.2_1/lib/julia/libjulia-internal.1.6.dylib (unknown line)
jl_load_ at /usr/local/Cellar/julia/1.6.2_1/lib/julia/libjulia-internal.1.6.dylib (unknown line)
jl_load at /usr/local/Cellar/julia/1.6.2_1/lib/julia/libjulia-internal.1.6.dylib (unknown line)
exec_program at /usr/local/Cellar/julia/1.6.2_1/lib/julia/libjulia-internal.1.6.dylib (unknown line)
true_main at /usr/local/Cellar/julia/1.6.2_1/lib/julia/libjulia-internal.1.6.dylib (unknown line)
repl_entrypoint at /usr/local/Cellar/julia/1.6.2_1/lib/julia/libjulia-internal.1.6.dylib (unknown line)
[ Info: PackageCompiler: creating system image object file, this might take a while...
0 dependencies successfully precompiled in 0 seconds
1 dependency errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the package
Precompiling project...
âś— MyTestPkg
0 dependencies successfully precompiled in 3 seconds
ERROR: The following 1 dependency failed to precompile:
MyTestPkg [b1693a64-f60c-4f39-94a4-785f7c40246b]
Failed to precompile MyTestPkg [b1693a64-f60c-4f39-94a4-785f7c40246b] to /Users/connor/.julia/compiled/v1.6/MyTestPkg/jl_qKnc4T.
ERROR: LoadError: syntax: incomplete: "module" at /Users/connor/.julia/dev/MyTestPkg/src/MyTestPkg.jl:1 requires end
Stacktrace:
[1] top-level scope
@ ~/.julia/dev/MyTestPkg/src/MyTestPkg.jl:1
[2] include_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String)
@ Base /private/var/folders/rg/r1_lqdvn6rj3b3_m2292vmc80000gn/T/jl_4OUU9Y/tmp_sys.so:-1
[3] _include(mapexpr::Function, mod::Module, _path::String)
@ Base /private/var/folders/rg/r1_lqdvn6rj3b3_m2292vmc80000gn/T/jl_4OUU9Y/tmp_sys.so:-1
[4] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
@ Base /private/var/folders/rg/r1_lqdvn6rj3b3_m2292vmc80000gn/T/jl_4OUU9Y/tmp_sys.so:-1
[5] top-level scope
@ none:1
[6] eval
@ ./boot.jl:360 [inlined]
in expression starting at /Users/connor/.julia/dev/MyTestPkg/src/MyTestPkg.jl:1
Stacktrace:
[1] pkgerror(msg::String)
@ Pkg.Types /usr/local/Cellar/julia/1.6.2_1/share/julia/stdlib/v1.6/Pkg/src/Types.jl:55
[2] precompile(ctx::Pkg.Types.Context; internal_call::Bool, strict::Bool, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Pkg.API /usr/local/Cellar/julia/1.6.2_1/share/julia/stdlib/v1.6/Pkg/src/API.jl:1265
[3] #precompile#196
@ /usr/local/Cellar/julia/1.6.2_1/share/julia/stdlib/v1.6/Pkg/src/API.jl:919 [inlined]
[4] top-level scope
@ none:1
[5] exec_options(opts::Base.JLOptions)
@ Base /private/var/folders/rg/r1_lqdvn6rj3b3_m2292vmc80000gn/T/jl_4OUU9Y/tmp_sys.so:-1
[6] _start()
@ Base /private/var/folders/rg/r1_lqdvn6rj3b3_m2292vmc80000gn/T/jl_4OUU9Y/tmp_sys.so:-1
ERROR: failed process: Process(`/usr/local/Cellar/julia/1.6.2_1/bin/julia --color=yes --startup-file=no --sysimage=/var/folders/rg/r1_lqdvn6rj3b3_m2292vmc80000gn/T/jl_4OUU9Y/tmp_sys.so --project=/Users/connor/.julia/dev/MyTestPkg -e 'using Pkg; Pkg.precompile(; strict=true)'`, ProcessExited(1)) [1]
Stacktrace:
[1] pipeline_error
@ ./process.jl:525 [inlined]
[2] run(::Cmd; wait::Bool)
@ Base ./process.jl:440
[3] run
@ ./process.jl:438 [inlined]
[4] do_ensurecompiled
@ ~/.julia/packages/PackageCompiler/BjVzm/src/PackageCompiler.jl:199 [inlined]
[5] create_sysimg_object_file(object_file::String, packages::Vector{String}; project::String, base_sysimage::String, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, cpu_target::String, script::Nothing, isapp::Bool)
@ PackageCompiler ~/.julia/packages/PackageCompiler/BjVzm/src/PackageCompiler.jl:270
[6] create_sysimage(packages::Symbol; sysimage_path::String, project::String, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, incremental::Bool, filter_stdlibs::Bool, replace_default::Bool, cpu_target::String, script::Nothing, base_sysimage::String, isapp::Bool)
@ PackageCompiler ~/.julia/packages/PackageCompiler/BjVzm/src/PackageCompiler.jl:452
[7] (::PackageCompiler.var"#9#10"{Vector{String}, Vector{String}, Bool, Bool, String, String, String, String, String})()
@ PackageCompiler ~/.julia/packages/PackageCompiler/BjVzm/src/PackageCompiler.jl:682
[8] cd(f::PackageCompiler.var"#9#10"{Vector{String}, Vector{String}, Bool, Bool, String, String, String, String, String}, dir::String)
@ Base.Filesystem ./file.jl:106
[9] create_app(package_dir::String, app_dir::String; app_name::Nothing, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, incremental::Bool, filter_stdlibs::Bool, audit::Bool, force::Bool, c_driver_program::String, cpu_target::String)
@ PackageCompiler ~/.julia/packages/PackageCompiler/BjVzm/src/PackageCompiler.jl:671
[10] top-level scope
@ REPL[33]:1
I ran Pkg.precompile()
and tried again, and no difference.
Also, my MyTestPkg.jl
code is the same as what you provided.
I think I’ve followed, or tried to follow every step you take from a fresh julia install onwards. Let me know if I am missing anything. Hopefully we can get this package to work and accept file path input. Thank you!