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

xmlsec: fix build on macOS #101319

Merged
merged 2 commits into from Nov 1, 2020
Merged

xmlsec: fix build on macOS #101319

merged 2 commits into from Nov 1, 2020

Conversation

caleb
Copy link
Contributor

@caleb caleb commented Oct 22, 2020

xmlsec detects the Darwin platform and uses the -D flag with base64, but nix uses GNU base64 which requires -d.

This patch removes the platform test and always uses the -d flag.

Motivation for this change

The recent update of xmlsec to version 1.2.30 broke xmlsec on macOS. See the bug: #101276

Things done
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

xmlsec detects the Darwin platform and uses the -D flag with base64, but nix uses GNU base64 which requires -d.

This patch removes the platform test and always uses the -d flag.
@ofborg ofborg bot added 6.topic: darwin Running or building packages on Darwin 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 labels Oct 22, 2020
Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builds on darwin.

@SuperSandro2000
Copy link
Member

SuperSandro2000 commented Oct 27, 2020

Run on darwin:

Result of nixpkgs-review pr 101319 1

2 packages marked as broken and skipped:
  • bareos
  • krunner-pass
1 package failed to build:
  • python37Packages.pysaml2
5 packages built:
  • matrix-synapse
  • oathToolkit
  • passExtensions.pass-otp
  • python38Packages.pysaml2
  • xmlsec

@SuperSandro2000
Copy link
Member

SuperSandro2000 commented Oct 27, 2020

I think we should set pysaml2 to only build darwin on python38.


handler.flush()
handler.close()
print(c.logger)
>       c.setup_logger()
tests/test_31_config.py:331:#
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/nix/store/cgqmjmh17s54yn3m3rz8ivhzkv5gvgiq-python3.7-pysaml2-5.0.0/lib/python3.7/site-packages/saml2/config.py:509: in setup_logger
root_logger.addHandler(self.log_handler())
/nix/store/cgqmjmh17s54yn3m3rz8ivhzkv5gvgiq-python3.7-pysaml2-5.0.0/lib/python3.7/site-packages/saml2/config.py:476: in log_handler
handler = LOG_HANDLER[htyp](**args)
/nix/store/i2fhj70arnf7d8h2scz5kmvwdi9809q4-python3-3.7.9/lib/python3.7/logging/handlers.py:829: in __init__                                                                                    ress = socket.getaddrinfo(host, port, 0, socktype)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
host = 'localhost', port = 514, family = 0, type = <SocketKind.SOCK_DGRAM: 2>
proto = 0, flags = 0
def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0):
        """Resolve host and port into list of address info entries.

        Translate the host/port argument into a sequence of 5-tuples that contain
        all the necessary arguments for creating a socket connected to that service.
        host is a domain name, a string representation of an IPv4/v6 address or
        None. port is a string service name such as 'http', a numeric port number or
        None. By passing None as the value of host and port, you can pass NULL to
        the underlying C API.

        The family, type and proto arguments can be optionally specified in order to
        narrow the list of addresses returned. Passing zero as a value for each of
        these arguments selects the full range of results.
        """
        # We override this function since we want to translate the numeric family
        # and socket type values to enum constants.
        addrlist = []
>       for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
E       socket.gaierror: [Errno 8] nodename nor servname provided, or not known

/nix/store/i2fhj70arnf7d8h2scz5kmvwdi9809q4-python3-3.7.9/lib/python3.7/socket.py:752: gaierror

Co-authored-by: Mario Rodas <marsam@users.noreply.github.com>
@caleb
Copy link
Contributor Author

caleb commented Nov 1, 2020

Good idea, I've updated the patch with your suggestion.

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.

None yet

4 participants