Skip to content

Commit

Permalink
Remove OS-dependent signals.
Browse files Browse the repository at this point in the history
  • Loading branch information
candid82 committed Sep 4, 2022
1 parent 2db1f41 commit a98f18c
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 347 deletions.
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,12 @@ To run Joker in format mode pass `--format` flag. For example:
## Building

Joker requires Go v1.13 or later.
Below commands should get you up and running (replace `darwin` in `JOKER_STD_OS=darwin` with `linux` or `windows` if you build for those platforms).
Below commands should get you up and running.

```
go get -d github.com/candid82/joker
cd $GOPATH/src/github.com/candid82/joker
JOKER_STD_OS=darwin ./run.sh --version && go install
./run.sh --version && go install
```

### Cross-platform Builds
Expand All @@ -332,13 +332,6 @@ After building the native version (to autogenerate appropriate files, "vet" the
$ GOOS=linux GOARCH=arm GOARM=6 go build
```

If you build cross-os (e.g. linux binary on macOs) you also need to generate std library for the right platform. E.g.:

```
JOKER_STD_OS=linux ./run.sh --build-only
GOOS=linux GOARCH=amd64 go build
```

The `run.sh` script does not support cross-platform building directly, but can be used in conjunction with `build-arm.sh` to cross-build from a Linux **amd64** or **386** system to a Linux **arm** system via:

```
Expand Down
5 changes: 0 additions & 5 deletions build-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,9 @@ if [ -z "$version" ]; then
exit
fi

JOKER_STD_OS=darwin ./run.sh --build-only
GOOS=darwin GOARCH=amd64 go build
zip joker-$version-mac-amd64.zip joker

JOKER_STD_OS=linux ./run.sh --build-only
GOOS=linux GOARCH=amd64 go build
zip joker-$version-linux-amd64.zip joker

JOKER_STD_OS=windows ./run.sh --build-only
GOOS=windows GOARCH=amd64 go build
zip joker-$version-win-amd64.zip joker.exe
193 changes: 0 additions & 193 deletions std/os.joke
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,6 @@
:go "0xe"}
SIGALRM)

(def ^{:doc "SIGBUS"
:added "1.0.1"
:tag Int
:const true
:go {:darwin "0xa"
:default "0x7"}}
SIGBUS)

(def ^{:doc "SIGCHLD"
:added "1.0.1"
:tag Int
:const true
:go {:darwin "0x14"
:linux "0x11"}}
SIGCHLD)

(def ^{:doc "SIGCONT"
:added "1.0.1"
:tag Int
:const true
:go {:darwin "0x13"
:linux "0x12"}}
SIGCONT)

(def ^{:doc "SIGEMT"
:added "1.0.1"
:tag Int
:const true
:go {:darwin "0x7"}}
SIGEMT)

(def ^{:doc "SIGFPE"
:added "1.0.1"
:tag Int
Expand All @@ -68,36 +37,13 @@
:go "0x4"}
SIGILL)

(def ^{:doc "SIGINFO"
:added "1.0.1"
:tag Int
:const true
:go {:darwin "0x1d"}}
SIGINFO)

(def ^{:doc "SIGINT"
:added "1.0.1"
:tag Int
:const true
:go "0x2"}
SIGINT)

(def ^{:doc "SIGIO"
:added "1.0.1"
:tag Int
:const true
:go {:darwin "0x17"
:linux "0x1d"}}
SIGIO)

(def ^{:doc "SIGIOT"
:added "1.0.1"
:tag Int
:const true
:go {:darwin "0x6"
:linux "0x6"}}
SIGIOT)

(def ^{:doc "SIGKILL"
:added "1.0.1"
:tag Int
Expand All @@ -112,14 +58,6 @@
:go "0xd"}
SIGPIPE)

(def ^{:doc "SIGPROF"
:added "1.0.1"
:tag Int
:const true
:go {:darwin "0x1b"
:linux "0x1b"}}
SIGPROF)

(def ^{:doc "SIGQUIT"
:added "1.0.1"
:tag Int
Expand All @@ -134,22 +72,6 @@
:go "0xb"}
SIGSEGV)

(def ^{:doc "SIGSTOP"
:added "1.0.1"
:tag Int
:const true
:go {:darwin "0x11"
:linux "0x13"}}
SIGSTOP)

(def ^{:doc "SIGSYS"
:added "1.0.1"
:tag Int
:const true
:go {:darwin "0xc"
:linux "0x1f"}}
SIGSYS)

(def ^{:doc "SIGTERM"
:added "1.0.1"
:tag Int
Expand All @@ -164,121 +86,6 @@
:go "0x5"}
SIGTRAP)

(def ^{:doc "SIGTSTP"
:added "1.0.1"
:tag Int
:const true
:go {:darwin "0x12"
:linux "0x14"}}
SIGTSTP)

(def ^{:doc "SIGTTIN"
:added "1.0.1"
:tag Int
:const true
:go {:darwin "0x15"
:linux "0x15"}}
SIGTTIN)

(def ^{:doc "SIGTTOU"
:added "1.0.1"
:tag Int
:const true
:go {:darwin "0x16"
:linux "0x16"}}
SIGTTOU)

