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

[pull] master from erlang:master #192

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open

Conversation

pull[bot]
Copy link

@pull pull bot commented Jan 20, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

Summary by Sourcery

Allow passing open options to gen_tcp and gen_udp.

New Features:

  • Add support for passing open options, such as debug, to gen_tcp and gen_udp.

Tests:

  • Add tests for the new open options.

bmk and others added 13 commits December 9, 2024 11:11
Tweaked some test cases to handle some strange behaviour on Darwin
(on some machines).

OTP-19386
Tweaked some test cases to handle some strange behaviour on Darwin
(on some machines).

OTP-19386
Bumps the github-actions group with 3 updates: [actions/upload-artifact](https://github.com/actions/upload-artifact), [github/codeql-action](https://github.com/github/codeql-action) and [softprops/action-gh-release](https://github.com/softprops/action-gh-release).


Updates `actions/upload-artifact` from 4.5.0 to 4.6.0
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@6f51ac0...65c4c4a)

Updates `github/codeql-action` from 3.28.0 to 3.28.1
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@48ab28a...b6a472f)

Updates `softprops/action-gh-release` from 2.2.0 to 2.2.1
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](softprops/action-gh-release@7b4da11...c95fe14)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps the github-actions group with 2 updates: [actions/upload-artifact](https://github.com/actions/upload-artifact) and [softprops/action-gh-release](https://github.com/softprops/action-gh-release).


Updates `actions/upload-artifact` from 4.5.0 to 4.6.0
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@6f51ac0...65c4c4a)

Updates `softprops/action-gh-release` from 2.2.0 to 2.2.1
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](softprops/action-gh-release@7b4da11...c95fe14)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps the github-actions group with 2 updates: [actions/upload-artifact](https://github.com/actions/upload-artifact) and [softprops/action-gh-release](https://github.com/softprops/action-gh-release).


Updates `actions/upload-artifact` from 4.5.0 to 4.6.0
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@6f51ac0...65c4c4a)

Updates `softprops/action-gh-release` from 2.2.0 to 2.2.1
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](softprops/action-gh-release@7b4da11...c95fe14)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps the github-actions group with 3 updates: [actions/upload-artifact](https://github.com/actions/upload-artifact), [github/codeql-action](https://github.com/github/codeql-action) and [softprops/action-gh-release](https://github.com/softprops/action-gh-release).


Updates `actions/upload-artifact` from 4.5.0 to 4.6.0
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@6f51ac0...65c4c4a)

Updates `github/codeql-action` from 3.28.0 to 3.28.1
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@48ab28a...b6a472f)

Updates `softprops/action-gh-release` from 2.2.0 to 2.2.1
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](softprops/action-gh-release@7b4da11...c95fe14)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <[email protected]>
@pull pull bot added the ⤵️ pull label Jan 20, 2025
Copy link

sourcery-ai bot commented Jan 20, 2025

Reviewer's Guide by Sourcery

This pull request refactors the socket option handling in the gen_tcp and gen_udp modules. It introduces a new open_opts category for options that are used when opening a socket, and it also modifies how options are split and passed to the underlying socket NIFs. Additionally, it adds debugging support to the socket NIFs.

Sequence diagram for updated socket opening process

sequenceDiagram
    participant C as Client
    participant S as Socket Module
    participant N as Socket NIF

    C->>S: open/connect request with options
    activate S
    S->>S: split_start_opts()
    S->>S: split_open_opts()
    S->>S: process options
    S->>N: start_server with OpenOpts
    activate N
    N-->>S: server started
    deactivate N
    S->>N: configure socket
    activate N
    N-->>S: socket configured
    deactivate N
    S-->>C: socket handle
    deactivate S
Loading

Class diagram showing the updated socket option handling

classDiagram
    class SocketOptions {
      +split_start_opts(Opts)
      +split_open_opts(Opts)
      +open_opts(OpenOpts, Fd)
      +extra_opts(OpenOpts)
    }

    class GenTcpSocket {
      +connect_lookup(Address, Port, Opts, Timer)
      +listen(Port, Opts)
      +fdopen(Fd, Opts)
    }

    class GenUdpSocket {
      +open(Service, Opts)
      +open_lookup(Service, Opts)
      +do_open(Mod, BindAddr, Domain, OpenOpts, Opts, ExtraOpts)
    }

    GenTcpSocket ..> SocketOptions : uses
    GenUdpSocket ..> SocketOptions : uses

    note for SocketOptions "New option handling with
separate open_opts category"
Loading

File-Level Changes

Change Details Files
Introduce open_opts category for socket options.
  • Added split_open_opts function to separate open_opts from other options.
  • Modified connect_lookup, listen, and fdopen functions to use open_opts.
  • Modified do_open function in gen_udp_socket to use open_opts.
  • Modified extra_opts function to handle open_opts.
lib/kernel/src/gen_tcp_socket.erl
lib/kernel/src/gen_udp_socket.erl
Refactor option splitting and passing to NIFs.
  • Modified connect_lookup and listen functions to split options into start_opts and open_opts.
  • Modified start_server function to accept open_opts.
  • Modified try_bind function to accept open_opts.
  • Modified fdopen function to split options into start_opts and open_opts.
  • Modified do_open function in gen_udp_socket to split options into socket_opts, start_opts, and open_opts.
lib/kernel/src/gen_tcp_socket.erl
lib/kernel/src/gen_udp_socket.erl
Add debugging support to socket NIFs.
  • Added esock_domain_to_string and esock_protocol_to_string functions to convert domain and protocol values to strings.
  • Modified essio_open_with_fd and essio_open_plain functions to print domain, type, and protocol values as strings when debugging is enabled.
  • Added macros DOM2STR and PROTO2STR for converting domain and protocol values to strings.
erts/emulator/nifs/common/socket_util.c
erts/emulator/nifs/unix/unix_socket_syncio.c
erts/emulator/nifs/common/socket_util.h
erts/emulator/nifs/common/socket_int.h
Add debug option to test suites.
  • Added debug option to gen_tcp:listen call in otp_18357 test case.
  • Added debug option to gen_tcp:connect call in otp_18357 test case.
  • Added a check for Darwin OS in do_open_fd test case.
lib/kernel/test/gen_tcp_misc_SUITE.erl
lib/kernel/test/gen_udp_SUITE.erl

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

jcpetruzza and others added 15 commits January 20, 2025 12:25
Starting with gcc-14, the emulator tests were failing to run
due to gcc reporting an "incompatible pointer type" error
in nif_SUITE.c. The fix is straighforward
…06e'

* dependabot/github_actions/master/github-actions-062d0f906e:
  build(deps): bump the github-actions group with 3 updates
…815c4' into maint-25

* dependabot/github_actions/maint-25/github-actions-69acc815c4:
  build(deps): bump the github-actions group with 2 updates
…815c4' into maint-26

* dependabot/github_actions/maint-26/github-actions-69acc815c4:
  build(deps): bump the github-actions group with 2 updates
…f906e' into maint-27

* dependabot/github_actions/maint-27/github-actions-062d0f906e:
  build(deps): bump the github-actions group with 3 updates
…digits

Fix `calendar:rfc3339_to_system_time` handling of fractional seconds

OTP-19441
OTP-19390

* maria/stdlib/fix-timer/PR-9303/OTP-19442:
  Fix timer:sleep/1 spec
kikofernandez and others added 2 commits January 20, 2025 14:44
* bjorn/syntax_tools/update-dependencies:
  syntax_tools: Update dependencies
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.

7 participants