From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id UM/ZGjo1fmISfwAAbAwnHQ (envelope-from ) for ; Fri, 13 May 2022 12:38:50 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id kFCgGjo1fmLqYQEAauVa8A (envelope-from ) for ; Fri, 13 May 2022 12:38:50 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id EBC7B2DE93 for ; Fri, 13 May 2022 12:38:47 +0200 (CEST) Received: from localhost ([::1]:48940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npSh4-000294-F6 for larch@yhetil.org; Fri, 13 May 2022 06:38:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npSfv-000281-BP for emacs-orgmode@gnu.org; Fri, 13 May 2022 06:37:35 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:34539) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npSft-0004pG-DM for emacs-orgmode@gnu.org; Fri, 13 May 2022 06:37:34 -0400 Received: by mail-pj1-x102a.google.com with SMTP id qe3-20020a17090b4f8300b001dc24e4da73so7630469pjb.1 for ; Fri, 13 May 2022 03:37:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=1W+iB6QRkQBa6Mo1r1sHcv2RoWmDNrXV6nfz9igpZbQ=; b=HKQzXqV40mt5kCfcjlKDi2SZFfIL0qslI9NgDllpt/Yn6G8fO5t+VdTZLTK/xaT1m2 Y37WPLfeYKGOYjaAnjNCjdKHqdgsBIS6WGUezusjCdSxF92ColTRt/90GSZXmsuX0+4L iEnbLVpZNaT2u6BDc/IqDQvveYDyBzJ/6mP19r9gxCnK9ONnfoa3OrL0MezH/5XmGVQR LQeRKmB69HrKHpTNo/L19hDqR4JWhj4j1ALpCZLc6c8wnG3yxre9VX5+xCnjF8reIBn0 gStJYcWHe3c0vHLJMqyEEHgBSfYC8EOjxE4cH2phyvtRjlFZoY6FIFm4LfZP1b3NTw/1 y+IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=1W+iB6QRkQBa6Mo1r1sHcv2RoWmDNrXV6nfz9igpZbQ=; b=1CZ2+wgZpwkO4gN7iGiRGfSxHIvDk8nQlePYBGoG5OXangZKV2ZDvMNy49cGP85tX2 gd+Fvcoh8o76EAGGZqNp6IL9RKRSE/YnwYm8YL16SrRYMlohBiLL9f1TLdS8mOfhlcYU d4lfptvsLnVO49EmYP/vT8nvr0rAgd+FfN6XaeuqYjScXFvB9q/he6jCioIWpaEI/anG ok2IB6WSjh9I8rU3ZIYLwEtBMTkGade6p0DmxwNvtNhwlolHWD2VPgCY11HKeiCjhjJw +RYgpF+MYkFqCDhZ7jZDFjdmVD7C0Sss5yyJoXIpXJjYLxbkmlY6BoweB2XwYP7Z0Zq2 YPaQ== X-Gm-Message-State: AOAM532GRFkp6KiDT9ufKhRFsd9o5SbQXSACMvkhKhMxNizSfKIo/zNh Az4IkhyZUM1O35MtEuIvDIU= X-Google-Smtp-Source: ABdhPJwyCayzdpxGZy9tYm/OhvLlAETIH1MRfzxGgLclvqywZyE9AcHha1dNG0VllBHnCXb1PbQsnw== X-Received: by 2002:a17:90b:3e8b:b0:1dc:e920:e072 with SMTP id rj11-20020a17090b3e8b00b001dce920e072mr15625096pjb.151.1652438251502; Fri, 13 May 2022 03:37:31 -0700 (PDT) Received: from localhost ([37.120.210.2]) by smtp.gmail.com with ESMTPSA id q18-20020a170902f79200b0015e8d4eb1f9sm1502665pln.67.2022.05.13.03.37.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 03:37:30 -0700 (PDT) From: Ihor Radchenko To: Max Nikulin Cc: emacs-orgmode@gnu.org Subject: Re: [BUG] org-babel-load-file can not compile file In-Reply-To: References: <4f9aaa16-65f3-574e-3245-a271ba4cf7cc@gmail.com> <877d6sjl6c.fsf@localhost> Date: Fri, 13 May 2022 18:38:14 +0800 Message-ID: <878rr5ra3t.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=yantar92@gmail.com; helo=mail-pj1-x102a.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1652438329; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=1W+iB6QRkQBa6Mo1r1sHcv2RoWmDNrXV6nfz9igpZbQ=; b=JdpGjoQ4PaAc7q9ODdaPn3jRJ8lC1lFVZyPryuFZjh/8QJ8yHlSaPUIKwijKZKwHZzHkAM 1Wm/iOD1weG7uO72O7sO197B1kCKt5XPnMM0p8rgzCXVXywcbrNBLNnLVxeNBBQIqPETli f2YEQ+KpJUiqCJi422xf+GqAliDn9nb1Mt/ZUxIAflLijoCpbM+Arr2pG/pImTc6hCG4Yq JihrLBOx8YWLEOiHawklwWNPSTd4SAgkD6bBZh2sGWiFobKZDA/WPVFeH4KeJOwwcbyUen WwkB/6PPUR6BQwQhKLfhn15TONtNoCweqkrpT9lgx4DzNonka2Yhsc7Z/VuBGw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652438329; a=rsa-sha256; cv=none; b=Nk4b73Ws4X5i5aJbja/1cUH5O8Ds2z8w3Lv/2YYT/nK/4mXxgt8Va0UAXXTaI0hLPbhl1N h4Jw/LxKFt1bAPsQiUMxZv5gEkcAzcMtFqOY9gEbTEKdTlys/23GXU7s5FGrgqNmeR5usN IhwOTQAsRqv54ym0vpl0EIhPhHeIVoqfHu6SQPFXc0mEz6l8g5BfiXXfTcMM+cgzGw8eB5 KSjSIgpEQBfhcAzFpv7bid3YxDHl75yiRB7dLtJ3TfevDTEWhVNRJQftdTLGtzgUVJOG/a 4JEqe0vwtLK7RyFhtmt+kTsHJV68EKjyJrhczJWE2svBlcWGWIMsayR5r/7ycQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=HKQzXqV4; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -8.82 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=HKQzXqV4; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: EBC7B2DE93 X-Spam-Score: -8.82 X-Migadu-Scanner: scn0.migadu.com X-TUID: JNZzmigVjoAv --=-=-= Content-Type: text/plain Max Nikulin writes: >> What if you substitute the load call with >> (load (byte-compile-dest-file tangled-file))? > > I do not mind (of course if there is no plan to deprecate the function). > > In addition, from my point of view, `byte-recompile-file' with 0 as the > FORCE argument is more suitable than simple `byte-compile-file' since > the former does not rewrite the compiled file when it is up to date. What about simply using touch? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-babel-load-file-Do-not-rely-on-org-babel-tangle-.patch >From 9746b9cd0a1accfc20b9d59c387bb05624154fe2 Mon Sep 17 00:00:00 2001 Message-Id: <9746b9cd0a1accfc20b9d59c387bb05624154fe2.1652438075.git.yantar92@gmail.com> From: Ihor Radchenko Date: Fri, 13 May 2022 18:21:36 +0800 Subject: [PATCH] org-babel-load-file: Do not rely on `org-babel-tangle-file' making changes * lisp/org.el (org-babel-load-file): Update modification time even when `org-babel-tangle-file' does not actually modify the tangled file. This makes sure that modify-time comparison logic does not make Org re-tangle Org file that had been changed but the changes did not affect the tangled code. See https://orgmode.org/list/t5j75h$dbo$1@ciao.gmane.io --- lisp/org.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lisp/org.el b/lisp/org.el index 47a16e94b..09a001414 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -256,6 +256,11 @@ (defun org-babel-load-file (file &optional compile) tangled-file (file-attribute-modification-time (file-attributes (file-truename file)))) + ;; Make sure that tangled file modification time is + ;; updated even when `org-babel-tangle-file' does not make changes. + ;; This avoids re-tangling changed FILE where the changes did + ;; not affect the tangled code. + (set-file-times tangled-file) (org-babel-tangle-file file tangled-file (rx string-start -- 2.35.1 --=-=-=--