Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Julia does not reject incompatible package #51088

Closed
GHTaarn opened this issue Aug 28, 2023 · 1 comment
Closed

Julia does not reject incompatible package #51088

GHTaarn opened this issue Aug 28, 2023 · 1 comment

Comments

@GHTaarn
Copy link
Contributor

GHTaarn commented Aug 28, 2023

I created a simple package and in the compat section of Project.toml I restricted the compatibility with julia = "1.0 - 1.7". I then tried to add this package to a newly activated temp environment from Julia 1.9.3, but this did not produce an error or warning. The following is a snapshot of the REPL:

(@v1.9) pkg> activate --temp
  Activating new project at `/tmp/jl_ftvi0S`

(jl_ftvi0S) pkg> add https://github.com/GHTaarn/VerExperiment.jl
  Installing known registries into `~/.julia`
     Cloning git-repo `https://github.com/GHTaarn/VerExperiment.jl`
    Updating git-repo `https://github.com/GHTaarn/VerExperiment.jl`
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
    Updating `/tmp/jl_ftvi0S/Project.toml`
  [2296e2b5] + VerExperiment v0.1.1 `https://github.com/GHTaarn/VerExperiment.jl#master`
    Updating `/tmp/jl_ftvi0S/Manifest.toml`
  [2296e2b5] + VerExperiment v0.1.1 `https://github.com/GHTaarn/VerExperiment.jl#master`
Precompiling project...
  1 dependency successfully precompiled in 0 seconds

julia> using VerExperiment

julia> VerExperiment.greet()
Hello World!
julia>

My understanding is that an error should have resulted. I made a post about this on discourse at https://discourse.julialang.org/t/package-compatibility-constraints/103217 and none of the responses convinced me that this is the intended behaviour of Julia.

The entire source code of the package is available at https://github.com/GHTaarn/VerExperiment.jl

I am using Ubuntu 22.04 on x86_64 with Julia installed with juliaup.

@IanButterworth
Copy link
Member

Very recently fixed on master JuliaLang/Pkg.jl#3526

(@v1.11) pkg> activate --temp
  Activating new project at `/var/folders/1z/jf841bdj73bdj3vk7kc7f_3w0000gn/T/jl_NSRZsm`

(jl_NSRZsm) pkg> add https://github.com/GHTaarn/VerExperiment.jl
     Cloning git-repo `https://github.com/GHTaarn/VerExperiment.jl`
    Updating git-repo `https://github.com/GHTaarn/VerExperiment.jl`
   Resolving package versions...
ERROR: julia version requirement from Project.toml's compat section not satisfied for package `VerExperiment [2296e2b5]` at `/Users/ian/.julia/packages/VerExperiment/mXJ8V`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants