-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[Support] Better error msg when cache dir can't be created. #69575
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4a8f402
[Support] Better error msg when cache dir can't be created.
tru c63d11b
Fix formatting
tru d7d4b00
Add test (wip)
tru 799f0bc
Fix test on crash
tru 700988f
Formatting
tru 6c12034
More fixes
tru 3353fee
Fix test case casing
tru b6aa73c
Fix test case comment
tru ec99549
Check specific error as suggested by aeubanks
tru File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
; REQUIRES: x86 | ||
;; Not supported on windows since we use permissions to deny the creation | ||
; UNSUPPORTED: system-windows | ||
|
||
; RUN: opt -module-hash -module-summary %s -o %t.o | ||
; RUN: opt -module-hash -module-summary %p/Inputs/lto-cache.ll -o %t2.o | ||
; RUN: rm -Rf %t.cache && mkdir %t.cache | ||
; RUN: chmod 444 %t.cache | ||
|
||
;; Check emit warnings when we can't create the cache dir | ||
; RUN: not --crash lld-link /lldltocache:%t.cache/nonexistant/ /out:%t3 /entry:main %t2.o %t.o 2>&1 | FileCheck %s | ||
; CHECK: LLVM ERROR: can't create cache directory {{.*}}/nonexistant/: Permission denied | ||
|
||
target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" | ||
target triple = "x86_64-pc-windows-msvc" | ||
|
||
define void @globalfunc() #0 { | ||
entry: | ||
ret void | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://maskray.me/blog/2021-08-08-toolchain-testing#the-test-checks-at-the-wrong-layer
A better test is llvm-lto2 --cache-dir in
llvm/test/ThinLTO/X86
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My first iteration was there - but it doesn't seem to follow the same code path, I never got the error message that I got from lld-link.
I will merge this now, since a test is better than no test - but I might follow up with a test in the llvm layer when I do the changes to report_fatal_error if people think that's a good change.