From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#27810: macOS runtime feature detection Date: Wed, 26 Jul 2017 17:06:38 +0100 Message-ID: <20170726160638.GA20774@breton.holly.idiocy.org> References: <20170724202231.GA19721@breton.holly.idiocy.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1501085236 21110 195.159.176.226 (26 Jul 2017 16:07:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 26 Jul 2017 16:07:16 +0000 (UTC) User-Agent: Mutt/1.7.2 (2016-11-26) Cc: 27810@debbugs.gnu.org To: Richard Stallman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 26 18:07:12 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1daOq7-0005Bi-AS for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Jul 2017 18:07:11 +0200 Original-Received: from localhost ([::1]:39052 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1daOqB-00047R-1k for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Jul 2017 12:07:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34094) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1daOq2-00046D-T7 for bug-gnu-emacs@gnu.org; Wed, 26 Jul 2017 12:07:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1daOpy-0000xW-Nq for bug-gnu-emacs@gnu.org; Wed, 26 Jul 2017 12:07:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54897) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1daOpy-0000xR-K4 for bug-gnu-emacs@gnu.org; Wed, 26 Jul 2017 12:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1daOpy-0002Mw-Eg for bug-gnu-emacs@gnu.org; Wed, 26 Jul 2017 12:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Jul 2017 16:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27810 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27810-submit@debbugs.gnu.org id=B27810.15010852039081 (code B ref 27810); Wed, 26 Jul 2017 16:07:02 +0000 Original-Received: (at 27810) by debbugs.gnu.org; 26 Jul 2017 16:06:43 +0000 Original-Received: from localhost ([127.0.0.1]:57574 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1daOpf-0002MP-9S for submit@debbugs.gnu.org; Wed, 26 Jul 2017 12:06:43 -0400 Original-Received: from mail-wm0-f54.google.com ([74.125.82.54]:37222) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1daOpc-0002MC-Ma for 27810@debbugs.gnu.org; Wed, 26 Jul 2017 12:06:41 -0400 Original-Received: by mail-wm0-f54.google.com with SMTP id c184so85752024wmd.0 for <27810@debbugs.gnu.org>; Wed, 26 Jul 2017 09:06:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=sBa2Lwm1jGjH0kqQs3rtQvXZhXsGmCo0Aj4lKK1A8AI=; b=b4wsesKYs8mpLks0ON7w32NiyFZYHfbEppB1Y07Jn3Wg29bNlDtL70/38YUwlsv3pr VlsvT9OEMcG4HLtOrBAp+xpHcD2aNkVJmjQOkJ/+eBy/8Y6CmEK4GezZSLar3cLlzxhi ARsZwDe4k2VZTnBVPet/SjDOL7Bpp6sZmdcMIvgWIh04c68nhu9Fp3D9AFxgQ0C30emf aMYiK5RKqtCY7kUceujEZwuBkcO8+y8fs/wWtixUzR6AKDHHu/QO6DcWzoXycguKWIxw w+ZX5Hs2kmcA/9vpPpR6VihunHTeXFgzdOJ3SN7Me7C9DgKcjqldngaHbjT1NiXAdSCg LMZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=sBa2Lwm1jGjH0kqQs3rtQvXZhXsGmCo0Aj4lKK1A8AI=; b=fzXB7bN3VZ1eh13G6RLVBQkO1GCQan5lYCbiBLGbl12V2pd7f2N/ZY51GkOCVpD32g +ZG2TH+KEBm0FjbrMVaanaoBibpgKsAyKvQIQE6XUk7sQAFzwX2xLnwskoxw9h0xy+1n gEl1Azt+b/renHMN5E6KkZIGbidFayXFKOUUM60muItDM7a+/tKXtrV6E9m84rn9i5PY PpBSA9FMdAAzSZzZohw9iBqzL7Lv/w3eM14TO8AOO+cts6kRZiP6mZdSV+QmkRYDcqQG ugoBrrjXv01fylLbzYR1rzptWjCDrmm253D0MB7atuntTTl/8U/aSnb1/dM/zqyW6Zw/ N2ug== X-Gm-Message-State: AIVw110Elg165LttuQ3IUnTV+1agzmGA+sZC0HX8ixDa/slstA60JLMd 5O9VdFudaDr4SKAUdJg= X-Received: by 10.28.229.207 with SMTP id c198mr1120710wmh.108.1501085194854; Wed, 26 Jul 2017 09:06:34 -0700 (PDT) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-38a3-b7bd-bb2f-3561.holly.idiocy.org. [2001:8b0:3f8:8129:38a3:b7bd:bb2f:3561]) by smtp.gmail.com with ESMTPSA id 9sm15172627wmo.35.2017.07.26.09.06.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Jul 2017 09:06:33 -0700 (PDT) Content-Disposition: inline In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:135024 Archived-At: On Tue, Jul 25, 2017 at 10:59:38PM -0400, Richard Stallman wrote: > [[[ To any NSA and FBI agents reading my email: please consider ]]] > [[[ whether defending the US Constitution against all enemies, ]]] > [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > > > We should be able to build a single binary that can detect new OS > > features at runtime rather than depend on compile‐time macros. > > One reason to avoid doing it that way > is for the sake of cross-compilation. I’m afraid I don’t understand why it’s a problem for cross compilation. At the moment we don’t even provide any way of building Emacs on one version of macOS that is guaranteed to work on another version of macOS, never mind cross‐compiling the NS port from another platform. For example, macOS 10.12 requires us to disable ‘tabbing mode’, otherwise it causes problems with fullscreen. However, the way we do that is incompatible with every previous version of macOS, and GNUstep too. Currently we just wrap the code in a compile‐time version check, but this means that to run Emacs on 10.12, it has to have been built on 10.12, and an Emacs built on 10.12 cannot run on 10.11. Objective C gives us a couple of ways of checking whether we can run the code at runtime, though. For example we can check whether an object has a particular method before calling it: if ([win respondsToSelector: @selector(setTabbingMode:)]) [win setTabbingMode: NSWindowTabbingModeDisallowed]; This allows us to bypass the problem with having to build on the target OS version. I hope this explains what I’m trying to achieve. -- Alan Third