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

misc pkgs: Clean up cross #29028

Merged
merged 4 commits into from Sep 5, 2017
Merged

Conversation

Ericson2314
Copy link
Member

Motivation for this change

Clean up a few of these packages ahead of #26805 fixing cross-compilation.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • 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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@Ericson2314 Ericson2314 added the 6.topic: cross-compilation Building packages on a different sort platform than than they will be run on label Sep 5, 2017
@Ericson2314 Ericson2314 added this to the 17.09 milestone Sep 5, 2017
@Ericson2314 Ericson2314 merged commit 5b6d781 into NixOS:master Sep 5, 2017
@Ericson2314 Ericson2314 deleted the cross-cleanup branch September 5, 2017 17:59
@Ericson2314 Ericson2314 added 8.has: port to stable A PR already has a backport to the stable release. 9.needs: port to stable A PR needs a backport to the stable release. labels Sep 5, 2017
@Ericson2314 Ericson2314 added this to Needed by the big PR---nice to move pick off pieces of it and move here, rebasing the big PR on top in Cross compilation Sep 5, 2017
@@ -11,9 +11,6 @@ stdenv.mkDerivation rec {
buildInputs = [ pkgconfig ncurses boehmgc ];
nativeBuildInputs = [ help2man perl ];

# `help2man' wants to run Zile, which fails when cross-compiling.
crossAttrs.nativeBuildInputs = [];
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you actually test that? IIRC coreutils suffers from the same problem, that to build a manpage for foo, it needs to execute foo --help piped to help2man which isn't obviously going to work when cross-compiling (and omitting help2man "helps" in the way that manpages aren't built and installed at all).

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm sorry @dezgeg. Indeed I had seen that same thing with coreutils. I forgot and thought the comment meant native help2man failed to build, which isn't true (and I checked that) but perhaps could have been when the nativeDrvs were weird.

I'll revert this part of it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Cross unfortunately fairly broken until #26805 or similar lands. My intent--which I failed at here--was to clean these things up without changing their behavior so I can more easily fix them later.

enableGuile ? false, guile ? null
, enablePython ? false, python ? null
, enablePerl ? (stdenv.hostPlatform == stdenv.buildPlatform), perl ? null
, enableSpidermonkey ? (stdenv.hostPlatform == stdenv.buildPlatform), spidermonkey_1_8_5 ? null
Copy link
Contributor

Choose a reason for hiding this comment

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

Ehh. Why was there a need to add these conditionals. If the cross-compilation for this package has been broken for years without anyone noticing, then better to drop the crossAttrs instead of adding conditionals like this (Unless you actually personally want/need this package of course...).

Copy link
Member Author

Choose a reason for hiding this comment

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

I've done this a few times earlier. On one hand while dependencies may also be broken I can't test the package so I just don't want to rip out functionality. On the other, missing deps was likely to be the reason they were disabled in the first place. When written like this, it's very easy to later make things unconditional if they prove unnecessary.

@@ -100,8 +102,10 @@ stdenv.mkDerivation rec {
rm -rf ffmpeg
'';

depsBuildBuild = [ buildPackages.stdenv.cc ];
Copy link
Contributor

Choose a reason for hiding this comment

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

Since when is this an API? No results in git grep...

Copy link
Member Author

Choose a reason for hiding this comment

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

That is my mistake. This is an API I intended to add, but hadn't yet. This change was not supposed to make this PR. It didn't affect the native build so I didn't notice.

@dezgeg
Copy link
Contributor

dezgeg commented Sep 6, 2017

Why was there the need to pick any of this to 17.09?

@Ericson2314
Copy link
Member Author

Why was there the need to pick any of this to 17.09?

My goal is to land #26805 for 17.09. I've been merging many PRs that page its way but are themselves far more minor changes. See https://github.com/NixOS/nixpkgs/projects/8 for my full road-map recently.

That said, @dezgeg, I'd like to apologize for this PR. While we've disagreed on various strategy for improving cross compilation, you just caught a bunch of changes that were plain mistakes in both our eyes.

@Ericson2314
Copy link
Member Author

I've pushed two commits (master, and cherry-picked to 17.09 for 4 total) fixing those mistakes.

@samueldr samueldr removed the 9.needs: port to stable A PR needs a backport to the stable release. label Apr 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: cross-compilation Building packages on a different sort platform than than they will be run on 8.has: port to stable A PR already has a backport to the stable release.
Projects
No open projects
Cross compilation
Needed by the big PR---nice to move p...
Development

Successfully merging this pull request may close these issues.

None yet

3 participants