Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dsv-0.7.0 breaks tests when using guix build #10

Closed
plattfot opened this issue Sep 16, 2023 · 3 comments
Closed

dsv-0.7.0 breaks tests when using guix build #10

plattfot opened this issue Sep 16, 2023 · 3 comments
Assignees

Comments

@plattfot
Copy link

Hi,

I recently started to use your library in one of my applications to parse csv files. It's been working flawlessly until recently when I did a guix pull and got 0.7.0. After that my tests for my application started failing when running them via guix build -f guix.scm. They work fine if I just run make check manually.

I checked the log for when the tests fail and this is the backtrace it gave me:

/gnu/store/7rscxhk9gzshkn6bq4nfrl9l6bp67w18-inetutils-2.3/bin/logger: cannot connect: No such file or directory
Backtrace:
           7 (primitive-load-path "tests/transaction.scm")
In ice-9/eval.scm:
   293:34  6 (_ #(#(#<directory (tests grade-transaction) 7ffff7…>) …))
In grade/transaction.scm:
    50:14  5 (parse-rbc-transactions #<input: string 7fffee8ac380> # _)
In dsv/rfc4180.scm:
   114:19  4 (dsv->scm _ #:debug-mode? _ #:delimiter _)
In smc/fsm.scm:
   465:31  3 (_ #<fsm current-state: read_first_field_first_char st…> …)
In ice-9/boot-9.scm:
   260:13  2 (for-each #<procedure 7ffff7533c30 at smc/core/log.scm…> …)
   260:13  1 (for-each #<procedure 7ffff7533c00 at smc/core/log.scm…> …)
In smc/core/log.scm:
    165:6  0 (_ _ _ _ _)

smc/core/log.scm:165:6: Could not log a message

In my parse-rbc-transaction procedure I'm using dsv as follows: (dsv->scm port #:format 'rfc4180)

If I understand it correctly guile-smc (which is a new dependency in 0.7.0) is trying to write to the syslog and failing. Which is expected as it is not setup when running via guix build. I checked the source code and dsv should only setup the logger if key argument #:log-driver for dsv->scm is not #f (making this assumption from this line in dsv.scm). And it is #f by default.

Is this a bug or am I missing something? Expected behavior is to not write anything to syslog or any logger for that matter.

Thanks

@artyom-poptsov artyom-poptsov self-assigned this Sep 16, 2023
@artyom-poptsov
Copy link
Owner

Hello, Fredrik!

If I understand it correctly guile-smc (which is a new dependency in 0.7.0) is trying to write to the syslog and failing. Which is expected as it is not setup when running via guix build. I checked the source code and dsv should only setup the logger if key argument #:log-driver for dsv->scm is not #f (making this assumption from this line in dsv.scm). And it is #f by default.

Not quite as if logger is set to #f then the default logger is used which is syslog. Please try to run dsv->scm as follows:

(dsv->scm port #:format 'rfc4180 #:log-driver "null")

And let me know what will happen.

Is this a bug or am I missing something? Expected behavior is to not write anything to syslog or any logger for that matter.

The aforementioned nuance that "syslog" is used by default is mentioned also in the Guile-DSV documentation.

But maybe it is a bug in the sense that Guile-DSV breaks user's workflow. Do you think that the logging should be disabled by default for dsv->scm?

Thanks,
avp

@plattfot
Copy link
Author

Hi,

Not quite as if logger is set to #f then the default logger is used which is syslog. Please try to run dsv->scm as follows:

(dsv->scm port #:format 'rfc4180 #:log-driver "null")

And let me know what will happen.

That solved it! Thanks.

The aforementioned nuance that "syslog" is used by default is mentioned also in the Guile-DSV documentation.

Ah, my bad I completely forgot to check the info manual. 🤦

But maybe it is a bug in the sense that Guile-DSV breaks user's workflow. Do you think that the logging should be disabled by default for dsv->scm?

It is a breaking change between 0.6.0 and 0.7.0 only if you are using guix to build (or anything else that isolates the environment). Apart from that it will not break user's workflow. Maybe just add a section in the README to highlight the behavior and then reference to the manual if users want to change the default behavior.

Thank you for an excellent library!

@artyom-poptsov
Copy link
Owner

I've added a note (see 636aaec) to the README.org about the logging configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants