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

InteractiveUtils.jl: fixes issue where subtypes resolves bindings and causes deprecation warnings #56306

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

dgleich
Copy link
Contributor

@dgleich dgleich commented Oct 23, 2024

The current version of subtypes will throw deprecation errors even if no one is using the deprecated bindings.

A similar bug was fixed in Aqua.jl - https://github.com/JuliaTesting/Aqua.jl/pull/89/files

See discussion here:

This adds the isbindingresolved test to the subtypes function to avoid throwing deprecation warnings. It also adds a test to check that this doesn't happen.


On the current master branch (before the fix), the added test shows:

WARNING: using deprecated binding InternalModule.MyOldType in OuterModule.
, use MyType instead.
Subtypes and deprecations: Test Failed at /home/dgleich/devextern/julia/usr/share/julia/stdlib/v1.12/Test/src/Test.jl:932
  Expression: isempty(stderr_content)
   Evaluated: isempty("WARNING: using deprecated binding InternalModule.MyOldType in OuterModule.\n, use MyType instead.\n")
Test Summary:             | Fail  Total  Time
Subtypes and deprecations |    1      1  2.8s
ERROR: LoadError: Some tests did not pass: 0 passed, 1 failed, 0 errored, 0 broken.
in expression starting at /home/dgleich/devextern/julia/stdlib/InteractiveUtils/test/runtests.jl:841
ERROR: Package InteractiveUtils errored during testing

Using the results of this pull request:

@test_nowarn subtypes(Integer);

passes without error. The other tests pass too.

@vtjnash vtjnash merged commit 20f933a into JuliaLang:master Oct 24, 2024
5 of 7 checks passed
@ViralBShah ViralBShah added backport 1.10 Change should be backported to the 1.10 release backport 1.11 Change should be backported to release-1.11 labels Oct 24, 2024
@ViralBShah
Copy link
Member

@KristofferC I think we need this on both 1.11 and 1.10 - but you would know better.

@ViralBShah
Copy link
Member

Is it possible to get this one into 1.10.6?

@dgleich
Copy link
Contributor Author

dgleich commented Oct 28, 2024

I don't know how to add things to the backports, but if anyone can give me a few instructions ... (i.e. is this a pull request to a specific back ports branch?) I'm happy to help !

@KristofferC KristofferC mentioned this pull request Oct 29, 2024
47 tasks
KristofferC pushed a commit that referenced this pull request Oct 30, 2024
… causes deprecation warnings (#56306)

The current version of `subtypes` will throw deprecation errors even if
no one is using the deprecated bindings.

A similar bug was fixed in Aqua.jl -
https://github.com/JuliaTesting/Aqua.jl/pull/89/files

See discussion here:

- JuliaIO/ImageMagick.jl#235 (for identifying
the problem)
- simonster/Reexport.jl#42 (for pointing to
the issue in Aqua.jl)
- https://github.com/JuliaTesting/Aqua.jl/pull/89/files (for the fix in
Aqua.jl)

This adds the `isbindingresolved` test to the `subtypes` function to
avoid throwing deprecation warnings. It also adds a test to check that
this doesn't happen.

---

On the current master branch (before the fix), the added test shows:

```
WARNING: using deprecated binding InternalModule.MyOldType in OuterModule.
, use MyType instead.
Subtypes and deprecations: Test Failed at /home/dgleich/devextern/julia/usr/share/julia/stdlib/v1.12/Test/src/Test.jl:932
  Expression: isempty(stderr_content)
   Evaluated: isempty("WARNING: using deprecated binding InternalModule.MyOldType in OuterModule.\n, use MyType instead.\n")
Test Summary:             | Fail  Total  Time
Subtypes and deprecations |    1      1  2.8s
ERROR: LoadError: Some tests did not pass: 0 passed, 1 failed, 0 errored, 0 broken.
in expression starting at /home/dgleich/devextern/julia/stdlib/InteractiveUtils/test/runtests.jl:841
ERROR: Package InteractiveUtils errored during testing
```

---

Using the results of this pull request:

```
@test_nowarn subtypes(Integer);
```

passes without error. The other tests pass too.

