Skip to content

Commit

Permalink
Fix the CI badge and fully rewrite all the workflows to make sense ##…
Browse files Browse the repository at this point in the history
…build

* Windows, Linux, Static, macOS, Android, iOS builds published for every commit
* Kept coverage, coverity, fuzzing tests, lgtm and -Werror jobs
* Kill the continuos, the over-engineered matrix and other empty or unnecessary tasks (250 vs 900LOC)
* Jobs TODO: fatmac, termux and rpm (centos) packages
  • Loading branch information
trufae authored Jan 12, 2021
1 parent 2eb847f commit 1184610
Show file tree
Hide file tree
Showing 29 changed files with 252 additions and 911 deletions.
935 changes: 180 additions & 755 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

59 changes: 0 additions & 59 deletions .github/workflows/continuous.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .github/workflows/labeler.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/newshell-treesitter-tests.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
--pancake
```

| **Build&Test** |[![Tests Status](https://github.com/radareorg/radare2/workflows/Radare2%20CI/badge.svg)](https://github.com/radareorg/radare2/actions?query=workflow%3A%22Radare2+CI%22) | [![Build Status](https://travis-ci.com/radareorg/radare2.svg?branch=master)](https://travis-ci.com/radareorg/radare2)|
| **Build&Test** | [![Tests Status](https://github.com/radareorg/radare2/workflows/Continuous%20build/badge.svg)](https://github.com/radareorg/radare2/actions?query=workflow%3A%22Continuous+build%22) | [![Build Status](https://travis-ci.com/radareorg/radare2.svg?branch=master)](https://travis-ci.com/radareorg/radare2)|
|----------|------|--------|
| **CodeQuality** | [![Build Status](https://scan.coverity.com/projects/416/badge.svg)](https://scan.coverity.com/projects/416) | [![Total alerts](https://img.shields.io/lgtm/alerts/g/radareorg/radare2.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/radareorg/radare2/alerts/) |
| **Coverage** | [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/741/badge)](https://bestpractices.coreinfrastructure.org/projects/741) | [![codecov](https://codecov.io/gh/radareorg/radare2/branch/master/graph/badge.svg)](https://codecov.io/gh/radareorg/radare2) |
Expand Down
1 change: 1 addition & 0 deletions binr/blob/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ include ../../shlr/ar/deps.mk
include ../../shlr/sdb.mk
include ../../shlr/capstone.mk
include ../../shlr/radare2-shell-parser-deps.mk
LINK+=$(SHLR)/tcc/libr_tcc.a

all: symlinks

Expand Down
6 changes: 0 additions & 6 deletions dist/plugins-cfg/plugins.static.nogpl.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ anal.mips_cs
anal.mips_gnu
anal.nios2
anal.null
anal.ppc_cs
anal.ppc_gnu
anal.sh
anal.sparc_cs
anal.sparc_gnu
Expand Down Expand Up @@ -57,8 +55,6 @@ asm.malbolge
asm.mips_cs
asm.mips_gnu
asm.nios2
asm.ppc_cs
asm.ppc_gnu
asm.propeller
asm.riscv
asm.lanai_gnu
Expand Down Expand Up @@ -130,7 +126,6 @@ bin.psxexe
bp.arm
bp.bf
bp.mips
bp.ppc
bp.x86
core.a2f
core.java
Expand Down Expand Up @@ -201,7 +196,6 @@ parse.att2intel
parse.dalvik_pseudo
parse.m68k_pseudo
parse.mips_pseudo
parse.ppc_pseudo
parse.sh_pseudo
parse.avr_pseudo
parse.wasm_pseudo
Expand Down
16 changes: 10 additions & 6 deletions radare2.spec → dist/rpm/radare2.spec
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
%global gituser radare
%global gituser radareorg
%global gitname radare2
#global commit a093958b6d24015d82782eb20a2e10d8f4afcd85
%global commit 5a3dab0a86e1452c0bb0c13d869f95b41f50b9a9
#global commit 5a3dab0a86e1452c0bb0c13d869f95b41f50b9a9
%global commit 5860c3efc12d4b75e72bdce4b1d3834599620913
%global shortcommit %(c=%{commit}; echo ${c:0:7})

Name: radare2
Version: 0.10.0
Version: 5.1.0
Release: 1%{?dist}
Summary: The %{name} reverse engineering framework
Group: Applications/Engineering
License: LGPLv3
URL: http://radare.org/
URL: https://www.radare.org/
#Source0: http://radare.org/get/%{name}-%{version}.tar.gz
#Source0: http://radare.org/get/%{name}-%{version}.tar.xz
Source0: https://github.com/%{gituser}/%{gitname}/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz
# Source0: https://github.com/%{gituser}/%{gitname}/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz
Source0: https://github.com/%{gituser}/%{gitname}/archive/%{commit}/%{name}-%{version}-git.tar.gz


BuildRequires: file-devel
Expand Down Expand Up @@ -106,6 +107,9 @@ cp shlr/sdb/src/libsdb.a %{buildroot}/%{_libdir}/libsdb.a


%changelog
* Sat Oct 10 2020 pancake <[email protected]> 5.1.0
- update for latest centos8 and r2 codebase

* Sat Oct 10 2015 Michal Ambroz <rebus at, seznam.cz> 0.10.0-1
- build for Fedora for alpha of 0.10.0

Expand Down
4 changes: 2 additions & 2 deletions libr/anal/rtti_msvc.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ R_API void r_anal_rtti_msvc_print_base_class_descriptor(RVTableContext *context,

static bool rtti_msvc_print_complete_object_locator_recurse(RVTableContext *context, ut64 atAddress, int mode, bool strict) {
bool use_json = mode == 'j';
PJ *pj;
PJ *pj = NULL;

ut64 colRefAddr = atAddress - context->word_size;
ut64 colAddr;
Expand Down Expand Up @@ -606,7 +606,7 @@ static bool rtti_msvc_print_complete_object_locator_recurse(RVTableContext *cont
}
}

if(use_json) {
if (use_json) {
pj_end (pj);
}
}
Expand Down
2 changes: 1 addition & 1 deletion libr/anal/var.c
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@ R_API void r_anal_extract_rarg(RAnal *anal, RAnalOp *op, RAnalFunction *fcn, int
}
}
if (!vname) {
name = r_str_newf ("arg%zu", i + 1);
name = r_str_newf ("arg%u", (int)i + 1);
vname = name;
}
r_anal_function_set_var (fcn, delta, R_ANAL_VAR_KIND_REG, type, size, true, vname);
Expand Down
1 change: 0 additions & 1 deletion libr/bin/format/mach0/mach0_specs.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#ifndef _INCLUDE_R_BIN_MACH0_SPECS_H_
#define _INCLUDE_R_BIN_MACH0_SPECS_H_

Expand Down
4 changes: 3 additions & 1 deletion libr/core/cconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -3422,7 +3422,9 @@ R_API int r_core_config_init(RCore *core) {
#endif
free (p);
r_config_desc (cfg, "cfg.editor", "Select default editor program");
SETPREF ("cfg.user", r_sys_whoami (buf), "Set current username/pid");
char *whoami = r_sys_whoami ();
SETPREF ("cfg.user", whoami, "Set current username/pid");
free (whoami);
SETCB ("cfg.fortunes", "true", &cb_cfg_fortunes, "If enabled show tips at start");
SETCB ("cfg.fortunes.type", "tips,fun", &cb_cfg_fortunes_type, "Type of fortunes to show (tips, fun)");
SETBPREF ("cfg.fortunes.clippy", "false", "Use ?E instead of ?e");
Expand Down
1 change: 0 additions & 1 deletion libr/core/citem.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,3 @@ R_API void r_core_item_free (RCoreItem *ci) {
free (ci->data);
free (ci);
}

1 change: 0 additions & 1 deletion libr/core/visual.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ static const char *printfmtColumns[NPF] = {
"pCc", // PC// copypasteable views
};


// to print the stack in the debugger view
#define PRINT_HEX_FORMATS 10
#define PRINT_3_FORMATS 2
Expand Down
2 changes: 1 addition & 1 deletion libr/include/r_util/r_sys.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ R_API char *r_sys_getenv(const char *key);
R_API bool r_sys_getenv_asbool(const char *key);
R_API int r_sys_setenv(const char *key, const char *value);
R_API int r_sys_clearenv(void);
R_API char *r_sys_whoami(char *buf);
R_API char *r_sys_whoami(void);
R_API char *r_sys_getdir(void);
R_API int r_sys_chdir(const char *s);
R_API bool r_sys_aslr(int val);
Expand Down
3 changes: 3 additions & 0 deletions libr/util/sandbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@ R_API int r_sandbox_system(const char *x, int n) {
char *argv0 = r_file_path (argv[0]);
pid_t pid = 0;
int r = posix_spawn (&pid, argv0, NULL, NULL, argv, NULL);
if (r != 0) {
return -1;
}
int status;
int s = waitpid (pid, &status, 0);
return WEXITSTATUS (s);
Expand Down
26 changes: 16 additions & 10 deletions libr/util/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ R_API int r_sys_fork(void) {
#endif
}

#if HAVE_SIGACTION
#if __WINDOWS__
R_API int r_sys_sigaction(int *sig, void (*handler) (int)) {
return -1;
}
#elif HAVE_SIGACTION
R_API int r_sys_sigaction(int *sig, void (*handler) (int)) {
struct sigaction sigact = { };
int ret, i;
Expand All @@ -171,7 +175,6 @@ R_API int r_sys_sigaction(int *sig, void (*handler) (int)) {
return ret;
}
}

return 0;
}
#else
Expand Down Expand Up @@ -1237,15 +1240,18 @@ R_API void r_sys_set_environ(char **e) {
env = e;
}

R_API char *r_sys_whoami (char *buf) {
char _buf[32];
int uid = getuid ();
int hasbuf = (buf)? 1: 0;
if (!hasbuf) {
buf = _buf;
R_API char *r_sys_whoami(void) {
char buf[32];
#if __WINDOWS__
DWORD buf_sz = sizeof (buf);
if (!GetUserName(buf, (LPDWORD)&buf_sz) ) {
return strdup ("?");
}
sprintf (buf, "uid%d", uid);
return hasbuf? buf: strdup (buf);
#else
int uid = getuid ();
snprintf (buf, sizeof (buf), "uid%d", uid);
#endif
return strdup (buf);
}

R_API int r_sys_getpid(void) {
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ install_headers(sdb_inc_files, install_dir: join_paths(r2_incdir, 'sdb'))
libr2sdb = static_library('r2sdb', sdb_files,
include_directories: sdb_inc,
implicit_include_directories: false,
c_args: host_machine.system() == 'windows' ? '-DSDB_API=__declspec(dllexport)' : [],
c_args: host_machine.system() == 'windows' ? '-DSDB_IPI= -DSDB_API=__declspec(dllexport)' : [],
)

sdb_dep = declare_dependency(
Expand Down
3 changes: 3 additions & 0 deletions shlr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ $(SDB_LIBA):
$(MAKE) sdb-target

sdbs: $(SDB_HOST)
$(MAKE) $(SDB_LIBA)

sdb-host:
@echo
Expand All @@ -139,6 +140,7 @@ sdb-host:
$(MAKE) -C sdb/src "CC=${HOST_CC}" LDFLAGS='${HOST_LDFLAGS}' CPPFLAGS='' CFLAGS='${HOST_CFLAGS} ${PIC}' bin
cp -f sdb/src/sdb${BUILD_EXT_EXE} sdb/src/.sdb${BUILD_EXT_EXE}
cp -f sdb/src/sdb${BUILD_EXT_EXE} sdb/sdb$(BUILD_EXT_EXE)
rm -f $(SDB_LIBA)
-file sdb/sdb$(BUILD_EXT_EXE)

sdb-target:
Expand Down Expand Up @@ -373,6 +375,7 @@ spp-sync sync-spp:
spp: spp-sync
CFLAGS="-DUSE_R2=1 -I../../libr/include -DHAVE_FORK=${HAVE_FORK} -fPIC" $(MAKE) -C spp r2lib

SHLRS+=tcc/libr_tcc.a
SHLRS+=ar/libr_ar.a
SHLRS+=bochs/lib/libbochs.a
SHLRS+=capstone/libcapstone.a
Expand Down
5 changes: 5 additions & 0 deletions shlr/sdb/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ endif
${AR} q libsdb.a ${OBJ}
${RANLIB} libsdb.a

ifeq ($(CC),tcc)
libsdb.${SOVER}:
@echo TCC doesnt support shared libs on macos
else
libsdb.${SOVER}: sdb_objs2
endif
ifneq ($(EXT_SO),${SOVER})
ln -fs libsdb.${SOVER} libsdb.${EXT_SO}
endif
Expand Down
1 change: 1 addition & 0 deletions shlr/sdb/src/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

// Copied from https://gcc.gnu.org/wiki/Visibility
#ifndef SDB_API
#undef SDB_IPI
#if defined _WIN32 || defined __CYGWIN__
#ifdef __GNUC__
#define SDB_API __attribute__ ((dllexport))
Expand Down
2 changes: 1 addition & 1 deletion sys/build-shlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

rm -rf shlr/capstone
make mrproper
cp -f plugins.static.nogpl.cfg plugins.cfg
cp -f dist/plugins-cfg/plugins.static.nogpl.cfg plugins.cfg
./configure --prefix=/usr --with-libr
make -j4
Loading

0 comments on commit 1184610

Please sign in to comment.