A compound of formula I or a pharmaceutically acceptable salt thereof, wherein R 1 is phenyl optionally substituted with 1 to 5 substituents independently selected from the group consisting of C 1-4 alkyl, C 1-4 alkoxy, cyano, halo, trifluoromethyl, and trifluoromethoxy; X 1 is N and X 2 is CH; or X 1 is CH and X 2 is N; or X 1 is N and X 2 is N; when X 1 is N, Z is selected from the group consisting of C 1 alkylene, C 1 haloalkylene, -C -, and -S 2 -; when X 1 is CH, Z is selected from the group consisting of C 1 alkylene, C 1 haloalkylene, -O-, -C -, -NH-, -S-, -S -, and -S 2 -; q is 1; s is 1; R 2 is -NR 6 R 7; R 3, each time taken, is independently selected from the group consisting of C 1-6 alkyl, C 3-8 cycloalkyl, and trifluoromethyl; p is 0, 1, or 2; R 4, each time taken, is independently selected from the group consisting of C 1-6 alkyl, cyano, hydroxy, halo, C 3-6 heterocyclyl, -C -R 8, -C -N(R 9)(R 10), and -C -OR 11; r is 1 or 2; R 6 is hydrogen; R 7 is selected from the group consisting of C 1-6 alkyl, C 3-8 cycloalkyl, and C 3-6 heterocyclyl; R 8 is selected from the group consisting of hydrogen, C 1-6 alkyl, C 3-8 cycloalkyl, C 6-10 aryl, C 1-10 heteroaryl, and C 3-6 heterocyclyl; R 9 is selected from the group consisting of hydrogen and C 1-6 alkyl; R 10 is selected from the group consisting of hydrogen, C 1-6 alkyl and C 3-8 cycloalkyl; or R 9 and R 10 are taken together with the nitrogen to which they are attached to form a 4 to 7 membered, saturated ring optionally having 1 additional ring heteroatom selected from the group N, O, and S and optionally substituted on any of the ring carbon atoms with 1 to 5 substituents independently selected from the group consisting of cyano, halo, hydroxy, amino, C 3-6 heterocyclyl, C 1-9 amide, C 1-6 alkyl, and C 1-4 alkoxy and substituted on any additional ring nitrogen by a substituent selected from the group consisting of hydrogen, C 3-8 cycloalkyl, and C 1-6 alkyl; and R 11 is selected from the group consisting of hydrogen, C 1-6 alkyl, and C 3-8 cycloalkyl; provided the compound of formula I is not dimethyl 5-(4-(2,4-difluorophenoxy)piperidin-1-yl)-6-(isopropylamino)pyrazine-2,3-dicarboxylate and is not 5-(4-(2,4-difluorophenoxy)piperidin-1-yl)-6-(isopropylamino)pyrazine-2,3-dicarbaldehyde. R 1 is phenyl optionally substituted with 1 to 5 substituents independently selected from the group consisting of C 1-4 alkyl, C 1-4 alkoxy, cyano, halo, trifluoromethyl, and trifluoromethoxy; X 1 is N and X 2 is CH; or X 1 is CH and X 2 is N; or X 1 is N and X 2 is N; when X 1 is N, Z is selected from the group consisting of C 1 alkylene, C 1 haloalkylene, -C -, and -S 2 -; when X 1 is CH, Z is selected from the group consisting of C 1 alkylene, C 1 haloalkylene, -O-, -C -, -NH-, -S-, -S -, and -S 2 -; q is 1; s is 1; R 2 is -NR 6 R 7; R 3, each time taken, is independently selected from the group consisting of C 1-6 alkyl, C 3-8 cycloalkyl, and trifluoromethyl; p is 0, 1, or 2; R 4, each time taken, is independently selected from the group consisting of C 1-6 alkyl, cyano, hydroxy, halo, C 3-6 heterocyclyl, -C -R 8, -C -N(R 9)(R 10), and -C -OR 11; r is 1 or 2; R 6 is hydrogen; R 7 is selected from the group consisting of C 1-6 alkyl, C 3-8 cycloalkyl, and C 3-6 heterocyclyl; R 8 is selected from the group consisting of hydrogen, C 1-6 alkyl, C 3-8 cycloalkyl, C 6-10 aryl, C 1-10 heteroaryl, and C 3-6 heterocyclyl; R 9 is selected from the group consisting of hydrogen and C 1-6 alkyl; R 10 is selected from the group consisting of hydrogen, C 1-6 alkyl and C 3-8 cycloalkyl; or R 9 and R 10 are taken together with the nitrogen to which they are attached to form a 4 to 7 membered, saturated ring optionally having 1 additional ring heteroatom selected from the group N, O, and S and optionally substituted on any of the ring carbon atoms with 1 to 5 substituents independently selected from the group consisting of cyano, halo, hydroxy, amino, C 3-6 heterocyclyl, C 1-9 amide, C 1-6 alkyl, and C 1-4 alkoxy and substituted on any additional ring nitrogen by a substituent selected from the group consisting of hydrogen, C 3-8 cycloalkyl, and C 1-6 alkyl; and R 11 is selected from the group consisting of hydrogen, C 1-6 alkyl, and C 3-8 cycloalkyl;