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

module http_util is not available in elixir 1.15.2 #12808

Closed
kivra-mikgra opened this issue Jul 18, 2023 · 4 comments
Closed

module http_util is not available in elixir 1.15.2 #12808

kivra-mikgra opened this issue Jul 18, 2023 · 4 comments

Comments

@kivra-mikgra
Copy link

Elixir and Erlang/OTP versions

Erlang/OTP 26 [erts-14.0.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit] [dtrace]

Elixir 1.15.2 (compiled with Erlang/OTP 26)

Operating system

MacOS Ventura v13.4.1

Current behavior

I tried to upgrade my project to the new elixir version and ran into an issue with a dependency Sobelow, which uses :http_utils.timestamp internally, throwing ** (UndefinedFunctionError) function :http_util.timestamp/0 is undefined (module :http_util is not available). I reproduced the behaviour (that the module does not exist in the new version) in a minimal example below:

mix new test_elixir_version
iex -S mix
Compiling 1 file (.ex)
Generated test_elixir_version app
Erlang/OTP 26 [erts-14.0.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit] [dtrace]

Interactive Elixir (1.15.2) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> :http_util.timestamp
** (UndefinedFunctionError) function :http_util.timestamp/0 is undefined (module :http_util is not available)
:http_util.timestamp()

Expected behavior

When running the same code in the project but with elixir 1.14.2, the module / function is available.

iex -S mix
Erlang/OTP 26 [erts-14.0.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit] [dtrace]

Compiling 1 file (.ex)
Generated test_elixir_version app
Interactive Elixir (1.14.2) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> :http_util.timestamp
1689667954729

@josevalim
Copy link
Member

Sobelow needs to declare :inets as a dependency, which is where that module is defined. Although in their case, it is probably best to replace :http_util.timestamp by System.os_time(:milliseconds).

@josevalim
Copy link
Member

This issue also seems to address this: nccgroup/sobelow#143 - but yeah, there is probably no need to load http_util for this. :)

@kivra-mikgra
Copy link
Author

Missed that they had a pull request for that in the works. Thanks!

@houllette
Copy link

PR is merged in, new version of Sobelow is getting pushed out to Hex.pm here in a few - sorry for the delay and thanks for the patience!

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

No branches or pull requests

3 participants