Commit 7116e76 1 parent 317ae34 commit 7116e76 Copy full SHA for 7116e76
File tree 6 files changed +32
-11
lines changed
megarepo_api/megarepo_error/src
6 files changed +32
-11
lines changed Original file line number Diff line number Diff line change 10
10
branches :
11
11
- main
12
12
13
+ permissions :
14
+ contents : read # to fetch code (actions/checkout)
15
+
13
16
jobs :
14
17
build :
15
18
runs-on : ubuntu-20.04
16
19
steps :
17
- - uses : actions/checkout@v2
20
+ - uses : actions/checkout@v4
18
21
- name : Show disk space at start
19
22
run : df -h
20
23
- name : Free up disk space
@@ -25,10 +28,10 @@ jobs:
25
28
run : sudo apt-get update
26
29
- name : Install system deps
27
30
run : sudo python3 build/fbcode_builder/getdeps.py --allow-system-packages install-system-deps --recursive mononoke
31
+ - name : Install packaging system deps
32
+ run : sudo python3 build/fbcode_builder/getdeps.py --allow-system-packages install-system-deps --recursive patchelf
28
33
- name : Install Rust Stable
29
34
uses : dtolnay/rust-toolchain@stable
30
- - name : Fetch lld
31
- run : python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests lld
32
35
- name : Fetch ninja
33
36
run : python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests ninja
34
37
- name : Fetch cmake
89
92
run : python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests fb303
90
93
- name : Fetch rust-shed
91
94
run : python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests rust-shed
92
- - name : Build lld
93
- run : python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests lld
94
95
- name : Build ninja
95
96
run : python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests ninja
96
97
- name : Build cmake
Original file line number Diff line number Diff line change 10
10
branches :
11
11
- main
12
12
13
+ permissions :
14
+ contents : read # to fetch code (actions/checkout)
15
+
13
16
jobs :
14
17
build :
15
18
runs-on : macOS-latest
16
19
steps :
17
- - uses : actions/checkout@v2
20
+ - uses : actions/checkout@v4
18
21
- name : Show disk space at start
19
22
run : df -h
20
23
- name : Free up disk space
Original file line number Diff line number Diff line change 7
7
8
8
#![ feature( error_generic_member_access) ]
9
9
#![ feature( iterator_try_reduce) ]
10
- #![ feature( provide_any) ]
11
10
12
11
pub mod mode;
13
12
Original file line number Diff line number Diff line change 6
6
*/
7
7
8
8
#![ feature( error_generic_member_access) ]
9
- #![ feature( provide_any) ]
10
9
11
10
use std:: backtrace:: BacktraceStatus ;
12
11
use std:: convert:: Infallible ;
@@ -21,6 +20,9 @@ use thiserror::Error;
21
20
pub mod macro_reexport {
22
21
pub use anyhow:: anyhow;
23
22
}
23
+ // The cargo build of anyhow disables its backtrace features when using RUSTC_BOOTSTRAP=1
24
+ #[ cfg( not( fbcode_build) ) ]
25
+ pub static DISABLED : std:: backtrace:: Backtrace = std:: backtrace:: Backtrace :: disabled ( ) ;
24
26
25
27
#[ macro_export]
26
28
macro_rules! cloneable_error {
@@ -29,9 +31,15 @@ macro_rules! cloneable_error {
29
31
pub struct $name( pub :: std:: sync:: Arc <anyhow:: Error >) ;
30
32
31
33
impl $name {
34
+ #[ cfg( fbcode_build) ]
32
35
pub fn backtrace( & self ) -> & :: std:: backtrace:: Backtrace {
33
36
self . 0 . backtrace( )
34
37
}
38
+
39
+ #[ cfg( not( fbcode_build) ) ]
40
+ pub fn backtrace( & self ) -> & :: std:: backtrace:: Backtrace {
41
+ & $crate:: DISABLED
42
+ }
35
43
}
36
44
37
45
impl :: std:: fmt:: Display for $name {
@@ -51,6 +59,7 @@ macro_rules! cloneable_error {
51
59
Some ( & * * self . 0 )
52
60
}
53
61
62
+ #[ cfg( fbcode_build) ]
54
63
fn provide<' a>( & ' a self , demand: & mut :: std:: any:: Demand <' a>) {
55
64
demand. provide_ref:: <:: std:: backtrace:: Backtrace >( self . backtrace( ) ) ;
56
65
}
Original file line number Diff line number Diff line change 5
5
* GNU General Public License version 2.
6
6
*/
7
7
8
- use std:: any:: Demand ;
9
8
use std:: backtrace:: Backtrace ;
10
9
use std:: convert:: Infallible ;
11
10
use std:: error:: Error as StdError ;
@@ -30,10 +29,20 @@ use crate::path::MononokePath;
30
29
#[ derive( Clone , Debug ) ]
31
30
pub struct InternalError ( Arc < Error > ) ;
32
31
32
+ // The cargo build of anyhow disables its backtrace features when using RUSTC_BOOTSTRAP=1
33
+ #[ cfg( not( fbcode_build) ) ]
34
+ static DISABLED : Backtrace = Backtrace :: disabled ( ) ;
35
+
33
36
impl InternalError {
37
+ #[ cfg( fbcode_build) ]
34
38
pub fn backtrace ( & self ) -> & Backtrace {
35
39
self . 0 . backtrace ( )
36
40
}
41
+
42
+ #[ cfg( not( fbcode_build) ) ]
43
+ pub fn backtrace ( & self ) -> & Backtrace {
44
+ & DISABLED
45
+ }
37
46
}
38
47
39
48
impl fmt:: Display for InternalError {
@@ -53,7 +62,8 @@ impl StdError for InternalError {
53
62
Some ( & * * self . 0 )
54
63
}
55
64
56
- fn provide < ' a > ( & ' a self , demand : & mut Demand < ' a > ) {
65
+ #[ cfg( fbcode_build) ]
66
+ fn provide < ' a > ( & ' a self , demand : & mut :: std:: any:: Demand < ' a > ) {
57
67
demand. provide_ref :: < Backtrace > ( self . backtrace ( ) ) ;
58
68
}
59
69
}
Original file line number Diff line number Diff line change 6
6
*/
7
7
8
8
#![ feature( error_generic_member_access) ]
9
- #![ feature( provide_any) ]
10
9
#![ feature( trait_alias) ]
11
10
12
11
use std:: sync:: Arc ;
You can’t perform that action at this time.
0 commit comments