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

ovftool: init at 4.4.1 #107599

Merged
merged 1 commit into from May 27, 2021
Merged

ovftool: init at 4.4.1 #107599

merged 1 commit into from May 27, 2021

Conversation

numinit
Copy link
Contributor

@numinit numinit commented Dec 25, 2020

Motivation for this change

Adding VMWare's proprietary ovftool (c.f. https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=vmware-ovftool), which has a weird self-extracting installer on i686-linux and x86_64-linux that requires a FHS env to run.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 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.

@SuperSandro2000
Copy link
Member

SuperSandro2000 commented Dec 25, 2020

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

Shouldn't this build on x86_64?

@numinit
Copy link
Contributor Author

numinit commented Dec 25, 2020

@SuperSandro2000 It currently uses requireFile since ovftool is from VMWare's website and requires a (free) account to download... if I can find a mirror that we can actually use I'll replace it

@numinit
Copy link
Contributor Author

numinit commented Dec 25, 2020

It also currently requires the (insecure) openssl_1_0_2, because ovftool depends on pre-1.1 OpenSSL

@numinit
Copy link
Contributor Author

numinit commented Dec 26, 2020

So, I at least tried forcing ovftool to use OpenSSL 1.1 and testing by signing a .ova file. It seems to specifically want to use 1.0.2 rather than 1.1. I can sign an OVA if it depends on OpenSSL 1.0.2, but bait-and-switch to 1.1 makes ovftool crash.

strace shows it looking for 1.0.2 - since our OpenSSL 1.0.2 is named 1.0.0, symlinking that into lib seemed to satisfy it. But lying it to it and symlinking 1.1 as 1.0.2 makes it look elsewhere and eventually give up/abort.

This gives us a couple options if we don't want to add new dependencies on insecure libraries:

  • Use VMWare's OpenSSL. VMWare bundles an OpenSSL 1.0.2 .so with ovftool, but I deliberately didn't copy it into $out because we can provide one ourselves. It seemed better to warn users of using an old OpenSSL version by forcing them to use NIXPKGS_ALLOW_INSECURE or similar.
  • Maybe try openssl-compat? Do we have any other packages that need to do this?

@numinit numinit marked this pull request as ready for review December 26, 2020 01:57
@WolfangAukang
Copy link
Contributor

WolfangAukang commented Dec 29, 2020

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

1 package marked as broken and skipped:
  • ovftool

@numinit still not able to test it as it is marked as broken

@SuperSandro2000
Copy link
Member

@numinit still not able to test it as it is marked as broken

This is because openssl_1_0_2 is insecure. If you allow insecure packages it will build.

@numinit
Copy link
Contributor Author

numinit commented Jan 4, 2021

Comments addressed.

@numinit
Copy link
Contributor Author

numinit commented Jan 24, 2021

Added ovftoolBundles param to facilitate use of the package with callPackage + VMWare .bundle file.

@numinit
Copy link
Contributor Author

numinit commented Apr 24, 2021

Any chance of seeing this merged for 21.05?

pkgs/tools/virtualization/ovftool/default.nix Outdated Show resolved Hide resolved
Comment on lines +180 to +183
ln -s "${openssl_1_0_2.out}/lib/libcrypto.so" \
"$out/lib/$pname/libcrypto.so.1.0.2"
ln -s "${openssl_1_0_2.out}/lib/libssl.so" \
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
ln -s "${openssl_1_0_2.out}/lib/libcrypto.so" \
"$out/lib/$pname/libcrypto.so.1.0.2"
ln -s "${openssl_1_0_2.out}/lib/libssl.so" \
ln -s "${openssl_1_0_2.lib}/lib/libcrypto.so" \
"$out/lib/$pname/libcrypto.so.1.0.2"
ln -s "${openssl_1_0_2.lib}/lib/libssl.so" \

Copy link
Contributor Author

@numinit numinit May 2, 2021

Choose a reason for hiding this comment

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

openssl_1_0_2 does not appear to have .lib on latest master

pkgs/tools/virtualization/ovftool/default.nix Outdated Show resolved Hide resolved
pkgs/tools/virtualization/ovftool/default.nix Outdated Show resolved Hide resolved
@SuperSandro2000
Copy link
Member

@ofborg eval

@numinit
Copy link
Contributor Author

numinit commented May 2, 2021

@ofborg eval

@numinit
Copy link
Contributor Author

numinit commented May 16, 2021

Changes addressed.

@SuperSandro2000 SuperSandro2000 merged commit f9b26b9 into NixOS:master May 27, 2021
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

3 participants