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

spidermonkey: update to 102 and fix build under macOS #179822

Closed
wants to merge 9 commits into from

Conversation

catap
Copy link
Contributor

@catap catap commented Jul 1, 2022

Description of changes

This PR adds spidermonkey_102 which can be used on every unix which includes macOS. It also fix build of old version under macOS.

Thus, it suppress / consumes / closes #172376 and fixes #91415

And it adds tests for all packages :)

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 the 6.topic: darwin Running or building packages on Darwin label Jul 1, 2022
@SuperSandro2000
Copy link
Member

@ofborg eval

@ofborg ofborg bot added the 8.has: package (new) This PR adds a new package label Jul 1, 2022
@ofborg ofborg bot requested review from abbradar and lostnet July 1, 2022 18:14
@catap
Copy link
Contributor Author

catap commented Jul 4, 2022

@SuperSandro2000 may I ask you to re-review this one also? Thanks!

Some motivation: it should allow to install nixops to macOS! :)

@jtojnar
Copy link
Member

jtojnar commented Jul 4, 2022

It would be nice to split the changes into independent commits, for example:

  • spidermonkey_*: Factor out into a common expression
  • spidermonkey_*: Fix build under macOS
  • spidermonkey_102: init at 102.0

That will make it easier to review.

@catap
Copy link
Contributor Author

catap commented Jul 4, 2022

@jtojnar I've done it in different way:

  1. added 102 with macOS support
  2. added macOS support for 91 and 78;
  3. refactored it.

I may push on this way if it makes things easy to review.

@jtojnar
Copy link
Member

jtojnar commented Jul 4, 2022

Having (2) separate from the other changes is the most important. But having the unification first would be the best since it minimizes the number of files needed to compare against each other.

@catap
Copy link
Contributor Author

catap commented Jul 4, 2022

@jtojnar ok, let me try do it. It shouldn't be something complicated.

@catap
Copy link
Contributor Author

catap commented Jul 4, 2022

@jtojnar here it is.

I've split it to a bit more steps to make things as clear as I can.

@catap catap force-pushed the spidermonkey branch 2 times, most recently from 5f799ce to e8cc360 Compare July 4, 2022 19:40
Copy link
Member

@jtojnar jtojnar left a comment

Choose a reason for hiding this comment

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

Thanks, this is now much easier to review.

pkgs/development/interpreters/spidermonkey/common.nix Outdated Show resolved Hide resolved
pkgs/development/interpreters/spidermonkey/common.nix Outdated Show resolved Hide resolved
pkgs/development/interpreters/spidermonkey/common.nix Outdated Show resolved Hide resolved
pkgs/development/interpreters/spidermonkey/common.nix Outdated Show resolved Hide resolved
Comment on lines +59 to +88
libobjc
libiconv
Copy link
Member

Choose a reason for hiding this comment

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

Do these really go here rather than buildInputs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jtojnar yes, it is linked against libiconv.dylib on macOS:

√ result % otool -L lib/libmozjs-102.dylib     
lib/libmozjs-102.dylib:
	/nix/store/9ld6s0lcdjw9cp26zf4qa0j24m80rwd5-spidermonkey-102.0/lib/libmozjs-102.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.60.2)
	/nix/store/dpfzpp8c7z0fdxxvin21pk5gs135wn39-Libsystem-1238.60.2/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)
	/nix/store/k56igcml51xccxxakgvj8lai6f7fz05q-zlib-1.2.12/lib/libz.dylib (compatibility version 1.0.0, current version 1.2.12)
	/nix/store/q4c16zw3kimqdvxcc06njrv49bq68hpf-libiconv-50/lib/libiconv.dylib (compatibility version 7.0.0, current version 7.0.0)
	/nix/store/nbwbggjf37pxmishd2sqqbswv6f0l3cb-libcxx-11.1.0/lib/libc++.1.0.dylib (compatibility version 1.0.0, current version 1.0.0)
	@rpath/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1454.90.0)
√ result % otool -L bin/js102     
bin/js102:
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.60.2)
	/nix/store/dpfzpp8c7z0fdxxvin21pk5gs135wn39-Libsystem-1238.60.2/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)
	/nix/store/k56igcml51xccxxakgvj8lai6f7fz05q-zlib-1.2.12/lib/libz.dylib (compatibility version 1.0.0, current version 1.2.12)
	/nix/store/qgzlayc4acky2pyp56dh6p1bm00d315g-readline-6.3p08/lib/libreadline.6.dylib (compatibility version 6.0.0, current version 6.3.0)
	/nix/store/q4c16zw3kimqdvxcc06njrv49bq68hpf-libiconv-50/lib/libiconv.dylib (compatibility version 7.0.0, current version 7.0.0)
	/nix/store/nbwbggjf37pxmishd2sqqbswv6f0l3cb-libcxx-11.1.0/lib/libc++.1.0.dylib (compatibility version 1.0.0, current version 1.0.0)
	@rpath/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1454.90.0)