(cherry picked from commit 20f933a)
@KristofferC
Copy link
Member

Enough to add the label (which is already done).

KristofferC pushed a commit that referenced this pull request Oct 30, 2024
… causes deprecation warnings (#56306)

The current version of `subtypes` will throw deprecation errors even if
no one is using the deprecated bindings.

A similar bug was fixed in Aqua.jl -
https://github.com/JuliaTesting/Aqua.jl/pull/89/files

See discussion here:

- JuliaIO/ImageMagick.jl#235 (for identifying
the problem)
- simonster/Reexport.jl#42 (for pointing to
the issue in Aqua.jl)
- https://github.com/JuliaTesting/Aqua.jl/pull/89/files (for the fix in
Aqua.jl)

This adds the `isbindingresolved` test to the `subtypes` function to
avoid throwing deprecation warnings. It also adds a test to check that
this doesn't happen.

---

On the current master branch (before the fix), the added test shows:

```
WARNING: using deprecated binding InternalModule.MyOldType in OuterModule.
, use MyType instead.
Subtypes and deprecations: Test Failed at /home/dgleich/devextern/julia/usr/share/julia/stdlib/v1.12/Test/src/Test.jl:932
  Expression: isempty(stderr_content)
   Evaluated: isempty("WARNING: using deprecated binding InternalModule.MyOldType in OuterModule.\n, use MyType instead.\n")
Test Summary:             | Fail  Total  Time
Subtypes and deprecations |    1      1  2.8s
ERROR: LoadError: Some tests did not pass: 0 passed, 1 failed, 0 errored, 0 broken.
in expression starting at /home/dgleich/devextern/julia/stdlib/InteractiveUtils/test/runtests.jl:841
ERROR: Package InteractiveUtils errored during testing
```

---

Using the results of this pull request:

```
@test_nowarn subtypes(Integer);
```

passes without error. The other tests pass too.

(cherry picked from commit 20f933a)
KristofferC added a commit that referenced this pull request Nov 12, 2024
Backported PRs:
- [x] #50832 <!-- Subtype: bug fix for bounds with deeper covariant var
-->
- [x] #51782 <!-- Fix remove-addrspaces pass in the presence of globals
with addrspaces -->
- [x] #55720 <!-- Fix `pkgdir` for extensions -->
- [x] #55773 <!-- Add compat entry for `Base.donotdelete` -->
- [x] #55886 <!-- irrationals: restrict assume effects annotations to
known types -->
- [x] #55867 <!-- update `hash` doc string: `widen` not required any
more -->
- [x] #56148 <!-- Make loading work when stdlib deps are missing in the
manifest -->
- [x] #55870 <!-- fix infinite recursion in `promote_type` for
`Irrational` -->
- [x] #56252 <!-- REPL: fix brace detection when ' is used for transpose
-->
- [x] #56264 <!-- inference: fix inference error from constructing
invalid `TypeVar` -->
- [x] #56276 <!-- move time_imports and trace_* macros to Base but
remain owned by InteractiveUtils -->
- [x] #56254 <!-- REPL: don't complete str and cmd macros when the input
matches the internal name like `r_` to `r"` -->
- [x] #56280 <!-- Fix trampoline warning on x86 as well -->
- [x] #56304 <!-- typeintersect: more fastpath to skip intersect under
circular env -->
- [x] #56306 <!-- InteractiveUtils.jl: fixes issue where subtypes
resolves bindings and causes deprecation warnings -->
- [x] #42080 <!-- recommend explicit `using Foo: Foo, ...` in package
code (was: "using considered harmful") -->
- [x] #56441 <!-- Profile: mention `kill -s SIGUSR1 julia_pid` for Linux
-->
- [x] #56511 <!-- The `info` in LAPACK calls should be a Ref instead of
a Ptr -->
- [x] #55052 <!-- Fix `(l/r)mul!` with `Diagonal`/`Bidiagonal` -->
- [x] #52694 <!-- Reinstate similar for AbstractQ for backward
compatibility -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.10 Change should be backported to the 1.10 release backport 1.11 Change should be backported to release-1.11
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants