Giter Club home page Giter Club logo

Comments (23)

tarkpate avatar tarkpate commented on July 21, 2024 1

I'll test this now. Regardless whether the issue persists, this PR should be merged in because disabling the main wrapping explicitly is more robust. The defaults may not stay the same between current and future versions.

from miryoku.

manna-harbour avatar manna-harbour commented on July 21, 2024

Do you have any org-babel customisations, particularly f'or C? What version of org are you using?

from miryoku.

manna-harbour avatar manna-harbour commented on July 21, 2024

Try adding :main no to the header arguments.

from miryoku.

tarkpate avatar tarkpate commented on July 21, 2024

Thanks.That fixed it so I'll make a PR.

from miryoku.

manna-harbour avatar manna-harbour commented on July 21, 2024

Thanks. What org version are you using? There have been a few random changes with new org versions recently.

from miryoku.

obar avatar obar commented on July 21, 2024

I see the same extra main wrappers using Org 9.4, and @RubioJr9's branch solves it. However I can't definitively say this should be merged as I'm also getting the extra commas mentioned in manna-harbour/miryoku#30โ€”will elaborate on that issue.

from miryoku.

obar avatar obar commented on July 21, 2024

I played around with this and I'd say merge ๐Ÿ‘

from miryoku.

manna-harbour avatar manna-harbour commented on July 21, 2024

@RubioJr9 @obar Thanks for creating and investigating this issue. I've updated org from 9.1.9 to 9.4.5 and I don't see this issue in either version. Can you please test with org 9.4.5 and also tell me what emacs and python versions you are using?

from miryoku.

obar avatar obar commented on July 21, 2024

Fairly current versions of everything here, Emacs 27 / Org 9.4 / Python 3.8.5

I needed the :main no tweak from manna-harbour/qmk_firmware#12 to make it work. It doesn't appear that any recent changes to Org's c handling would have affected this behavior. @manna-harbour is it possible you have changed the variable org-babel-header-args:C somewhere in your config?

from miryoku.

tarkpate avatar tarkpate commented on July 21, 2024

I'm still having this issue. Emacs 27.2 / Org 9.5 / Python 3.9.3

from miryoku.

manna-harbour avatar manna-harbour commented on July 21, 2024

Fairly current versions of everything here, Emacs 27 / Org 9.4 / Python 3.8.5

I needed the :main no tweak from manna-harbour/qmk_firmware#12 to make it work. It doesn't appear that any recent changes to Org's c handling would have affected this behavior. @manna-harbour is it possible you have changed the variable org-babel-header-args:C somewhere in your config?

I haven't changed org-babel-header-args:C.

I'm still having this issue. Emacs 27.2 / Org 9.5 / Python 3.9.3

With manna-harbour/qmk_firmware#10 merged and emacs 26 I've tried the following with no main wrapping issue present:

  • python 2.7.12, org 9.1.9
  • python 2.7.12, org 9.4.5
  • python 3.5.2, org 9.4.5
  • python 3.9.4, org 9.4.5

I'll try with a more recent emacs.

from miryoku.

obar avatar obar commented on July 21, 2024

from miryoku.

manna-harbour avatar manna-harbour commented on July 21, 2024

Interesting results. Could this have been changed by some other package / what do you get from running C-h v org-babel-header-args:C?

org-babel-header-args:C is a variable defined in โ€˜ob-C.elโ€™.
Its value is
((includes . :any)
 (defines . :any)
 (main . :any)
 (flags . :any)
 (cmdline . :any)
 (libs . :any))

With emacs 27.1, python 3.9.4, org 9.4.5, still no main wrapping issue. Also tried with a clean emacs config. It must be a library issue... I'll try with an updated system.

from miryoku.

manna-harbour avatar manna-harbour commented on July 21, 2024

Tried in a container, still no main wrapping issue:

Ubuntu 20.04.2
emacs 26.3, org 9.1.9, python 3.9.0+
emacs 26.3, org 9.4.5, python 3.9.0+
emacs 27.1, org 9.4.5, python 3.9.0+

from miryoku.

manna-harbour avatar manna-harbour commented on July 21, 2024

Here it is in ubuntu-latest with default emacs / org / python3, with no main wrapping issue:

  • Ubuntu 20.04.2 LTS
  • GNU Emacs 26.3
  • Org mode version 9.1.9
  • Python 3.8.5

Workflow: https://github.com/manna-harbour/qmk_firmware/actions/workflows/tangle.yml

Last run: https://github.com/manna-harbour/qmk_firmware/runs/2574409943

from miryoku.

manna-harbour avatar manna-harbour commented on July 21, 2024

@RubioJr9 @obar Would you mind testing with a clean emacs config?

from miryoku.

obar avatar obar commented on July 21, 2024

Just tested in emacs -Q, ie no user config, told babel to use python3 (3.8.5), and still got the same main wrapping. I would agree that it makes sense to put this in explicitly in any case.

Looking at ob-C.el I really don't see how the main wrapping wouldn't be happening. At any rate it doesn't give you a negative effect to have that patch, correct?

from miryoku.

tarkpate avatar tarkpate commented on July 21, 2024

I'm not getting this behavior anymore with Org 9.5 and python 3.9.5

from miryoku.

obar avatar obar commented on July 21, 2024

I hadn't fully thought this through with my emacs -Q test: I didn't load the latest org, I used the one that emacs had built-in (9.3). I just updated to the latest org on ELPA (9.4.6) and with it I'm still getting the wrapper.

I don't think the python version should matter for this issue. Should it?

Could the wrapper's absence be an indication of a bug elsewhere? I haven't seen any indication that the default behavior was changed.

from miryoku.

manna-harbour avatar manna-harbour commented on July 21, 2024

Re manna-harbour/qmk_firmware#12 (comment), I've just heard that a single #+PROPERTY: header-args :main no fixes this issue in org 9.4.6. @obar Would you mind trying that as an alternative to :main no in every source block? As I can't reproduce the bug I can't verify if that works. If it does I'll add it, but if not I'll just add the PR as is.

from miryoku.

manna-harbour avatar manna-harbour commented on July 21, 2024

I just updated to the latest org on ELPA (9.4.6) and with it I'm still getting the wrapper.

I don't think the python version should matter for this issue. Should it?

Could the wrapper's absence be an indication of a bug elsewhere? I haven't seen any indication that the default behavior was changed.

Thanks. It must be something to do with the platform or other libraries then, Python version only doesn't seem to matter as I've tested multiple versions. Behaviour of babel has changed before without documentation so it's hard to tell if it's intentional or not...

from miryoku.

tarkpate avatar tarkpate commented on July 21, 2024

Re manna-harbour/qmk_firmware#12 (comment), I've just heard that a single #+PROPERTY: header-args :main no fixes this issue in org 9.4.6. @obar Would you mind trying that as an alternative to :main no in every source block? As I can't reproduce the bug I can't verify if that works. If it does I'll add it, but if not I'll just add the PR as is.

I tried this with an older org version before I made the PR, but it didn't work. It'd certainly be worth trying on the newer version though

from miryoku.

manna-harbour avatar manna-harbour commented on July 21, 2024

I tried this with an older org version before I made the PR, but it didn't work. It'd certainly be worth trying on the newer version though

Yes that's what I was referring to by the linked comment, and thanks for trying it already!

I just managed to trigger main wrapping once by some combination of enabling C code block execution, adding and executing a test block, and tangling, but I haven't been able to reproduce it. Also, using the PROPERTY to enable main wrapping (which should be automatic) didn't work for me, so I'm going to assume it won't necessarily work to disable it.

I'm just going to merge the existing fix and move on. Thanks everyone!

from miryoku.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.