√ result % 

Copy link
Member

Choose a reason for hiding this comment

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

If it is linked against a library it goes into buildInputs.

Copy link
Member

@SuperSandro2000 SuperSandro2000 Aug 2, 2022

Choose a reason for hiding this comment

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

I think this is the last open thread.

Suggested change
libobjc
libiconv
libobjc

libiconv is already in buildInputs. Can we move libobjc, too?

pkgs/development/interpreters/spidermonkey/common.nix Outdated Show resolved Hide resolved
@catap
Copy link
Contributor Author

catap commented Jul 4, 2022

@jtojnar seems that I've addressed all your comments. Or at least I hope so.

To make review easy I haven't rebased anything, and keep all changes as two dedicated commits.

@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/prs-already-reviewed/2617/567

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.

otherwise LGTM

pkgs/development/interpreters/spidermonkey/common.nix Outdated Show resolved Hide resolved
Comment on lines +59 to +88
libobjc
libiconv
Copy link
Member

Choose a reason for hiding this comment

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

If it is linked against a library it goes into buildInputs.

pkgs/development/interpreters/spidermonkey/common.nix Outdated Show resolved Hide resolved
pkgs/development/interpreters/spidermonkey/common.nix Outdated Show resolved Hide resolved
pkgs/development/interpreters/spidermonkey/common.nix Outdated Show resolved Hide resolved
@catap catap force-pushed the spidermonkey branch 2 times, most recently from 7451816 to e8c7d9d Compare August 1, 2022 21:22
@catap
Copy link
Contributor Author

catap commented Aug 2, 2022

@SuperSandro2000 may I ask you to re-review this one?

@wegank
Copy link
Member

wegank commented Aug 2, 2022

@catap This comment has yet to be solved.

@wegank
Copy link
Member

wegank commented Aug 8, 2022

Just saw that GNOME 43 will depend on SpiderMonkey 102!

@catap
Copy link
Contributor Author

catap commented Aug 8, 2022

@wegank thanks for the ping. I'll take a look on this on couple of hours.

patches = lib.optionals (lib.versionAtLeast version "102") [
# use pkg-config at all systems
./always-check-for-pkg-config.patch
./allow-system-s-nspr-and-icu-on-bootstrapped-sysroot.patch
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
./allow-system-s-nspr-and-icu-on-bootstrapped-sysroot.patch
./allow-system-s-nspr-and-icu-on-bootstrapped-sysroot.patch
# Patches required by GJS
# https://discourse.gnome.org/t/gnome-43-to-depend-on-spidermonkey-102/10658
# Install ProfilingCategoryList.h
(fetchpatch {
url = "https://hg.mozilla.org/releases/mozilla-esr102/raw-rev/33147b91e42b79f4c6dd3ec11cce96746018407a";
sha256 = "sha256-xJFJZMYJ6P11HQDZbr48GFgybpAeVcu3oLIFEyyMjBI=";
})
# Fix embeder build
(fetchpatch {
url = "https://hg.mozilla.org/releases/mozilla-esr102/raw-rev/1fa20fb474f5d149cc32d98df169dee5e6e6861b";
sha256 = "sha256-eCisKjNxy9SLr9KoEE2UB26BflUknnR7PIvnpezsZeA=";
})

@@ -0,0 +1,4 @@
import ./common.nix {
version = "102.0";
Copy link
Member

Choose a reason for hiding this comment

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

@jtojnar jtojnar self-assigned this Aug 10, 2022
@jtojnar jtojnar mentioned this pull request Aug 10, 2022
13 tasks
@jtojnar
Copy link
Member

jtojnar commented Aug 10, 2022

Since this is blocking #182618, I cleaned up it a bit, addressed the remaining review comments and reverted some pointless changes (e.g. exporting configureScript): #185928

@catap catap closed this Aug 10, 2022
@catap catap deleted the spidermonkey branch August 10, 2022 18:39
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: 501-1000 10.rebuild-linux: 501+ 11.by: package-maintainer This PR was created by the maintainer of the package it changes 12.approvals: 2 This PR was reviewed and approved by two reputable people 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in the package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot install CouchDB on MacOS because Mozilla’s SpiderMonkey isn’t available
10 participants