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

Fix erlang-ls build error with Erlang/OTP ≥ 25 #188182

Merged
merged 2 commits into from
Aug 26, 2022

Conversation

ehamberg
Copy link
Contributor

Description of changes

The redbug dependency fails to build on Erlang/OTP 25 due to some deprecation warnings and having warnings_as_errors in rebar.conf:

❯ nix-shell -p beam.packages.erlangR25.erlang-ls
these 7 derivations will be built:
  /nix/store/2fw11viy3fvfacrvqbgxp2wbaz6wb9vf-zipper-1.0.1.drv
  /nix/store/7zrhs55q64lmp2rfvnn4gk9rvr6d2m7a-redbug-2.0.6.drv
  /nix/store/cli9ynskxk6i901ja5kq0j2k4nw57sg6-tdiff-0.1.2.drv
  /nix/store/d0i24cl1802sq85n2jnk6xwyy1x7afl4-uuid-2.0.1.drv
  /nix/store/xz3v4b45d69g2vvza93g94abxalqxhlf-elvis_core-1.3.1.drv
  /nix/store/y73by0pmbgh9jvbfk9jiar8a1gksrl3z-yamerl-git.drv
  /nix/store/5rwk21ndgb1xj1j8pvsfcwsbxyfnlv4m-erlang-ls-0.35.0.drv
building '/nix/store/7zrhs55q64lmp2rfvnn4gk9rvr6d2m7a-redbug-2.0.6.drv'...
unpacking sources
unpacking source archive /nix/store/zsykc4z3q807j3ap5ss9q5qlam9cbcv4-hex-source-redbug-2.0.6
source root is hex-source-redbug-2.0.6
patching sources
updateAutotoolsGnuConfigScriptsPhase
configuring
no configure script, doing nothing
building
===> Errors loading plugin rebar3_hex. Run rebar3 with DEBUG=1 set to see errors.
===> Errors loading plugin rebar3_hex. Run rebar3 with DEBUG=1 set to see errors.
===> Analyzing applications...
===> Compiling redbug
===> Compiling src/redbug_targ.erl failed
src/redbug_targ.erl:545:17: ct_slave:start/2 is deprecated and will be removed in OTP 27; use ?CT_PEER(), or the 'peer' module instead
src/redbug_targ.erl:553:17: ct_slave:start/2 is deprecated and will be removed in OTP 27; use ?CT_PEER(), or the 'peer' module instead
src/redbug_targ.erl:561:39: ct_slave:stop/1 is deprecated and will be removed in OTP 27; use ?CT_PEER(), or the 'peer' module instead

error: builder for '/nix/store/7zrhs55q64lmp2rfvnn4gk9rvr6d2m7a-redbug-2.0.6.drv' failed with exit code 1;
       last 10 log lines:
       > building
       > ===> Errors loading plugin rebar3_hex. Run rebar3 with DEBUG=1 set to see errors.
       > ===> Errors loading plugin rebar3_hex. Run rebar3 with DEBUG=1 set to see errors.
       > ===> Analyzing applications...
       > ===> Compiling redbug
       > ===> Compiling src/redbug_targ.erl failed
       > src/redbug_targ.erl:545:17: ct_slave:start/2 is deprecated and will be removed in OTP 27; use ?CT_PEER(), or the 'peer' module instead
       > src/redbug_targ.erl:553:17: ct_slave:start/2 is deprecated and will be removed in OTP 27; use ?CT_PEER(), or the 'peer' module instead
       > src/redbug_targ.erl:561:39: ct_slave:stop/1 is deprecated and will be removed in OTP 27; use ?CT_PEER(), or the 'peer' module instead
       >
       For full logs, run 'nix log /nix/store/7zrhs55q64lmp2rfvnn4gk9rvr6d2m7a-redbug-2.0.6.drv'.
error: 1 dependencies of derivation '/nix/store/5rwk21ndgb1xj1j8pvsfcwsbxyfnlv4m-erlang-ls-0.35.0.drv' failed to build

This patches the rebar.conf file to remove the warnings_as_errors option.

(Is this an acceptable way to fix this?)

(There is a redbug issue at massemanet/redbug#18 so hopefully this will be fixed upstream eventually.)

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@ehamberg ehamberg mentioned this pull request Aug 25, 2022
13 tasks
@superherointj
Copy link
Contributor

Result of nixpkgs-review pr 188182 run on x86_64-linux 1

1 package built:
  • erlang-ls

@superherointj superherointj merged commit db3af3d into NixOS:master Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants