Skip to content

Instantly share code, notes, and snippets.

<?php
define('DISABLE_WP_CRON', true);
require_once "wp-load.php";
add_filter("pre_get_table_charset", "fail_in_get_table_charset", 10);
/*
simulate possible failure in
<?php
require_once "wp-load.php";
require_once "wp-admin/includes/admin.php";
require_once "wp-content/themes/Avada/framework/plugins/importer/importer.php";
// needs to be a valid admin user id, get the users/ids with $ wp user list
wp_set_current_user(1);
// check wp-content/themes/Avada/framework/plugins/importer/importer.php for
"-fno-stack-protector"
"-DTABLES_NEXT_TO_CODE"
"-Wl,--hash-size=31"
"-Wl,--reduce-memory-overheads"
"-Wl,--no-as-needed"
"-Wl,-rpath,/nix/store/f7vx8hiig8sgs8wg91jy657x4w1v9zaz-HStringTemplate-0.8.6/lib/ghc-8.0.2/x86_64-linux-ghc-8.0.2"
"-Wl,-rpath,/nix/store/8n2w198k0hdh7j963f7q78r3w0gkvbzk-HTTP-4000.3.7/lib/ghc-8.0.2/x86_64-linux-ghc-8.0.2"
"-Wl,-rpath,/nix/store/cymsywsg483paw8m180b6pizmxvj2jc8-X11-1.8/lib/ghc-8.0.2/x86_64-linux-ghc-8.0.2"
"-Wl,-rpath,/nix/store/syw9bzp2jah5w2l1hwjb7ck6bnh2fww1-X11-xft-0.3.1/lib/ghc-8.0.2/x86_64-linux-ghc-8.0.2"
"-Wl,-rpath,/nix/store/70w0pvn5fxxq5n2ccfjkxww8yrx39qs4-ghc-8.0.2/lib/ghc-8.0.2/array-0.5.1.1"
30612 stat("/tmp/ghc30612_0/ghc_2.rsp", 0x7fc91317c0a0) = -1 ENOENT (No such file or directory)
30612 open("/tmp/ghc30612_0/ghc_2.rsp", O_WRONLY|O_CREAT|O_NOCTTY|O_NONBLOCK, 0666) = 3
30612 fstat(3, {st_dev=makedev(253, 1), st_ino=1547587, st_mode=S_IFREG|0664, st_nlink=1, st_uid=1000, st_gid=1000, st_blksize=4096, st_blocks=0, st_size=0, st_atime=2017/06/14-17:48:47.795859046, st_mtime=2017/0
6/14-17:48:47.795859046, st_ctime=2017/06/14-17:48:47.795859046}) = 0
30612 ftruncate(3, 0) = 0
30612 ioctl(3, TCGETS, 0x7fff3a5e8e00) = -1 ENOTTY (Inappropriate ioctl for device)
30612 write(3, "\"-fno-stack-protector\"\n\"-DTABLES_NEXT_TO_CODE\"\n\"-fno-stack-protector\"\n\"-Wall\"\n\"-Wextra\"\n\"-Wstrict-prototypes\"\n\"-Wmissing-prototypes\"\n\"-Wmissing-declarations\"\n\"-Winline\"\n\"-Waggregate-return\"\n\"-Wpointer-arith\"\n\"-Wmissing-noreturn\"\n\"-Wnested-externs\"\n\"-Wredundant-decls\"\n\"-Iincludes\"\n\"-Iincludes/dist\"\n\"-Iincludes/dist-derivedconstants/header\"\n\"-Iincludes/dist-gh
"-fno-stack-protector"
"-DTABLES_NEXT_TO_CODE"
"-fno-stack-protector"
"-Wall"
"-Wextra"
"-Wstrict-prototypes"
"-Wmissing-prototypes"
"-Wmissing-declarations"
"-Winline"
"-Waggregate-return"
these derivations will be built:
/nix/store/w7lcawxd9vjssavbznnjaksp63ih2c0z-bootstrap-gcc-wrapper.drv
/nix/store/4q1j6nmrw2hh9z2cfmpgygvqhz627iqi-stdenv-linux-boot.drv
/nix/store/dbbzvfc05h95g44w6x781p5jb54b7a5k-perl-5.24.1.drv
/nix/store/anjkzzsh2nbnph63nqrb6d1g9piwwv6z-gnum4-1.4.18.drv
/nix/store/p3gd221mq77l4lhh0gchm590vaar9vwc-bison-3.0.4.drv
/nix/store/wjpd2m4r1h51j1nszzl9iiympxqrhhbm-zlib-1.2.11.drv
/nix/store/p5pb9daddv5ginrsmx9xy85mqwj1c01h-binutils-2.28.drv
/nix/store/b0m8msf6w9y5v5yfhdv3rbl9bm80hyc5-bootstrap-gcc-wrapper.drv
/nix/store/9ig45cjc1sg6i48apx6dcmdfi5sr1ji0-stdenv-linux-boot.drv
@pbogdan
pbogdan / haskell-disable-tests
Last active May 7, 2021 10:04
Disable tests for a Haskell package in Nix.
for ghc802 specifically:
nixpkgs.config.packageOverrides = pkgs:
{
haskell = pkgs.haskell // {
packages = pkgs.haskell.packages // {
ghc802 = pkgs.haskell.packages.ghc802.override {
overrides = self: super:
{
ghc-syb-utils = pkgs.haskell.lib.dontCheck super.ghc-syb-utils;
===== Parsed Source ==================================
(L {test/test-cases/GithubIssue9.hs:1:1}
(HsModule
(Just
(L {test/test-cases/GithubIssue9.hs:2:8-19} {ModuleName: GithubIssue9}))
(Nothing)
[
(L {test/test-cases/GithubIssue9.hs:4:1-26}
(ImportDecl
nixpkgs.config.packageOverrides = pkgs:
{
haskellPackages = pkgs.haskellPackages.override {
overrides = self: super:
{
apply-refact = pkgs.haskell.lib.overrideCabal super.apply-refact (drv: {version = ".."; sha256 = ".."; });
};
};
};