Skip to content

bpo-42207: Make llvm profile data location reference absolute #23037

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

Closed
wants to merge 1 commit into from

Conversation

serge-sans-paille
Copy link
Contributor

@serge-sans-paille serge-sans-paille commented Oct 30, 2020

Otherwise, when running the testsuite, test_peg_generator tries to compile C
code using the optimized flags and fails because it cannot find the profile
data.

https://bugs.python.org/issue42207

configure.ac Outdated
@@ -1460,8 +1460,8 @@ case $CC in
*clang*)
# Any changes made here should be reflected in the GCC+Darwin case below
PGO_PROF_GEN_FLAG="-fprofile-instr-generate"
PGO_PROF_USE_FLAG="-fprofile-instr-use=code.profclangd"
LLVM_PROF_MERGER="${LLVM_PROFDATA} merge -output=code.profclangd *.profclangr"
PGO_PROF_USE_FLAG="-fprofile-instr-use=$PWD/code.profclangd"
Copy link
Member

Choose a reason for hiding this comment

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

I would prefer to use $(abs_builddir): I am not sure that $PWD is portable on any shell.

Would you mind to add a comment referecing bpo-42207 to explain than an absolute path allows to run the test suite outside the build directory?

Is the problem that pegen uses "NODIST" variables like CFLAGS_NODIST and LDFLAGS_NODIST?

cc @stratakis @pablogsal @lysnikolaou

Copy link
Member

Choose a reason for hiding this comment

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

I would even prefer to deactivate this test on pgo builds or if detects that is running under a profile generation run given that it adds nothing useful and it takes a considerable time to execute.

Copy link
Member

Choose a reason for hiding this comment

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

test_peg_generator is not part of the default profile task (./python -m test --pgo: test_peg_generator is not part of Lib/test/libregrtest/pgo.py). The problem is once Python it built, running test_peg_generator outside the build directory fails, according to https://bugs.python.org/issue42207

Copy link
Member

@pablogsal pablogsal Nov 1, 2020

Choose a reason for hiding this comment

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

I know, what I am proposing is to skip it if it ever runs under a profile generation step

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I assume that the first approach will be without the "Monkey patch CFLAGS" part, no?

In that case, I think I prefer the first one, as this test is particularly heavy with absolutely no gain on profile-based builds, it will benefit folks running the full test suite for PGO

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pablogsal your assumption was correct. I picked that patch and updated the PR accordingly.

@pablogsal
Copy link
Member

(Not submitting against master because it's not needed for master)

How so? The master branch has exactly the same test and the same way of generating profile data.

@serge-sans-paille
Copy link
Contributor Author

(Not submitting against master because it's not needed for master)

How so? The master branch has exactly the same test and the same way of generating profile data.

oh, for some reasons these files were deleted on my local setup. Retargeting that PR to the master branch then

Otherwise, when running the testsuite, test_peg_generator tries to compile C
code using the optimized flags and fails because it cannot find the profile
data.

https://bugs.python.org/issue42207
@brettcannon
Copy link
Member

@serge-sans-paille can you open a new PR? When you rebase it messes up GitHub and then a ton of people get added as reviewers.

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

Successfully merging this pull request may close these issues.

6 participants