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

or-tools: add darwin support #201136

Merged
merged 2 commits into from
Mar 24, 2023
Merged

or-tools: add darwin support #201136

merged 2 commits into from
Mar 24, 2023

Conversation

sdedovic
Copy link
Contributor

@sdedovic sdedovic commented Nov 14, 2022

Description of changes

Add support for or-tools on Mac. Build was borked because of @rpath issues in the generated dynlib and binaries used for testing (checkPhase a la ctest). This works on my machine so sharing the changes with all.

Some related discussion:

This also seems to me the lesser of two evils. fixdarwindylibnames exists but presents two problems, making it insufficient.

  1. the script runs after the checkPhase, so I need to run it as the postBuildHook as ctest uses linked objects and fails to pass.
  2. the script only patches dylib files. This project creates a large amount of executables that do not get patched and are used by ctest. Again failing the checkPhase.

Open to thoughts, I'm using it now and it functions well enough.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@ofborg ofborg bot added 6.topic: darwin Running or building packages on Darwin 8.has: package (new) This PR adds a new package labels Nov 14, 2022
@ofborg ofborg bot requested a review from andersk November 14, 2022 06:59
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Nov 14, 2022
Copy link
Member

@Atemu Atemu left a comment

Choose a reason for hiding this comment

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

Result of nixpkgs-review pr 201136 run on x86_64-darwin 1

3 packages failed to build:
  • or-tools
  • python310Packages.ortools
  • python39Packages.ortools
 96/394 Test #104: python_model_builder_assignment_mb .........................................***Failed    0.17 sec
Traceback (most recent call last):
  File "/tmp/nix-build-or-tools-9.4.drv-0/source/ortools/model_builder/samples/assignment_mb.py", line 17, in <module>
    from ortools.model_builder.python import model_builder
ModuleNotFoundError: No module named 'ortools.model_builder'

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/using-a-derivation-on-an-unsupported-platform/24131/2

Copy link
Member

@wegank wegank left a comment

Choose a reason for hiding this comment

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

Build passes on macOS 13.1, both aarch64-darwin and x86_64-darwin (via Rosetta).

@Atemu
Copy link
Member

Atemu commented Jan 5, 2023

@wegank not for me, still getting the same results as above.

@wegank
Copy link
Member

wegank commented Jan 8, 2023

@ofborg build or-tools or-tools.passthru.tests

@sdedovic
Copy link
Contributor Author

@Atemu @wegank please see my latest commit

The checkPhase was an issue because it could pip install from PyPi a newer version instead of the local one. I believe this is fixed in or-tools 9.5 or 9.6, so I have backported the patch. This has successfully built on my M1 mac.

@ofborg ofborg bot added 10.rebuild-linux: 1-10 and removed 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Mar 21, 2023
@wegank
Copy link
Member

wegank commented Mar 23, 2023

Result of nixpkgs-review pr 201136 run on x86_64-darwin 1

3 packages built:
  • or-tools
  • or-tools.python (python310Packages.ortools ,python310Packages.ortools.python)
  • python311Packages.ortools (python311Packages.ortools.python)

@wegank wegank requested a review from Atemu March 23, 2023 06:59
@sdedovic
Copy link
Contributor Author

Result of nixpkgs-review pr 201136 run on aarch64-darwin 1

3 packages built:
  • or-tools
  • or-tools.python (python310Packages.ortools ,python310Packages.ortools.python)
  • python311Packages.ortools (python311Packages.ortools.python)

@sdedovic
Copy link
Contributor Author

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

3 packages built:
  • or-tools
  • or-tools.python (python310Packages.ortools ,python310Packages.ortools.python)
  • python311Packages.ortools (python311Packages.ortools.python)

@wegank wegank merged commit f06b91b into NixOS:master Mar 24, 2023
@Janik-Haag Janik-Haag added the 12. first-time contribution This PR is the author's first one; please be gentle! label Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: darwin Running or building packages on Darwin 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 12. first-time contribution This PR is the author's first one; please be gentle!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants