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

Meaningful error for extra whitespaces #150

Closed
wallento opened this issue Apr 21, 2017 · 3 comments
Closed

Meaningful error for extra whitespaces #150

wallento opened this issue Apr 21, 2017 · 3 comments
Labels

Comments

@wallento
Copy link
Collaborator

If the user accidentally adds a whitespace in a filelist between the filename and the attributes, the error (exception) is not very helpful.

Correct:

[fileset dpi]
    file_type = cppSource
    usage = sim verilator
    files =
      dpi/myheader.h[is_include_file]

Incorrect:

[fileset dpi]
    file_type = cppSource
    usage = sim verilator
    files =
      dpi/myheader.h [is_include_file]

In the incorrect case, fusesoc takes the whitespace as the separator and an empty filename with the attribute leading to the exception:

IOError: [Errno 21] Is a directory: '/path/to/module/'

It would be more helpful to throw an error like "empty filename, did you add an extra space between the filename and the attribute?"

@ghost
Copy link

ghost commented May 9, 2017

I tried to reproduce the bug by using 'tests.test_common.get_core' on the 'tests/cores/mor1kx-generic' file, since it contains filenames with attributes. It completes without changes, fails as expected after adding some junk, but unexpectedly completes after adding a space between filename and attribute (e.g. "user_file [file_type=user])".

This is quite literally a first bug for me, so it could be an error on my end. I could some input; does the issue still exist?

@olofk
Copy link
Owner

olofk commented May 10, 2017

The problem still exists, but I figured out why it wasn't triggered. The file you chose to change is of type user, which means that it is just exported, but no backends include it in their configuration files. Also, the test_common module does not contain test cases, but helper functions for the other tests (maybe there's a better way to structure this. I'm quite new to pytest).

With that said, you can reproduce the problem for example by inserting the space in vlog_file.v[file_type=verilogSource] in tests/cores/misc/filetypes.core and run test_ise

Let me know if this works

@olofk
Copy link
Owner

olofk commented Feb 29, 2020

Closing this as CAPI1 has been deprecated for quite some time

@olofk olofk closed this as completed Feb 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants