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

fix origin of raised EasyBuildError in logged error message #1249

Merged
merged 5 commits into from
Apr 9, 2015

Conversation

boegel
Copy link
Member

@boegel boegel commented Mar 31, 2015

update: now depends on hpcugent/vsc-base#165

fixes the issue discussed at https://github.com/hpcugent/easybuild-framework/pull/1218/files#r27470965

before:

$ eb foo.eb -ld
...
== 2015-03-31 21:13:22,460 main ERROR EasyBuild crashed with an error (at easybuild/tools/build_log.py:136 in _error_no_raise): Can't find path /Users/kehoste/work/easybuild-framework/foo.eb
ERROR: Can't find path /Users/kehoste/work/easybuild-framework/foo.eb

after:

$ eb foo.eb -ld
...
== 2015-03-31 21:12:33,311 main ERROR Can't find path /Users/kehoste/work/easybuild-framework/foo.eb (at easybuild/framework/easyconfig/tools.py:316 in parse_easyconfigs)
ERROR: Can't find path /Users/kehoste/work/easybuild-framework/foo.eb (at easybuild/framework/easyconfig/tools.py:316 in parse_easyconfigs)

@boegel
Copy link
Member Author

boegel commented Mar 31, 2015

@stdweird: please review

path_parts = frameinfo[1].split(os.path.sep)
relpath = path_parts.pop()
while not (relpath.startswith('easybuild/') or relpath.startswith('vsc/')) and path_parts:
relpath = os.path.join(path_parts.pop() or os.path.sep, relpath)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% happy with this, but couldn't find a better way after trying for a while.

Code golf: only retain the interesting part from something like /Users/kehoste/work/easybuild-framework/easybuild/tools/filetools.py, i.e. the easybuild/tools/filetools.py part.

@hpcugentbot
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1583/
Test PASSed.

@hpcugentbot
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1584/
Test PASSed.

msg = msg % args
# figure out where error was raised from
# current frame: this constructor, one frame above: location where this EasyBuildError was created/raised
frameinfo = inspect.getouterframes(inspect.currentframe())[1]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing remark by @stdweird: this is quite generic, so let's move it to vsc-base instead, and add support to LoggedException to disable this optionally (but have it enabled by default)

@hpcugentbot
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1610/
Test FAILed.

@hpcugentbot
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1611/
Test FAILed.

@hpcugentbot
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1612/
Test FAILed.

@stdweird
Copy link
Contributor

stdweird commented Apr 7, 2015

@boegel looks ok, merge whenever hpcugent/vsc-base#165 is ok

@boegel boegel merged commit f5e7423 into easybuilders:develop Apr 9, 2015
@boegel
Copy link
Member Author

boegel commented Apr 9, 2015

merged via #1260, thanks @stdweird for the review!

@boegel boegel deleted the fix_error_origin branch April 9, 2015 12:40
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

Successfully merging this pull request may close these issues.

3 participants