(def ^{:doc "SIGURG"
:added "1.0.1"
:tag Int
:const true
:go {:darwin "0x10"
:linux "0x17"}}
SIGURG)

(def ^{:doc "SIGUSR1"
:added "1.0.1"
:tag Int
:const true
:go {:darwin "0x1e"
:linux "0xa"}}
SIGUSR1)

(def ^{:doc "SIGUSR2"
:added "1.0.1"
:tag Int
:const true
:go {:darwin "0x1f"
:linux "0xc"}}
SIGUSR2)

(def ^{:doc "SIGVTALRM"
:added "1.0.1"
:tag Int
:const true
:go {:darwin "0x1a"
:linux "0x1a"}}
SIGVTALRM)

(def ^{:doc "SIGWINCH"
:added "1.0.1"
:tag Int
:const true
:go {:darwin "0x1c"
:linux "0x1c"}}
SIGWINCH)

(def ^{:doc "SIGXCPU"
:added "1.0.1"
:tag Int
:const true
:go {:darwin "0x18"
:linux "0x18"}}
SIGXCPU)

(def ^{:doc "SIGXFSZ"
:added "1.0.1"
:tag Int
:const true
:go {:darwin "0x19"
:linux "0x19"}}
SIGXFSZ)

(def ^{:doc "SIGCLD"
:added "1.0.1"
:tag Int
:const true
:go {:linux "0x11"}}
SIGCLD)

(def ^{:doc "SIGPOLL"
:added "1.0.1"
:tag Int
:const true
:go {:linux "0x1d"}}
SIGPOLL)

(def ^{:doc "SIGPWR"
:added "1.0.1"
:tag Int
:const true
:go {:linux "0x1e"}}
SIGPWR)

(def ^{:doc "SIGSTKFLT"
:added "1.0.1"
:tag Int
:const true
:go {:linux "0x10"}}
SIGSTKFLT)

(def ^{:doc "SIGUNUSED"
:added "1.0.1"
:tag Int
:const true
:go {:linux "0x1f"}}
SIGUNUSED)

(defn chmod
"Changes the mode of the named file to mode. If the file is a symbolic link, it changes the mode of the link's target."
{:added "1.0"
Expand Down
40 changes: 0 additions & 40 deletions std/os/a_os.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,16 @@ import (

var SIGABRT_ Int
var SIGALRM_ Int
var SIGBUS_ Int
var SIGCHLD_ Int
var SIGCONT_ Int
var SIGEMT_ Int
var SIGFPE_ Int
var SIGHUP_ Int
var SIGILL_ Int
var SIGINFO_ Int
var SIGINT_ Int
var SIGIO_ Int
var SIGIOT_ Int
var SIGKILL_ Int
var SIGPIPE_ Int
var SIGPROF_ Int
var SIGQUIT_ Int
var SIGSEGV_ Int
var SIGSTOP_ Int
var SIGSYS_ Int
var SIGTERM_ Int
var SIGTRAP_ Int
var SIGTSTP_ Int
var SIGTTIN_ Int
var SIGTTOU_ Int
var SIGURG_ Int
var SIGUSR1_ Int
var SIGUSR2_ Int
var SIGVTALRM_ Int
var SIGWINCH_ Int
var SIGXCPU_ Int
var SIGXFSZ_ Int
var __args__P ProcFn = __args_
var args_ Proc = Proc{Fn: __args__P, Name: "args_", Package: "std/os"}

Expand Down Expand Up @@ -1005,36 +985,16 @@ func __user_home_dir_(_args []Object) Object {
func Init() {
SIGABRT_ = MakeInt(0x6)
SIGALRM_ = MakeInt(0xe)
SIGBUS_ = MakeInt(0xa)
SIGCHLD_ = MakeInt(0x14)
SIGCONT_ = MakeInt(0x13)
SIGEMT_ = MakeInt(0x7)
SIGFPE_ = MakeInt(0x8)
SIGHUP_ = MakeInt(0x1)
SIGILL_ = MakeInt(0x4)
SIGINFO_ = MakeInt(0x1d)
SIGINT_ = MakeInt(0x2)
SIGIO_ = MakeInt(0x17)
SIGIOT_ = MakeInt(0x6)
SIGKILL_ = MakeInt(0x9)
SIGPIPE_ = MakeInt(0xd)
SIGPROF_ = MakeInt(0x1b)
SIGQUIT_ = MakeInt(0x3)
SIGSEGV_ = MakeInt(0xb)
SIGSTOP_ = MakeInt(0x11)
SIGSYS_ = MakeInt(0xc)
SIGTERM_ = MakeInt(0xf)
SIGTRAP_ = MakeInt(0x5)
SIGTSTP_ = MakeInt(0x12)
SIGTTIN_ = MakeInt(0x15)
SIGTTOU_ = MakeInt(0x16)
SIGURG_ = MakeInt(0x10)
SIGUSR1_ = MakeInt(0x1e)
SIGUSR2_ = MakeInt(0x1f)
SIGVTALRM_ = MakeInt(0x1a)
SIGWINCH_ = MakeInt(0x1c)
SIGXCPU_ = MakeInt(0x18)
SIGXFSZ_ = MakeInt(0x19)
InternsOrThunks()
}

Expand Down
Loading

0 comments on commit a98f18c

Please sign in to comment.