Opened 2 years ago

Last modified 2 years ago

#65826 assigned defect

nodejs16 @16.17.0_2: requires a full Xcode installation

Reported by: JDLH (Jim DeLaHunt) Owned by: ci42
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: Cc:
Port: nodejs16

Description (last modified by JDLH (Jim DeLaHunt))

I have nodejs16 @16.17.0_1 installed and active, and nodejs16 @16.17.0_0 installed and inactive. This is now outdated. I tried to upgrade it, and received the following error message:

Error: Port nodejs16 requires a full Xcode installation, which was not found on your system.
Error: You can install Xcode from the Mac App Store or https://developer.apple.com/xcode/
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.

I am pretty sure that I was able to install the earlier versions of nodejs16 without full Xcode. I have never had full Xcode installed on this system, and I started using it less than 6 months ago.

The main.log reads as follows:

version:1
:debug:main Starting logging for nodejs16 @16.17.0_2
:debug:sysinfo macOS 12.5.1 (darwin/21.6.0) arch arm
:debug:sysinfo MacPorts 2.7.2
:debug:sysinfo Xcode none
:debug:sysinfo SDK 12
:debug:sysinfo MACOSX_DEPLOYMENT_TARGET: 12.0
:error:main Port nodejs16 requires a full Xcode installation, which was not found on your system.
:error:main You can install Xcode from the Mac App Store or https://developer.apple.com/xcode/

This appears similar to #60973, which is about nodejs14 not 16. I have not yet tried the workaround in ticket:60973#comment:5 . I suspect that MacPorts might have retrieved precompiled binaries before, but I have no evidence to prove or refute that.

Change History (7)

comment:1 Changed 2 years ago by JDLH (Jim DeLaHunt)

Description: modified (diff)

May be related to commit 3aefb5, dated 6 hours before this report, which bumped the revision number in the Portfile because the ICU library, on which the port depends, had changed. Maybe the buildbot has not compiled this commit for macOS 12 arm64. I do not know how to read the Buildbot UI to find that out. It seems to say that the builder for macOS 12 arm64 is idle, and has been for over 10 hours. That seems curious to me, so maybe I am not reading the UI correctly.

Also: fixed up the wikilink to a ticket's comment, in the Description above.

comment:2 Changed 2 years ago by JDLH (Jim DeLaHunt)

Meanwhile, my ignorant MacPorts user take is: MacPorts says you can generally get by with just the Xcode Command Line Tools installed. If the nodejs16 port requires all of Xcode to be installed, then that should be apparent in the list of dependencies which port info nodejs16 displays. What I see is:

% port info nodejs16
nodejs16 @16.17.0_2 (devel, net)
Variants:             openssl3

Description:          Node's goal is to provide an easy way to build scalable network programs in JavaScript. Node is similar in design to and influenced by systems like Ruby's Event
                      Machine or Python's Twisted. Node takes the event model a bit further-it presents the event loop as a language construct instead of as a library.
Homepage:             https://nodejs.org/

Extract Dependencies: xz
Build Dependencies:   pkgconfig
Library Dependencies: libcxx, python310, zlib, openssl11
Conflicts with:       nodejs8, nodejs10, nodejs12, nodejs13, nodejs14, nodejs15, nodejs17, nodejs18
Platforms:            darwin
License:              (MIT or BSD)
Maintainers:          Email: ciserlohn@macports.org, GitHub: ci42
                      Policy: openmaintainer

... which does not say, "This depends on having all of Xcode to build", as I read it.

comment:3 Changed 2 years ago by kencu (Ken)

The nodejs16 Portfile has always required a full xcode since it was first set up as a port, it appears:

https://github.com/macports/macports-ports/commit/2301ff67ef91df9dfb02461868b60f0009446e1e

It says in the portfile: use_xcode yes.

however it is quite possible that you have simply downloaded a prebuilt binary every time you installed it up to now.

comment:4 Changed 2 years ago by kencu (Ken)

you could check here from time to time to see when the buildbot has finished building it:

http://packages.macports.com/nodejs16/

and then install the prebuilt binary when it is available.

Last edited 2 years ago by kencu (Ken) (previous) (diff)

comment:5 in reply to:  3 Changed 2 years ago by JDLH (Jim DeLaHunt)

Replying to kencu:

The nodejs16 Portfile has always required a full xcode… It says in the portfile: use_xcode yes.

I see use_xcode yes in the Portfile, agreed. But, it seems reasonable to expect that port info would tell a MacPorts user what they need to know about fundamental dependencies. Users should not have to read Portfiles for that. Is this dependency on full Xcode visible visible in port info nodejs16 output?

(The good news is that use_xcode yes is documented in the MacPorts Guide, 5.1. ''Global Keywords''. Yay.)

comment:6 in reply to:  4 Changed 2 years ago by JDLH (Jim DeLaHunt)

Replying to kencu:

you could check here from time to time to see when the buildbot has finished building it:

http://packages.macports.com/nodejs16/

and then install the prebuilt binary when it is available.

That worked for me!

I went to http://packages.macports.com/nodejs16/ , and found a list of entries like:

Index of /nodejs16
	Name	Last modified	Size	
Parent Directory	 	-
nodejs16-16.13.2_0.darwin_18.x86_64.tbz2	2022-01-11 11:54 	21M
nodejs16-16.13.2_0.darwin_18.x86_64.tbz2.rmd160	2022-01-11 11:54 	512
nodejs16-16.13.2_0.darwin_19.x86_64.tbz2	2022-01-11 11:06 	21M
nodejs16-16.13.2_0.darwin_19.x86_64.tbz2.rmd160	2022-01-11 11:06 	512
nodejs16-16.13.2_0.darwin_20.arm64.tbz2	2022-01-11 21:20 	21M
nodejs16-16.13.2_0.darwin_20.arm64.tbz2.rmd160	2022-01-11 21:20 	512
…elided…
nodejs16-16.14.0_0.darwin_13.x86_64.tbz2	2022-02-09 12:58 	21M
nodejs16-16.14.0_0.darwin_13.x86_64.tbz2.rmd160	2022-02-09 12:58 	512
nodejs16-16.14.0_0.darwin_14.x86_64.tbz2	2022-02-09 13:22 	21M
nodejs16-16.14.0_0.darwin_14.x86_64.tbz2.rmd160	2022-02-09 13:22 	512
…elided…
nodejs16-16.14.0_0.darwin_20.arm64.tbz2	2022-02-09 10:52 	21M
nodejs16-16.14.0_0.darwin_20.arm64.tbz2.rmd160	2022-02-09 10:52 	512 
…elided…

I figured out what version I wanted by: {{{% uname -rm 21.6.0 arm64 }}}

So I searched for _21.arm64, starting with the last line of the web page and searching backwards:

nodejs16-16.17.0_2.darwin_21.arm64.tbz2	2022-09-12 03:56 	21M
nodejs16-16.17.0_2.darwin_21.arm64.tbz2.rmd160	2022-09-12 03:56 	512 

I checked the version of my outdated nodejs16:

The following installed ports are outdated:
nodejs16                       16.17.0_1 < 16.17.0_2     

So, the binary archive on MacPorts has the version I need. Its create date is after I filed this ticket, which explains why my upgrade attempt failed before. I did a port upgrade outdated, and this worked for me:

--->  Computing dependencies for nodejs16
--->  Fetching archive for nodejs16
--->  Attempting to fetch nodejs16-16.17.0_2.darwin_21.arm64.tbz2 from https://packages.macports.org/nodejs16
--->  Attempting to fetch nodejs16-16.17.0_2.darwin_21.arm64.tbz2.rmd160 from https://packages.macports.org/nodejs16
--->  Installing nodejs16 @16.17.0_2
--->  Cleaning nodejs16
--->  Computing dependencies for nodejs16
--->  Deactivating nodejs16 @16.17.0_1
--->  Cleaning nodejs16
--->  Activating nodejs16 @16.17.0_2
--->  Cleaning nodejs16

From this I conclude:

  1. Port nodejs16 is working as designed, this ticket has no fix to suggest.
  2. Enhancement request to port info, so that it communicates the dependency on full Xcode declared by use_xcode yes in a Portfile. That should probably be a separate ticket.
  3. Enhancement request to the MacPorts Guide, probably section 3.3. ''Common Tasks'', to explain "How to tell if a binary archive exists for a port you need". That should probably be a separate ticket.

comment:7 Changed 2 years ago by kencu (Ken)

that all sounds good.

FYI, perhaps based on this, someone has reanalyzed why nodejs is set to require a full xcode in the first place. Apparently it was never terribly clear:

https://github.com/macports/macports-ports/pull/16126

Note: See TracTickets for help on using tickets.