Skip to content

Commit

Permalink
0.0.7 - Full base mode support, naive git mode (#35)
Browse files Browse the repository at this point in the history
- Full drop-in replacement for amboso -B
- Naive support for Gitmode
  • Loading branch information
jgabaut authored Dec 6, 2023
1 parent ee15237 commit 2f30ef7
Show file tree
Hide file tree
Showing 11 changed files with 284 additions and 38 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@

#ignore hello_world binary
hello_world

#ignore .o files
*.o
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

## [Unreleased]

### Added

- Support for make builds in Basemode
- Support for Gitmode
- Still not handling autotools

### Changed

- Updated try_anvil_auto to use the proper version numbers for this repo for tests
- Added support_automakemode to AmbosoEnv

## [0.0.6] - 2023-12-03

### Added
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "invil"
description = "A port of amboso to Rust"
version = "0.0.6"
version = "0.0.7"
edition = "2021"
license = "GPL-3.0-only"
homepage = "https://github.com/jgabaut/invil"
Expand Down
28 changes: 19 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
- Basic arguments parsing that complies with the bash implementation
- Same default for amboso directory (`./bin`).
- Parse `stego.lock` with compatible logic to bash implementation
- Base mode: init and build (only with basic command call)
- Base mode: full support
- The original implementation itself does not expect autotools prep for base mode, but it can be done trivially.
- Git mode: make support
- The original implementation itself expects git mode tags to contain a `Makefile` in repo root.
- autotools prep is not supported yet

Flags support status:

Expand All @@ -35,13 +39,13 @@
- [x] Verbose flag: `-V`
- [ ] Test macro: `-t`
- [ ] Test mode: `-T`
- [ ] Git mode: `-g`
- [x] Base mode: `-B` (only basic gcc call)
- [x] Build: `-b` (only with -B)
- [x] Run: `-r` (only with -B)
- [x] Init: `-i` (only with -B)
- [x] Delete: `-d` (only with -B)
- [x] Purge: `-p` (only with -B)
- [x] Git mode: `-g`
- [x] Base mode: `-B`
- [x] Build: `-b`
- [x] Run: `-r`
- [x] Init: `-i`
- [x] Delete: `-d`
- [x] Purge: `-p`
- [x] Help: `-h`
- [ ] Big Help: `-H`
- [x] Version: `-v`
Expand All @@ -67,6 +71,12 @@ Our version was slightly modified to actually make cargo build the release versi

## Todo <a name = "todo"></a>

- Implement control flow for op checks
- Implement autotools prep step
- Implement test mode
- Implement silent functionality
- Extend original impl by handling autotools in base mode
- Improve logging with a custom format
- Improve horrendous git mode command chain
- Resorting to shell commands is bad and defeats the purpose of this rewrite.
- We have git2 crate to handle the git commands and should be able to reduce the amount of command wrapping.
- Handle autotools prep
5 changes: 3 additions & 2 deletions bin/stego.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

source = "hello_world.c"
bin = "hello_world"
makevers = "2.0.0"
automakevers = "3.0.0"
makevers = "0.0.7"
automakevers = "2.0.0"
tests = "kazoj"

[tests]
Expand All @@ -14,3 +14,4 @@ errortestsdir = "kulpo"
[versions]

"-0.0.5" = "First release supporting base mode build. gcc call only"
"-0.0.7" = "First release supporting base mode build. Wrap make"
5 changes: 5 additions & 0 deletions bin/v0.0.7/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#amboso compliant version folder, will ignore everything inside BUT the gitignore, and required files, to keep the clean dir
*
!hello_world.c
!Makefile
!.gitignore
11 changes: 11 additions & 0 deletions bin/v0.0.7/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
hello_world: .hello_world.o
gcc .hello_world.o -o hello_world

.hello_world.o: ./hello_world.c
gcc -c ./hello_world.c -o .hello_world.o

clean:
rm \.*.o hello_world

cleanob:
rm \.*.o
7 changes: 7 additions & 0 deletions bin/v0.0.7/hello_world.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <stdio.h>

int main(void) {
printf("Hello, World!\n");
printf("Built using make.\n");
return 0;
}
236 changes: 217 additions & 19 deletions src/main.rs

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions try-anvil/try_anvil_auto
Original file line number Diff line number Diff line change
Expand Up @@ -82,28 +82,28 @@ HINT " STEP 5/10
"

./anvil -BV 1 0.1.0
./anvil -BV 5 0.0.5
HINT " STEP 6/10
Verbose query, should succeed in reporting unbuilt version
"

./anvil -Brbd 0.1.0
./anvil -Brbd 0.0.5
HINT " STEP 7/10
Build, run, delete 0.1.0. Tests single file compilation & execution. Delete is done just before quitting and cleans our binary.
Build, run, delete 0.0.5. Tests single file compilation & execution. Delete is done just before quitting and cleans our binary.
"

./anvil -Brb 0.9.0
./anvil -Brb 0.0.7
HINT " STEP 8/10
Build, run 0.9.0. Tests make compilation & execution. No delete here, so the binary stays in the directory for future queries
Build, run 0.0.7. Tests make compilation & execution. No delete here, so the binary stays in the directory for future queries
"

./anvil -BprbiV 1 1.0.0
./anvil -Bprbi 1.0.0
HINT " STEP 9/10
Verbose Init, Build, Run and Purge 1.0.0.
Expand Down

0 comments on commit 2f30ef7

Please sign in to comment.