Page MenuHomePhabricator

[libunwind] [test] Fix inferring source paths

Authored by mgorny on May 16 2019, 5:37 AM.



Fix two issues that caused libcxx source path not to be inferred
correctly when not specified explicitly:

  1. get_lit_conf() uses default value only if the lit variable is set to None. Due to the mehod of substituting, they were "" rather than None when unset, effectively causing the default never to apply. Instead, use 'or' construct to use the default whenever get_lit_conf() returns a false value.
  1. If os.path.join() is given a component starting with '/', it takes it to be an absolute path and ignores everything preceding it. Remove the slash to correctly append subdirectory.

With these two fixes, libunwind tests start working on NetBSD buildbot

Diff Detail


Event Timeline

mgorny created this revision.May 16 2019, 5:37 AM
krytarowski resigned from this revision.May 22 2019, 3:14 PM

It is probably fine.. but I will defer review to lit/libc++ maintainers.

mgorny edited reviewers, added: mstorsjo, phosek, compnerd; removed: krytarowski.May 26 2019, 2:51 AM

Ping. Could somebody review this, please? It's blocking NetBSD buildbot for quite some time already.

phosek accepted this revision.May 28 2019, 5:34 PM


27 ↗(On Diff #199799)

Can you use os.path.join(self.libunwind_src_root, '..', 'libcxx') to make it compatible with systems that don't use / as path separators?

This revision is now accepted and ready to land.May 28 2019, 5:34 PM
mgorny marked 2 inline comments as done.May 29 2019, 12:16 AM
mgorny added inline comments.
27 ↗(On Diff #199799)

Good catch. Will do.

This revision was automatically updated to reflect the committed changes.
mgorny marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptMay 29 2019, 12:17 AM