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

[WIP] - perl packages for devShell.networkSub to run switch_config_loader #804

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

Conversation

sarcasticadmin
Copy link
Member

Description of PR

Fixes: #801

This requires all of the perl libs to be able to run switch_config_loader from inside the devShell.networkSub

Previous Behavior

  • No perl lib deps existed in devShell.networkSub

New Behavior

  • perl lib deps exist in devShell.networkSub
  • perl lib Net::Ping patch included in scale-network overlay

Tests

  • TBD

Required perl lib for running
switch-configurations/config/scripts/switch_config_loader
Required lib for
switch-configuration/config/scripts/switch_config_loader
Include all of the perl libs required for running
switch-configuration/config/scripts/switch_config_loader in the
devShell.
Latest version of perlNetInterface and includes the necessary workaround
for the build failure with newer linux kernels:
  https://rt.cpan.org/Public/Bug/Display.html?id=124582
Without `which` the resulting error happens at build time:

...
checking for LOCAL_SIZEOF_SOCKADDR_OSITP... not defined
configure: creating ./config.status
config.status: creating config.h
Can't exec "which": No such file or directory at inst/netsymbols.pl line 55 (#1)
    (W exec) A system(), exec(), or piped open call could not execute the
    named program for the indicated reason.  Typical reasons include: the
    permissions were wrong on the file, the file wasn't found in
    $ENV{PATH}, the executable in question was compiled for another
    architecture, or the #! line in a script points to an interpreter that
    can't be run for similar reasons.  (Or maybe your system doesn't support
    #! at all.)

Use of uninitialized value $grep in pattern match (m//) at inst/netsymbols.pl
        line 56 (#1)
    (W uninitialized) An undefined value was used as if it were already
    defined.  It was interpreted as a "" or a 0, but maybe it was a mistake.
    To suppress this warning assign a defined value to your variables.

    To help you figure out what was undefined, perl will try to tell you
    the name of the variable (if any) that was undefined.  In some cases
    it cannot do this, so it also tells you what operation you used the
    undefined value in.  Note, however, that perl optimizes your program
    and the operation displayed in the warning may not necessarily appear
    literally in your program.  For example, "that $foo" is usually
    optimized into "that " . $foo, and the warning will refer to the
    concatenation (.) operator, even though there is no . in
    your program.

Use of uninitialized value $grep in concatenation (.) or string at
        inst/netsymbols.pl line 60 (#1)
sh: illegal option -r
sh: illegal option -r
sh: illegal option -r
Uncaught exception from user code:
        AF_INET not found in netsymbolsC.inc,
        prerequisite development library header files missing from /usr/include/sys
@sarcasticadmin
Copy link
Member Author

@djacu Im currently having an issue with building scale-network.perlNetInterface. Ive tried a couple of things but the build always wants to look into /usr/include/sys. There are additional details around what we'd need to do in an upstream open issue: https://rt.cpan.org/Public/Bug/Display.html?id=124582 Seems like we'd need to include the old sys path symlinked to wherever socket.h resides but I can't seem to get the configure to look anywhere but /usr/include/sys. See: 0290733

Heres the error Im getting when going from 1.015->1.016. Let me know if you (or anyone else for that matter) have any ideas:

...
checking for LOCAL_SIZEOF_SOCKADDR_EON... not defined
checking for LOCAL_SIZEOF_SOCKADDR_INARP... not defined
checking for LOCAL_SIZEOF_SOCKADDR_ISO... not defined
checking for LOCAL_SIZEOF_SOCKADDR_NS... not defined
checking for LOCAL_SIZEOF_SOCKADDR_ATM... not defined
checking for LOCAL_SIZEOF_SOCKADDR_DECnet... not defined
checking for LOCAL_SIZEOF_SOCKADDR_TP... not defined
checking for LOCAL_SIZEOF_SOCKADDR_OSITP... not defined
configure: creating ./config.status
config.status: creating config.h
/nix/store/3jc4m5gwimj4mbm01ijgkm2di8hiy5l3-gnugrep-3.11/bin/grep: /usr/include/*: No such file or directory
/nix/store/3jc4m5gwimj4mbm01ijgkm2di8hiy5l3-gnugrep-3.11/bin/grep: /usr/include/*: No such file or directory
/nix/store/3jc4m5gwimj4mbm01ijgkm2di8hiy5l3-gnugrep-3.11/bin/grep: /usr/include/*: No such file or directory
Uncaught exception from user code:
        AF_INET not found in netsymbolsC.inc,
        prerequisite development library header files missing from /usr/include/sys

cp -pr ${linuxHeaders}/include usr/
ln -s ${linuxHeaders}/include/linux/socket.h usr/include/sys/socket.h
ls -lahR usr/
echo "aaaaaaaa"
Copy link
Contributor

Choose a reason for hiding this comment

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

You are seen
You are heard
Your feelings are valid.

@djacu
Copy link
Contributor

djacu commented Dec 1, 2024

@djacu Im currently having an issue with building scale-network.perlNetInterface. Ive tried a couple of things but the build always wants to look into /usr/include/sys. There are additional details around what we'd need to do in an upstream open issue: https://rt.cpan.org/Public/Bug/Display.html?id=124582 Seems like we'd need to include the old sys path symlinked to wherever socket.h resides but I can't seem to get the configure to look anywhere but /usr/include/sys. See: 0290733

I tried some things that did not pan out. @ConnorBaker is coming over to hack in a bit. He might have some good ideas.

Creating our own NetPing package to incorporate an existing patch
(thanks Owen) that has yet to land upstream.
This is required for a subset of functionality in Loader.pm for
switch-configurations.
@sarcasticadmin
Copy link
Member Author

@djacu also included another package: package.perlNetPing which incorporates the patch provide by Owen in #801 just FYI since that wasnt in the original PR

@djacu
Copy link
Contributor

djacu commented Dec 1, 2024

@sarcasticadmin I have been digging around and I'm not seeing AF_INET defined in any header file in linuxHeaders like we expect. See this where AF_INET is explicitly defined. I created a patch that removes the check for this symbol and it did finish building... but I don't know if this would actually be usable.

@sarcasticadmin
Copy link
Member Author

@djacu good catch, I should have actually looked at the contents of linuxHeaders 🤦

I created a patch that removes the check for this symbol and it did finish building... but I don't know if this would actually be usable.

Seems worth a shot, Im assuming you patched out the following: https://metacpan.org/release/MIKER/Net-Interface-1.016/source/Makefile.PL#L179-183 Feel free to push up what you've got too.

Im going to ping @owendelong and see if I can confirm which version hes using and on what platforms. Seems like this would fail for him on various versions of modern linux.

The make file has a check to grep for the AF_INET symbol in
/usr/include/sys. Patching this out so that it builds. Not certain if
this will cause runtime failures.
@djacu
Copy link
Contributor

djacu commented Dec 4, 2024

Seems worth a shot, Im assuming you patched out the following: https://metacpan.org/release/MIKER/Net-Interface-1.016/source/Makefile.PL#L179-183 Feel free to push up what you've got too.

Yeah that is what I patched out. Cleaned up the derivation definition and pushed up what I got. I tried to enable the tests but they failed and I couldn't figure out in a short amount of time how to disable only the broken tests.

It builds now but still not sure if it actually works at runtime.

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

Successfully merging this pull request may close these issues.

document and incorporate the perl ping module patch
2 participants