Opened 3 years ago

Closed 3 years ago

#7719 closed defect (fixed)

'-o' is not a legal uname option on Mac

Reported by: pett Owned by: Zach Pearson
Priority: moderate Milestone: 1.5
Component: Build System Version:
Keywords: Cc: chimera-programmers
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

detectOS.make now has this line:

SHORT_OS := $(shell uname -o)

'-o' is not a legal uname option on Mac, so all my "make install"s kick off with:

uname: illegal option -- o
usage: uname [-amnprsv]

which does not seem to be fatal

Change History (8)

comment:1 by Zach Pearson, 3 years ago

If it's not causing the builds to fail then I'm inclined to say "not a bug". It is a legal option on Ventura.

in reply to:  2 ; comment:2 by goddard@…, 3 years ago

Is it irrelevant whether the SHORT_OS variable gets set?  I'm trying to think how this error could not matter.  Even if it doesn't matter noise error messages are distracting.

comment:3 by Zach Pearson, 3 years ago

On *nixes it is irrelevant; on Windows, it's used in lieu of filtering the "_NT_X.X" out of Cygwin or MSYS versions (and it will also catch MinGW).

Let's do this instead:

OS=$(shell uname -s)
ifeq ($(filter $(OS),Darwin Linux,)
OS=$(shell uname -o)
ifneq ($(filter $(OS),Cygwin Msys,)
OS=Windows
endif
endif

comment:4 by pett, 3 years ago

So the '-o' flag has only been legal since June 6th of this year? I guess I need to upgrade sussex.

comment:5 by Zach Pearson, 3 years ago

I'm not sure if it was available on 11 or 12; I don't have a machine on either version to test but since the build machine runs older macOS we might go with the workaround I posted. It's better for people with older machines, too. I wasn't aware of how recent the flag was even on Linux.

comment:6 by pett, 3 years ago

Sussex (the new Mac Studio on my desk at work) is 12 and does not have it.

comment:7 by Zach Pearson, 3 years ago

Definitely better to use the construct with the most compatibility then.

comment:8 by Zach Pearson, 3 years ago

Resolution: fixed
Status: assignedclosed

Now only called when 'uname -s' doesn't report 'Darwin' or 'Linux'.

Note: See TracTickets for help on using tickets.