ion issueshttps://gitlab.redox-os.org/redox-os/ion/-/issues2024-02-24T08:00:08Zhttps://gitlab.redox-os.org/redox-os/ion/-/issues/1027Job linux:stable fails with compile error in step make tests2024-02-24T08:00:08ZFlorian NaumannJob linux:stable fails with compile error in step make tests# Problem
As the moment of writing, the job **linux:stable** fails because of a compiler error on component file.
For example, this happens under this [PR](https://gitlab.redox-os.org/redox-os/ion/-/merge_requests/1241) and this [PR](h...# Problem
As the moment of writing, the job **linux:stable** fails because of a compiler error on component file.
For example, this happens under this [PR](https://gitlab.redox-os.org/redox-os/ion/-/merge_requests/1241) and this [PR](https://gitlab.redox-os.org/redox-os/ion/-/merge_requests/1240). They both got the same error.
This jobs seems to fail for this reason.
```text
error: could not rename component file from '/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/share/doc/cargo' to '/root/.rustup/tmp/l6w0u6l2ukry_npa_dir/bk': Invalid cross-device link (os error 18)
Compiling types-rs v0.1.0 (/builds/bool_purist/ion/members/types-rs)
error: could not compile `thiserror`
```
See [job output](https://gitlab.redox-os.org/bool_purist/ion/-/jobs/37845)
## Cause of the Problem in my view.
Some research seems to suggest that a component file got corrupted. See this [github issue](https://github.com/rust-lang/rustup/issues/2729). It recommended to reinstall the toolchain. Since the job is using the base image redoxos/redoxer on docker hub, the installation of the rust toolchain in the Dockerfile of the [repository](https://gitlab.redox-os.org/redox-os/redoxer) might have gone wrong.https://gitlab.redox-os.org/redox-os/ion/-/issues/1031CI: no space left error if redoxer test is reinstroduced in CI of Ion shell u...2024-02-24T07:57:02ZFlorian NaumannCI: no space left error if redoxer test is reinstroduced in CI of Ion shell under the job "redox".On the CI of Ion shell the "redoxer test" was deactivated because it would hang in the job "redox". Since it does not hang anymore I tried to replace the command "redoxer build" with "redoxer test" in the job "redox" . When I do that I h...On the CI of Ion shell the "redoxer test" was deactivated because it would hang in the job "redox". Since it does not hang anymore I tried to replace the command "redoxer build" with "redoxer test" in the job "redox" . When I do that I however now get an error about "there is no space left" for certain folders to create. See the following job [output](https://gitlab.redox-os.org/bool_purist/ion/-/jobs/38338) for more details.https://gitlab.redox-os.org/redox-os/ion/-/issues/1032unexplained attempt to open file2023-11-15T12:30:19ZRon Williamsunexplained attempt to open fileRunning `ls foo`, where foo does not exist, seems to result in an attempt to open a file named `ls foo`. I'm not sure if this is an attempt to execute or just an attempt to test the existence of the file `ls foo`. Either way, it doesn't ...Running `ls foo`, where foo does not exist, seems to result in an attempt to open a file named `ls foo`. I'm not sure if this is an attempt to execute or just an attempt to test the existence of the file `ls foo`. Either way, it doesn't seem like the right thing to do.https://gitlab.redox-os.org/redox-os/ion/-/issues/1028Replace and replace_regex should allow empty strings as parameters2023-10-27T22:46:53ZTimofey ProdanovReplace and replace_regex should allow empty strings as parametersBasically, the following method call would work: `$replace("abc" "a" "0")`, while this would fail:
```
echo $replace("abc" "a" "")
ion: expansion error: replace: two arguments are required
```
The same goes for `replace_regex`.
I think ...Basically, the following method call would work: `$replace("abc" "a" "0")`, while this would fail:
```
echo $replace("abc" "a" "")
ion: expansion error: replace: two arguments are required
```
The same goes for `replace_regex`.
I think overall the methods should allow for empty strings as parameters, but check them later and fail, if it is not an appropriate argument.
Compare this to python:
```python
python -c 'print("abc".replace("a", ""))'
```
and to `sed`:
```bash
echo abc | sed 's/a//g'
```
The same issue was raised [here](redox-os/ion#805).
Overall, I can try to fix that later if the change makes sense.https://gitlab.redox-os.org/redox-os/ion/-/issues/1017Ion crashes after pressing `enter` key frequently2023-06-25T02:29:58ZIvan TanIon crashes after pressing `enter` key frequentlybug: Ion crashes after pressing `enter` key frequently
expect: Ion runs normally after pkg exiting abnormally
code: input
```
user:/usr/bin# pkg list vim
* Requesting https://static.redox-os.org/pkg/x86_64-unknown-redox/vim.sig
126 B ...bug: Ion crashes after pressing `enter` key frequently
expect: Ion runs normally after pkg exiting abnormally
code: input
```
user:/usr/bin# pkg list vim
* Requesting https://static.redox-os.org/pkg/x86_64-unknown-redox/vim.sig
126 B / 126 B [===========================================] 100.00 % 12.11 KB/s
* Requesting https://static.redox-os.org/pkg/x86_64-unknown-redox/vim.tar.gz
smolnetd::scheme: poll error: dropped by socket
smolnetd::scheme: poll error: dropped by socket
560.00 KB / 11.54 MB [=>-------------------------------] 4.74 % 292.13 KB/s 39s ion: pipeline execution error: process (112) ended by signal SIGINT
user:/usr/bin#
user:/usr/bin#
# ...
user:/usr/bin# cat /sys:context
PID PGID PPID RUID RGID RNS EUID EGID ENS STAT CPU TICKS MEM NAME
1 1 0 0 0 0 0 0 0 RR 0 00:19:48 512 B
2 2 0 0 0 0 0 0 0 RR+ 3 00:00:00 512 B
3 3 0 0 0 0 0 0 0 RR+ 1 00:00:00 512 B
4 4 0 0 0 0 0 0 0 RR+ 2 00:00:00 512 B
5 5 0 0 0 0 0 0 0 UB 0 00:00:00 2 MB initfs:bin/init
6 5 5 0 0 1 0 0 1 UB 0 00:00:00 12 MB bootstrap
8 5 5 0 0 0 0 0 0 UB 0 00:00:00 1 MB /bin/nulld
10 5 5 0 0 0 0 0 0 UB 0 00:00:00 1 MB /bin/zerod
12 5 5 0 0 0 0 0 0 UB 0 00:00:00 2 MB /bin/randd
15 5 5 0 0 0 0 0 0 UB 0 00:00:00 1 MB /bin/logd
19 5 5 0 0 0 0 0 0 UB 0 00:00:03 2 MB /bin/ramfs
21 5 5 0 0 0 0 0 0 UB 0 00:00:01 2 MB /bin/acpid
25 5 5 0 0 0 0 0 0 UB 0 00:00:05 2 MB /bin/ahcid
27 5 5 0 0 0 0 0 0 UB 0 00:00:04 35 MB /bin/redoxfs
29 5 5 0 0 0 0 0 0 UB 0 00:00:00 1 MB file:/bin/ipcd
31 5 5 0 0 0 0 0 0 UB 0 00:00:06 2 MB file:/bin/ptyd
34 5 5 0 0 1 0 0 1 UB 0 00:00:00 7 MB file:/bin/pcid
35 5 5 0 0 0 0 0 0 UR 0 00:02:02 2 MB file:/bin/ihdad
38 5 5 0 0 0 0 0 0 UB 0 00:00:02 1 MB file:/bin/e1000d
40 5 5 0 0 1 0 0 1 UB 0 00:00:00 2 MB file:/bin/escalated
42 5 5 0 0 0 0 0 0 UB 0 00:00:06 3 MB file:/bin/smolnetd
44 5 5 0 0 0 0 0 0 UB 0 00:00:00 2 MB file:/bin/dnsd
48 5 5 0 0 0 0 0 0 UR 0 00:02:27 4 MB file:/bin/audiod
49 5 48 0 0 0 0 0 0 UB 0 00:02:10 4 MB file:/bin/audiod
54 5 5 0 0 1 0 0 1 UB 0 00:00:02 2 MB file:/bin/getty
55 5 54 0 0 1 0 0 1 UB 0 00:00:00 2 MB file:/bin/login
56 56 55 1000 1000 1 1000 1000 1 UB 0 00:00:02 4 MB file:/bin/ion
122 122 56 1000 1000 1 1000 1000 1 UR+ 0 00:00:00 8 MB file:/bin/cat
user:/usr/bin#
user:/usr/bin# smolnetd::scheme: poll error: unaddressable destination
user:/usr/bin#
user:/usr/bin#
user:/usr/bin#
thread 'main' panicked at 'wait() should either return Ok or panic', library/std/src/sys/unix/process/process_unix.rs:117:21
Invalid opcode fault
RFLAG: 0000000000000206
CS: 0000000000000033
RIP: 000000000061647e
RSP: 00007fffffff8730
SS: 000000000000002b
FSBASE 0000000000005000
GSBASE 0000000000000000
KGSBASE fffffd8000000050
RAX: 0000000000000000
RCX: 00000000006348a3
RDX: 000000000000000f
RDI: 0000000000000002
RSI: 0000000000684bcb
R8: 00007fffffff8640
R9: 0000000000000002
R10: 00007fffffff8488
R11: 0000000000000202
RBX: 0000000000000001
RBP: 00000000008c1130
R12: 0000000000000001
R13: 00000000008bb598
R14: 0000000000000000
R15: 00007fffffff8860
TRACE: FFFFFE80006532C0
FFFFFE80006532C0: FFFFFF000008B867
FFFFFF000008B730+0137
kernel::arch::x86_64::interrupt::exception::invalid_opcode::inner
FFFFFE8000653350: FFFFFF00000896CD
FFFFFF00000896A0+002D
kernel::arch::x86_64::interrupt::exception::invalid_opcode
00000000008C1130: EMPTY RETURN
kernel:INFO -- SIGNAL 4, CPU 0, PID ContextId(56)
kernel:INFO -- NAME file:/bin/ion
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
abort() called
########## Redox OS ##########
# Login with the following: #
# `user` #
# `root`:`password` #
##############################
redox login:
redox login:
redox login:
redox login: smolnetd::scheme: poll error: unaddressable destination
smolnetd::scheme: poll error: unaddressable destination
redox login:
redox login:
redox login: smolnetd::scheme: poll error: unaddressable destination
smolnetd::scheme: poll error: unaddressable destination
smolnetd::scheme: poll error: unaddressable destination
redox login:
redox login: user
Welcome to Redox OS!
```
For details, see the [test.log](/uploads/95263cd6701a4c442b2035f818dd5a3b/test.log)
expect: output
```
result
```
kernel: redox `git rev-parse HEAD` == e5c3be86cd2febcf4292ad4170943d4d3330f278
version:
```
user:~# ion --version
ion 1.0.0-alpha (x86_64-unknown-redox)
rev 3bb8966fc99ba223033e1e02b0a6d50fc25cbef4
```
interaction:
* 1. Press `enter` frequently
* 5. Shell crashes.
context: run redox without GUI `make qemu kvm=no vga=no`https://gitlab.redox-os.org/redox-os/ion/-/issues/1005Implement set -o pipefail2023-04-26T19:04:04ZAndrey BienkowskiImplement set -o pipefailfeat: I want `set -o pipefail`. #272 asked for both `errexit` and `pipefail`, but so far only `errexit` is implemented.
BREAKING CHANGE: it is possible to add `pipefail` without breaking existing scripts by defaulting it to off. In the ...feat: I want `set -o pipefail`. #272 asked for both `errexit` and `pipefail`, but so far only `errexit` is implemented.
BREAKING CHANGE: it is possible to add `pipefail` without breaking existing scripts by defaulting it to off. In the perfect world both `errexit` and `pipefail` would have been always on without any way to disable them (just like in all programming languages that have exceptions except for Visual Basic), but that might break existing scripts.
perf: impact
performance none
usability increase
maintainability increase
code: input
```
set -eo pipefail
echo 1
false | true
echo 2
```
expect: output
```
1
```
reason: I want my script to fail fast by default if an external command fails.
context:
Executing an external command can fail for a million different reasons. Here are some examples:
1. The external command is not installed
2. It encounters an internal bug and [fails fast and loud](https://en.wikipedia.org/wiki/Fail-fast)
3. It receives bad input due to a bug in my script
4. An admin kills it
5. The OOM Killer kills it https://linuxwheel.com/oom-killer-explained/
6. It tries to talk to another process possibly on a different machine and that fails for any reason
7. It uses a temporary file for internal buffering and /tmp is full
8. It tries to read or write a file and that fails for any reason
A robust script can not afford to ignore the possibility that any of the external commands it executes may fail. Often the right choice of action is to fail fast because the code that follows requires that the preceding commands executed successfully.
Unix-y pipelines have an issue:
```sh
foo | bar
```
If `foo` exits successfully `bar` sees EOF. If `foo` fails `bar` also sees EOF. `bar` has no way to know whether `foo` failed or not. In many cases `bar` will exit successfully even if `foo` fails. The script has to detect that and fail. This is why you often see `set -o errexit -o pipefail` in bash.
Unfortunately `set -o errexit` is [very broken](https://mywiki.wooledge.org/BashFAQ/105) in bash which is why I'm looking for a different shell.
<!--behavior of bash/dash/zsh/fish/oil-->https://gitlab.redox-os.org/redox-os/ion/-/issues/1022Enrich error messages information where the error occurred.2023-03-31T07:37:52ZFlorian NaumannEnrich error messages information where the error occurred.# What I want
Error messages do not show anything where the error has occurred.
Error messages should include information where the error has happened.
- Path to file in which the error occurred.
- The number of the line where the err...# What I want
Error messages do not show anything where the error has occurred.
Error messages should include information where the error has happened.
- Path to file in which the error occurred.
- The number of the line where the error was raised.
- The column at the char position in the line where the error starts.
I think printing out the absolute path of the file is most reliable and help with locating the error the best.
If the command was executed with option "-c" then the path should be a keyword like "literal command".
Because paths can become long I propose that the ion errors should have 2 lines.
First Line shows the error kind and the file path.
Second line shows a tuple (line_number:column) and then the error description.
## Purpose
It would aid when debugging scripts. Especially in more complex scripts this can make life easier.
## Example with a file which is named "some_file"
```sh
echo "Print out not declared variable 'ab' "
echo $ab
```
Print out not declared variable 'ab'
**Desired output:**
```
Print out not declared variable 'ab'
ion: expansion error at (path_to_file):
ion: (2:5) Variable does not exist
```
**Instead of current output:**
```text
Print out not declared variable 'ab'
ion: expansion error: Variable does not exist
```
## Example with inline command via option "-c"
```sh
ion -c "echo $does_not_exits"
```
**Desired output:**
```text
ion: expansion error in literal command:
ion: (1:6)
```https://gitlab.redox-os.org/redox-os/ion/-/issues/1030Proposal: Convert MakeFiles and bash scripts into rust via "cargo xtask" conv...2023-03-28T09:02:39ZFlorian NaumannProposal: Convert MakeFiles and bash scripts into rust via "cargo xtask" convention.# Problem with make and bash
Ion shell grows more and more in complexity and so does the local automation system.
Make and bash becomes harder and harder to extend on for automation.
While make and bash might have been sufficient for a ...# Problem with make and bash
Ion shell grows more and more in complexity and so does the local automation system.
Make and bash becomes harder and harder to extend on for automation.
While make and bash might have been sufficient for a starting point to automate, this project has reached the point where those tools are not justifiable anymore in my opinion .
I propose that we change gears and use rust for local automation too by applying the xtask convention.
## What is xtask
There is a simple convention, called xtask, to follow.
This convention is possible via the workspace feature of Rust. The rust code for automation is then just another workspace member. Following this convention, we get a full fledged CLI API for automation which depends only on Rust and Cargo. In this system we could utilize the power of rust and its ecosystem for automation.
[Link](https://github.com/matklad/cargo-xtask) to this convention.
## Arguments for cargo xtask convention over make and bash scripts.
- The Redox-Os ecosystem is also about leveraging the capabilities of Rust, so why not also in the automation system.
- Make is primarily a build system and not a command runner. Cargo already provides an build system for Rust.
- Bash as script language does not scale well with growing complexity in automation. Rust on the other hand is way better in this department.
- Can have one language in the project for the application and for the automation system.
- Not all people come from the Linux realm. Automation via Make and Bash increases the learning curve for those people who want fix/improve automation.
- More flexibility in designing the CLI API compared to Make match rules or Bash "getopts" thing.
- It is advantageous to get rid of make and bash for a latter windows port.
- Reduces build tech stack, taking out make and bash.
## Willingness for the proof of concept
For demo purposes I would be willing provide a PR which implements the unit/integration test system of Ion via rust in xtask convention. If the PR/Proposal convinces the community, then I would be happy to replace all Make and Bash scripts via Rust in the Ion repository.https://gitlab.redox-os.org/redox-os/ion/-/issues/1021Spaces between opening parentheses of method and 1. argument raises error.2023-03-21T20:18:37ZFlorian NaumannSpaces between opening parentheses of method and 1. argument raises error.bug:
Invoking a method where there is at least one space before the 1. argument, raises an error.
expect:
It should simply ignore spaces between the opening parentheses of the called method and the start of the 1. argument.
code: ...bug:
Invoking a method where there is at least one space before the 1. argument, raises an error.
expect:
It should simply ignore spaces between the opening parentheses of the called method and the start of the 1. argument.
code: input
```sh
let name = "name"
echo $len( $name)
```
actual: output
```
ion: expansion error: Variable does not exist
```
expect: output
```
4
```
kernel:
OS: Fedora Linux 37 (Cinnamon) x86_64
Kernel: 6.1.13-200.fc37.x86_64
version: `ion --version`
ion 1.0.0-alpha (x86_64-unknown-linux-gnu)
rev 2f8884c1ce67dc40bc0547a182ffdefdf50fa25b
context: Using alacritty as terminal emulator with tmux as multiplexerhttps://gitlab.redox-os.org/redox-os/ion/-/issues/1029Locally generated builtin file for ion manual does not show a man page sectio...2023-03-20T18:45:55ZFlorian NaumannLocally generated builtin file for ion manual does not show a man page section for all builtins of ion.## Example:
the online ion manual under this [link](https://doc.redox-os.org/ion-manual/builtins.html) shows a man page section about the builtin history.
If however you build the builtin section locally via
```sh
make manual
```
an...## Example:
the online ion manual under this [link](https://doc.redox-os.org/ion-manual/builtins.html) shows a man page section about the builtin history.
If however you build the builtin section locally via
```sh
make manual
```
and then show the local ion manual in the browser via
```sh
mdbook serve manual --open
```
and then go under the chapter **14. Builtin Commands** in the local Ion manual.
there is nothing to be found about the builtin history !
## Solution:
- Find out a complete list of all builtins of the Ion shell
- Make them appear in the generating process of the builtin chapter. To do that, find the entry point of
the builtins, missing in the docs, and annotate it with the builtin macro provided by Ion shell.https://gitlab.redox-os.org/redox-os/ion/-/issues/1026Aliases should not be dropped at the end of the scope2023-03-13T10:33:45ZTimofey ProdanovAliases should not be dropped at the end of the scopeCurrently, aliases are dropped at the end of the scope, and cannot be effectively defined in a `for`-loop or in an `if` statement.
This is also true even if another script is sourced within the loop/if statement.
Ideally, aliases should...Currently, aliases are dropped at the end of the scope, and cannot be effectively defined in a `for`-loop or in an `if` statement.
This is also true even if another script is sourced within the loop/if statement.
Ideally, aliases should act as `export` variables, and continue to be defined even after the end of the scope.
### Importance
Suppose in the `initrc` file the user wants to iterate over all `.ion` scripts in another folder and source them all.
This would capture all `export` variables, but will not save any aliases. Not only this behavior is inconvinient, it is also unclear.
### Simple example
```ion
for _ in 0..1
export TEST_VAR = "Var is defined"
alias test_alias = echo "Alias is defined"
end
echo $TEST_VAR
test_alias
```
Would produce the following output (both `ion script.ion` and `source script.ion`):
```
Var is defined
ion: pipeline execution error: command not found: test_alias
```
### Another example
Suppose with have two scripts: `inner.ion`
```ion
export TEST_VAR = "Var is defined"
alias test_alias = echo "Alias is defined"
```
and `main.ion`
```ion
if true
source inner.ion
echo "Test inside `if`"
echo $TEST_VAR
test_alias
end
echo -e "\nTest outside `if`"
echo $TEST_VAR
test_alias
```
Will produce the following output (both `ion main.ion` and `source main.ion`):
```
Test inside `if`
Var is defined
Alias is defined
Test outside `if`
Var is defined
ion: pipeline execution error: command not found: test_alias
```
### Comparison with other shells
```bash
for _ in 0; do
export TEST_VAR="Var is defined"
alias test_alias="echo Alias is defined"
done
echo $TEST_VAR
test_alias
```
will have the following behaviour in other shells:
- Successful in `sh`,
- Successful in `bash`, but only if ran as `source`,
- Successful in `zsh`.https://gitlab.redox-os.org/redox-os/ion/-/issues/805Easy substring removal2023-03-10T13:53:44ZColeman McFarlandEasy substring removalI want to use ion to parse a config that looks like this, where the unique name given before the underscore `_`
is treated as part of a set.
```sh
HOST1_USERFILE=cloud-config/one.yml
HOST1_OS=ubuntu_18_04
HOST1_FACILITY=sjc1
HOST2_USE...I want to use ion to parse a config that looks like this, where the unique name given before the underscore `_`
is treated as part of a set.
```sh
HOST1_USERFILE=cloud-config/one.yml
HOST1_OS=ubuntu_18_04
HOST1_FACILITY=sjc1
HOST2_USERFILE=cloud-config/two.yml
HOST2_OS=ubuntu_18_04
HOST2_FACILITY=sjc1
```
I am using hashmap as a set. The following doesn't _quite_ work, because the "" empty string is not treated as an argument to `@replace`.
```
let hosts:hmap[] = [ ]
let name = $replace("HOST1_USERFILE", "_USERFILE" "")
let hosts[$name] = $name
```
I could do use a space instead of empty string:
```
let name = $replace("HOST1_USERFILE", "_USERFILE" " ") # a space, inst
```
... but the space is preserved in the value of `$name`.
I could use trim #802 when it lands, but a dedicated substring removal method might be nice.Ion Shell v1.0.0https://gitlab.redox-os.org/redox-os/ion/-/issues/1025ion cannot handle wildcards containing scheme prefixes like 'disk:'2023-03-04T22:57:15ZFlorian Naumannion cannot handle wildcards containing scheme prefixes like 'disk:'Ion can not handle paths with prefix for redox schemes.
Ion uses the crate glob for expanding given paths in commands.
While PR https://gitlab.redox-os.org/redox-os/ion/-/merge_requests/1239 as workaround makes ion work with the prefix ...Ion can not handle paths with prefix for redox schemes.
Ion uses the crate glob for expanding given paths in commands.
While PR https://gitlab.redox-os.org/redox-os/ion/-/merge_requests/1239 as workaround makes ion work with the prefix **file:**, it still does not work in general with other prefixes.
Example: file:/path/to/everything/* works but not disk:*.
Problem: glob as crate does not understand the concept of redox os prefixes.
Possible approaches:
- Make an issue or better PR to the crate glob to support redox os prefixes.
- Make a fork of glob and implement it there.
- Make replacement of glob to support prefixes.https://gitlab.redox-os.org/redox-os/ion/-/issues/1001Parameter Substitution on arrays2023-03-03T09:37:32ZNils ErikssonParameter Substitution on arraysfeat: Add an equivalent @or method for arrays. With this addition both arrays and string can have alternative default values.
How would it work?
An empty array would trigger the @or method to return the second argument instead of the fi...feat: Add an equivalent @or method for arrays. With this addition both arrays and string can have alternative default values.
How would it work?
An empty array would trigger the @or method to return the second argument instead of the first.
It could work with array slicing, but it's forbidden to create empty slices of arrays as of right now, thus the method would never trigger and return the second argument.
BREAKING CHANGE: None that I know of.
perf: impact
performance none
usability increase
maintainability increase
code: input
```
let array = []
# Inline array in @or method
echo @or(@array [foo bar])
# single value
echo @or(@array baz)
# variable expansion
let default = foobar
echo @or(@array $default)
# method would not trigger
let array ++= faz
echo @or(@array $default)
```
expect: output
```
foo bar
baz
foobar
faz
```
reason: Strings already have this feature and arrays should to. Parameter substitution are very common in bash scripts and should be ported over fully.
context: This is a stripped down version of a script I have today. I have to add the default argument in a check when I could have written it like: "${@-status}" in bash. I can't demonstrate how I would use the @or method as I still depend on array slicing.
```
fn mix_status
if bool $(pamixer --get-mute)
echo "--%"
else
printf "%2s%%\n" $(pamixer --get-volume)
end
end
test $len(@args) = 1 && let args ++= "status"
for arg in @args[1..]
match $arg
case status; mix_status
case toggle-mute; pamixer --toggle-mute
case mute; pamixer --mute
case _; echo "Usage: $(basename @args[0]) [status|toggle-mute|mute] ... (default: status)"
end
end
```
behavior of bash
Here is bash solution to parameter substitution: https://tldp.org/LDP/abs/html/parameter-substitution.htmlhttps://gitlab.redox-os.org/redox-os/ion/-/issues/1019Bug: ion manual is not updated automatically after a commit2023-03-02T16:29:13ZFlorian NaumannBug: ion manual is not updated automatically after a commitI observed that after the accepted merge request for commit 2f8884c1ce67dc40bc0547a182ffdefdf50fa25b which changes the ion manual, the [manual online](https://doc.redox-os.org/ion-manual/variables/02-arrays.html) is not updated according...I observed that after the accepted merge request for commit 2f8884c1ce67dc40bc0547a182ffdefdf50fa25b which changes the ion manual, the [manual online](https://doc.redox-os.org/ion-manual/variables/02-arrays.html) is not updated accordingly. This [section](https://gitlab.redox-os.org/redox-os/ion/-/blob/master/README.md?plain=1#L28) of the README however states that online ion manual gets updated on every commit.
My guess is that the broken CI fails to update online manual. In my view the job **pages** in [.gitlab-ci.yml](https://gitlab.redox-os.org/redox-os/ion/-/blob/master/.gitlab-ci.yml) handles the update of the online manual. This job currently fails.https://gitlab.redox-os.org/redox-os/ion/-/issues/1024null-coalescing operator2023-03-02T16:22:03ZFlorian Naumannnull-coalescing operatorThere an issue which sparked the idea https://gitlab.redox-os.org/redox-os/ion/-/issues/1001#note_23188
Code example for how an user might use it.
```sh
let array = array ?: [default]
```
This should also work with strings.There an issue which sparked the idea https://gitlab.redox-os.org/redox-os/ion/-/issues/1001#note_23188
Code example for how an user might use it.
```sh
let array = array ?: [default]
```
This should also work with strings.https://gitlab.redox-os.org/redox-os/ion/-/issues/1023ternary operator for arrays/strings2023-03-02T16:16:04ZFlorian Naumannternary operator for arrays/stringsThis issue https://gitlab.redox-os.org/redox-os/ion/-/issues/1001#note_23188 mentioned the idea of an ternary operator for arrays.
This code sample shows how it could be used by the user.
```sh
let array = []
let array = array ? array...This issue https://gitlab.redox-os.org/redox-os/ion/-/issues/1001#note_23188 mentioned the idea of an ternary operator for arrays.
This code sample shows how it could be used by the user.
```sh
let array = []
let array = array ? array : [default]
# alternately
let array = if array; array; else [default]; end
```
This feature should also work with strings in same way.https://gitlab.redox-os.org/redox-os/ion/-/issues/1018Make tests does not compile with indented toolchain 1.53.02023-03-01T19:59:55ZFlorian NaumannMake tests does not compile with indented toolchain 1.53.0# Problem
The commmand
```text
make tests
```
leads to the output:
```text
cargo +1.53.0 test
error: failed to download `plotters v0.3.2`
Caused by:
unable to get packages from source
Caused by:
failed to parse manifest at `/h...# Problem
The commmand
```text
make tests
```
leads to the output:
```text
cargo +1.53.0 test
error: failed to download `plotters v0.3.2`
Caused by:
unable to get packages from source
Caused by:
failed to parse manifest at `/home/nice_graphic/.cargo/registry/src/github.com-1ecc6299db9ec823/plotters-0.3.2/Cargo.toml`
Caused by:
feature `edition2021` is required
this Cargo does not support nightly features, but if you
switch to nightly channel you can add
`cargo-features = ["edition2021"]` to enable this feature
make: *** [Makefile:65: tests] Error 101
```
When I however use stable or nightly as value for the TOOLCHAIN variable then no errors occur.
I noticed that, a similar error happens in the current pipeline for stage link-check as an example.
Output of
```text
error: failed to compile `mdbook-linkcheck v0.7.7`, intermediate artifacts can be found at `/tmp/cargo-installrar8y5`
Caused by:
failed to parse manifest at `/builds/bool_purist/ion/cargo/registry/src/github.com-1ecc6299db9ec823/clap_complete-3.2.5/Cargo.toml`
Caused by:
feature `edition2021` is required
this Cargo does not support nightly features, but if you
switch to nightly channel you can add
`cargo-features = ["edition2021"]` to enable this feature
```
## My System.
I am using Linux/Fedora 37.
Output of
```text
rustup show
```
```
Default host: x86_64-unknown-linux-gnu
rustup home: /home/<censored>/.rustup
installed toolchains
--------------------
stable-x86_64-unknown-linux-gnu
nightly-2022-03-18-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (default)
1.39.0-x86_64-unknown-linux-gnu
1.53.0-x86_64-unknown-linux-gnu
1.61.0-x86_64-unknown-linux-gnu
active toolchain
----------------
1.53.0-x86_64-unknown-linux-gnu (directory override for '/home/nice_graphic/Code/rust/gitlab/ion')
rustc 1.53.0 (53cb7b09b 2021-06-17)
```https://gitlab.redox-os.org/redox-os/ion/-/issues/1020Ci is broken with current base image redoxos/redoxer from docker hub.2023-03-01T19:58:04ZFlorian NaumannCi is broken with current base image redoxos/redoxer from docker hub.# CI currently breaks for the job **linux**, **linux:stable**, **redox** and **link-check**.
It relates to issues #1019 and #1018 .
These jobs fail at compiling. Some dependencies of this project are not compatible with the used rust ...# CI currently breaks for the job **linux**, **linux:stable**, **redox** and **link-check**.
It relates to issues #1019 and #1018 .
These jobs fail at compiling. Some dependencies of this project are not compatible with the used rust toolchain version 1.53.0 anymore. It seems the toolchain 1.53.0 does not support the edition 2021 which are required by certain libraries. See output of this [failed job](https://gitlab.redox-os.org/bool_purist/ion/-/jobs/37305) as an example. After fiddling around I found out that compilation would work with toolchain version 1.56.0, because it supports rust edition 2021. See the comment of kornelski in this [issue on github](https://github.com/RedisJSON/RedisJSON/issues/616)
## What I tried to fix it
I upgraded the used rust tool chain version in the make file to 1.56.0 and changed the used image from 'rust:1.53.0' to 'rust:1.56.0' under the job **linux**.
This fixes the job **linux** in the CI. The job **format** already works.
However I can not make the jobs **linux:stable**, **redox** and **link-check** work. These jobs use the [redoxos/redoxer from docker hub](https://hub.docker.com/r/redoxos/redoxer/tags) as the base image. This image is about 2 years old and was build with rust 1.35.0 apparently according to the error messages in the failed jobs. Another indicator for this, is the following output:
```text
...
Default host: x86_64-unknown-linux-gnu
rustup home: /root/.rustup
nightly-x86_64-unknown-linux-gnu (default)
rustc 1.55.0-nightly (59216858a 2021-07-18)
...
```
This shows the rust version used by the redoxer image.
I produced this output by running the CI with gitlab-runner in a Ubuntu 22.10 VM locally.
I inserted the following line in the before_script section
```text
rustup show
```
## Suggestion
Would it be possible to update the image redoxos/redoxer from docker hub ? I think that could solve the problem.https://gitlab.redox-os.org/redox-os/ion/-/issues/834Cannot write functions with variable argument count2023-01-31T05:35:01ZZach ButtonCannot write functions with variable argument countIt appears to only be possible to define functions with a fixed number of arguments.
Perhaps the simplest solution would be some basic polymorphism. Example:
```shell
fn doStuff a b
echo a: $a, b: $b
end
fn doStuff a
doStuff $a "not...It appears to only be possible to define functions with a fixed number of arguments.
Perhaps the simplest solution would be some basic polymorphism. Example:
```shell
fn doStuff a b
echo a: $a, b: $b
end
fn doStuff a
doStuff $a "not_specified"
end
doStuff "test"
# "a: test, b: not_specified"
```
Or, perhaps cleaner, argument expansion:
```shell
fn printSection label ...list
echo -e "\n\n$label:"
for item in @list
echo "- $item"
end
end
printSection todo "type foo" "make bar"
# todo:
# - type foo
# - make bar
```unplanned