errors upgrading beancount (Windows)

87 views
Skip to first unread message

Steve Kobes

unread,
Aug 12, 2020, 10:20:03 PM8/12/20
to Beancount
I tried to upgrade beancount but got a bunch of errors like

Building wheel for beancount (setup.py) ... error
ERROR: Command errored out with exit status 1:
...
fatal: not a git repository (or any of the parent directories): .git
...
beancount/parser/parser.c(336): error C2198: 'PyUnicode_FromString': too few arguments for call

The full output is at https://pastebin.com/raw/2tCvbmbT.  Any ideas?

Thanks,
Steve

Daniele Nicolodi

unread,
Aug 12, 2020, 10:53:52 PM8/12/20
to bean...@googlegroups.com
On 12/08/2020 20:20, Steve Kobes wrote:
> I tried to upgrade beancount but got a bunch of errors like
>
> Building wheel for beancount (setup.py) ... error
> ERROR: Command errored out with exit status 1:
> ...
> fatal: not a git repository (or any of the parent directories): .git
> ...
> beancount/parser/parser.c(336): error C2198: 'PyUnicode_FromString': too
> few arguments for call

You must likely didn't get a bunch of errors like the above, but just
one instance of it. Please be precise when reporting issues.

Unfortunately the last release contains a bug that makes compilation
fail on Windows because of the behavior of the Microsoft Visual C
compiler. None of the persons actively contributing to beancount use it
on Windows, thus this kind of bugs can slip in.

Please build the latest version from the v2 branch on Github. If you are
not familiar with git you can easily download the source code from
Github via this link:

https://github.com/beancount/beancount/archive/v2.zip

Unzip the archive ans run 'python setup.py install' in the sources
directory.

Cheers,
Dan

Steve Kobes

unread,
Aug 12, 2020, 11:09:48 PM8/12/20
to bean...@googlegroups.com
Thanks for your response.

On Wed, 12 Aug 2020 at 22:53, Daniele Nicolodi <dan...@grinta.net> wrote:
You must likely didn't get a bunch of errors like the above, but just
one instance of it. Please be precise when reporting issues.

I apologize for the imprecision.  There are 809 lines of output, 10 of which contain the word "error".  However, I cannot say with confidence whether they are 10 instances of the same error, or if they represent two or more unrelated errors.  The full output can be examined at the link that I posted.

Please build the latest version from the v2 branch on Github. If you are
not familiar with git you can easily download the source code from
Github via this link:

https://github.com/beancount/beancount/archive/v2.zip

Unzip the archive ans run 'python setup.py install' in the sources
directory.

I have cloned the git repository and attempted this command.  It fails with different errors, a few of which I have pasted below.  The full output is at: https://pastebin.com/raw/vVzUJGEt

beancount/parser/lexer.l(279): error C2059: syntax error: '{'
beancount/parser/lexer.l(279): error C2143: syntax error: missing ';' before ')'beancount/parser/lexer.l(298): warning C4003: not enough arguments for function-like macro invocation 'build_STR'
beancount/parser/lexer.l(298): error C2059: syntax error: ')'
beancount/parser/lexer.l(304): warning C4003: not enough arguments for function-like macro invocation 'build_STRING'
beancount/parser/lexer.l(304): error C2059: syntax error: ','

Cheers,
Steve

Chary Chary

unread,
Aug 13, 2020, 4:55:06 AM8/13/20
to Beancount

None of the persons actively contributing to beancount use it
on Windows, thus this kind of bugs can slip in.

Am I correct, that all of the active contributors use Linux?
If so, any particular distribution recommended?

Based on the documentation I think Martin uses Ubuntu (or may be Goobuntu)
 

Martin Blais

unread,
Aug 13, 2020, 8:59:02 AM8/13/20
to Beancount
Definitely not Goobuntu (work and play are always rigorously separated by time, machines, and idea domains).
I use Ubuntu stable myself (will soon update to 2020-040, but any Linux platform should equivalently work.

I don't deal with Windows (life's too short), but I'm always happy to apply a patch if you do.
Send me a PR,



 
-- 
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/44c8fc56-e8cd-4c9b-a504-03a1aa03c6fen%40googlegroups.com.

Daniele Nicolodi

unread,
Aug 13, 2020, 4:21:22 PM8/13/20
to bean...@googlegroups.com
This has not been reported before. The code compiles and the tests pass
on Linux and macOS, thus I think there may be some other weirdness in
the MSVC compiler. I'll have a look at this when I'll have a spare minute.

Cheers,
Dan

Daniele Nicolodi

unread,
Aug 14, 2020, 12:46:36 AM8/14/20
to bean...@googlegroups.com
On 13/08/2020 02:55, Chary Chary wrote:
>
> None of the persons actively contributing to beancount use it
> on Windows, thus this kind of bugs can slip in.
>
>
> Am I correct, that all of the active contributors use Linux?

I run macOS and Debian GNU/Linux. The CI infrastructure runs on Linux,
thus Linux should be well tested. I started the effort to make the tests
run on Windows and to setup CI on Windows via AppVeyor, but a lot of
tests depend on '/' being the filesystem path separator and adjusting
them all is tedious work

> If so, any particular distribution recommended?

The distribution should not matter, as long as it has a recent enough
version of Python (easy, the minimum requirement is 3.6, which is
relatively old). Since a little while we also require a fairly recent
version of Bison, thus if you want to regenerate the grammar from it
Bison definition you need at least Bison 3.6.

Cheers,
Dan

Daniele Nicolodi

unread,
Aug 14, 2020, 1:00:52 AM8/14/20
to bean...@googlegroups.com
The only thing I can think about that may cause this, it the use of BOOL
as a lexer token name and thus as a enum value in the lexer. BOOL
actually appears some lines before the reported error location, but
somehow the compiler gets confused.

I don't know if there is an elegant way to fix this. At least I would
need to know which header included in lexer.l (and thus is the generated
lexer.[ch]) pulls in BaseTsd.h, WinDef.h, or WinNT.h (unfortunately
Microsoft documentation is not clear on which of those headers defines
BOOL).

If someone with access to Microsoft compiler can check this, I'll
implement a workaround.

Cheers,
Dan

Steve Kobes

unread,
Aug 14, 2020, 5:52:36 PM8/14/20
to bean...@googlegroups.com
Hi, I've sent PR #538 for this issue.

Thanks,
Steve

--
You received this message because you are subscribed to a topic in the Google Groups "Beancount" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beancount/UmB3yWDKiTw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beancount+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/f464cf10-c879-3ce3-98ec-edc09adaea4e%40grinta.net.

Martin Blais

unread,
Aug 14, 2020, 6:26:03 PM8/14/20
to Beancount
Thank you

You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CALFNW778j2RFp5tcs7bAP-BG9RKwqvCaWeOqO_%2B0miYa5gqmpg%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages