Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rpn_collab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
QSUE Team B
rpn_collab
Commits
e1f82972
Commit
e1f82972
authored
5 years ago
by
Padok
Browse files
Options
Downloads
Patches
Plain Diff
own nix derivation
parent
59331672
No related branches found
Branches containing commit
No related tags found
1 merge request
!26
Ci fixes
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
builder.sh
+6
-0
6 additions, 0 deletions
builder.sh
default.nix
+31
-14
31 additions, 14 deletions
default.nix
fuzz.nix
+12
-0
12 additions, 0 deletions
fuzz.nix
fuzz_seconds.sh
+7
-0
7 additions, 0 deletions
fuzz_seconds.sh
release.nix
+0
-33
0 additions, 33 deletions
release.nix
sudo
+1
-0
1 addition, 0 deletions
sudo
with
57 additions
and
47 deletions
builder.sh
0 → 100644
+
6
−
0
View file @
e1f82972
cp
-r
$src
/
*
./
make
mkdir
-p
$out
/bin/
cp
calc
$out
/bin/rpn.calculator
\ No newline at end of file
This diff is collapsed.
Click to expand it.
default.nix
+
31
−
14
View file @
e1f82972
with
import
(
import
./nixpkgs.nix
)
{};
stdenv
.
mkDerivation
{
name
=
"rpn-calculator"
;
src
=
./.
;
buildInputs
=
[
catch2
];
nativeBuildInputs
=
[
afl
];
doCheck
=
true
;
checkTarget
=
"run_test"
;
installPhase
=
''
mkdir -p $out
find . -executable -type f -exec cp {} $out \;
''
;
#with import (import ./nixpkgs.nix) {};
with
import
<
nixpkgs
>
{};
derivation
{
name
=
"build"
;
builder
=
"
${
pkgs
.
bash
}
/bin/bash"
;
args
=
[
./builder.sh
];
system
=
builtins
.
currentSystem
;
#PATH="${pkgs.coreutils}/bin/:${pkgs.gcc}/bin/:${pkgs.gnumake}/bin/";
PATH
=
pkgs
.
lib
.
strings
.
concatMapStringsSep
":"
(
x
:
x
+
"/bin"
)
(
with
pkgs
;[
coreutils
gcc
gnumake
]);
src
=
./.
;
}
/* pkgs.stdenv.mkDerivation {
name = "rpn-calc";
src = ./.;
buildInputs = with pkgs; [ afl ];
nativebuildInputs = with pkgs; [ afl ];
checkInputs = with pkgs; [ afl ];
buildPhase = ''
make fuzz_calc
'';
installPhase = ''
mkdir -p $out/bin
cp fuzz_calc $out/bin
'';
} */
\ No newline at end of file
This diff is collapsed.
Click to expand it.
fuzz.nix
0 → 100644
+
12
−
0
View file @
e1f82972
with
import
<
nixpkgs
>
{};
derivation
{
name
=
"fuzz"
;
builder
=
"
${
pkgs
.
bash
}
/bin/bash"
;
args
=
[
./fuzz_seconds.sh
];
system
=
builtins
.
currentSystem
;
#PATH="${pkgs.coreutils}/bin/:${pkgs.gcc}/bin/:${pkgs.gnumake}/bin/";
PATH
=
pkgs
.
lib
.
strings
.
concatMapStringsSep
":"
(
x
:
x
+
"/bin"
)
(
with
pkgs
;[
coreutils
gcc
gnumake
afl
]);
src
=
./.
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
fuzz_seconds.sh
+
7
−
0
View file @
e1f82972
#!/usr/bin/env bash
cp
-r
$src
/
*
./
make fuzz_calc
fuzz_seconds
=
${
1
:-
10
}
# 10 seconds by default
echo
"Going to fuzz for
$fuzz_seconds
seconds."
...
...
@@ -10,3 +13,7 @@ afl_pid=$!
sleep
$fuzz_seconds
kill
$afl_pid
#mkdir -p $out/bin/
cp
-r
out/
$out
/
\ No newline at end of file
This diff is collapsed.
Click to expand it.
release.nix
deleted
100644 → 0
+
0
−
33
View file @
59331672
with
import
(
import
./nixpkgs.nix
)
{};
let
rpncalc
=
import
./default.nix
;
afl_rpncalc
=
rpncalc
.
overrideAttrs
(
_
:
{
nativeBuildInputs
=
[
afl
];
makeFlags
=
[
"fuzz_calc"
];
doCheck
=
false
;
});
in
{
inherit
rpncalc
afl_rpncalc
;
sanitized
=
rpncalc
.
overrideAttrs
(
_
:
{
CXXFLAGS
=
"-fsanitize=undefined -fsanitize=address"
;
});
fuzz_rpncalc
=
afl_rpncalc
.
overrideAttrs
(
o
:
{
nativeBuildInputs
=
o
.
nativeBuildInputs
++
[
gnuplot
which
];
preConfigure
=
''
patchShebangs fuzz_seconds.sh
''
;
postBuild
=
''
./fuzz_seconds.sh 10
afl-plot out graph
''
;
installPhase
=
''
cp -r out $out
cp -r graph $out/
mkdir -p $out/nix-support
echo report testlog $out graph/index.html > $out/nix-support/hydra-build-products
''
;
});
}
This diff is collapsed.
Click to expand it.
sudo
0 → 100644
+
1
−
0
View file @
e1f82972
core tee /proc/sys/kernel/core_pattern
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment