JuliaLang / Pkg.jl

Pkg - Package manager for the Julia programming language
https://pkgdocs.julialang.org
Other
621 stars 261 forks source link

Folder with Project misinterpreted as being a package #3762

Open jakobnissen opened 8 months ago

jakobnissen commented 8 months ago

I was running a scientific project in a folder with the following layout:

Binbench
├── Manifest.toml
├── Project.toml
├── README.md
├── src
│  ├── 20231130.jl
│  └── main.jl
[ more files and folders ... ]

When installing packages into my project, I got:

ERROR: expected the file `src/Binbench.jl` to exist for package `Binbench` at `/home/jakni/Documents/binbench`

When adding src/Binbench.jl, I got the even more obscure:

WARNING: --output requested, but no modules defined during run
lld: error: cannot open /home/jakni/.julia/compiled/v1.10/Binbench/jl_HRxkzA: No such file or directory
  ◑ Binbench

This is not a package, it's just a scientific project with an associated Project.toml. My issues are twofold:

  1. Why does Julia insist this has to be formatted like a package? Why can't I just have a bunch of scripts in a directory with a Project file?
  2. The error message is not great.

I didn't use to have this problem on earlier versions of Julia IIRC.

KristofferC commented 8 months ago

I think it believes it is a package if it has a name entry in the Project file.

jakobnissen commented 8 months ago

Ah, I see. Yes indeed I manually typed in the name field, and removing that resolves the issue. Perhaps the error message could be improved.