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/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/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/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/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/1016Panic on `&&` and `||` operators2022-11-19T07:45:37ZAurélien CléracPanic on `&&` and `||` operatorsbug: Logical operators `&&` and `||` may panic if not followed by a command.
expect: syntax error.
related: none.
test case#1
code: input
```
ls &&||
```
test case#2
code: input
```
ls &&;
```
actual: output
```
[...]
thread 'main' ...bug: Logical operators `&&` and `||` may panic if not followed by a command.
expect: syntax error.
related: none.
test case#1
code: input
```
ls &&||
```
test case#2
code: input
```
ls &&;
```
actual: output
```
[...]
thread 'main' panicked at 'begin <= end (6 <= 5) when slicing `ls &&||`', src/lib/parser/statement/splitter.rs:55:35
stack backtrace:
[...]
4: ion_shell::parser::statement::splitter::StatementSplitter::get_statement
5: <ion_shell::parser::statement::splitter::StatementSplitter as core::iter::traits::iterator::Iterator>::next
6: ion_shell::shell::flow::<impl ion_shell::shell::Shell>::on_command
7: ion::binary::InteractiveShell::exec
8: ion::binary::InteractiveShell::execute_interactive
9: ion::main
Abandon (core dumped)
```
expect: output
```
ion: syntax error: expected command, but found `||`
```
version: ion 1.0.0-alpha (x86_64-unknown-linux-gnu), rev 814ed5a887ad88b98b142af28f653ff4f249de6c
interaction: none
---
According to backtrace, the bug came from src/lib/parser/statement/splitter.rs:55:35 which is :
```
fn get_statement(&self, start: usize, end: usize) -> StatementVariant<'a> {
if self.logical == LogicalOp::And {
StatementVariant::And(self.data[start + 1..end].trim())
^^^^^^^^^^^^^^^
} else if self.logical == LogicalOp::Or {
StatementVariant::Or(self.data[start + 1..end].trim())
} else {
StatementVariant::Default(self.data[start..end].trim())
}
}
```
called by src/lib/parser/statement/splitter.rs:160:42 and src/lib/parser/statement/splitter.rs:171:42 :
```
b';' if self.paren_level == 0 => {
let statement = self.get_statement(start, i);
^^^^^^^^^^^^^^^^^^^^^^^
self.logical = LogicalOp::None;
self.read = i + 1;
return match error {
Some(error) => Some(Err(error)),
None => Some(Ok(statement)),
};
}
b'&' | b'|' if self.paren_level == 0 && last == Some(character) => {
// Detecting if there is a 2nd `&` character
let statement = self.get_statement(start, i - 1);
^^^^^^^^^^^^^^^^^^^^^^^^^^^
self.logical = if character == b'&' { LogicalOp::And } else { LogicalOp::Or };
self.read = i + 1;
return match error {
Some(error) => Some(Err(error)),
None => Some(Ok(statement)),
};
}
_ => {}
}
last = Some(character);
}
```
On both calls, _get_statement_ try to slice the command line with incorrect index.
If we pick test case#1, `ls &&||`, _start_ equals 5 but is added 1 and _i_ equals 6 minus 1 which gives `&"ls &&||"[6..5]`.
As I understand, syntax is checked along the command execution so a syntax error can be raised while Ion
has already executed N statements from a given command line. Ion could check if `self.logical` is already
set to _And_ or _Or_ instead of _None_ while performing `&&`, `||` or `;` but it does not look quite right
and did not pass cargo test(infinity loop) when I tried to implement it.
I'm pretty new to Rust and it feels a bit overwhelming for now to find an elegant solution which does fit well
with Ion's codebase.
Thanks in advance for your help,
Aurélienhttps://gitlab.redox-os.org/redox-os/ion/-/issues/1014README documentation links broken2022-09-17T14:22:20ZzraktvorREADME documentation links brokenBoth links to documentation in the README point to https://doc.redox-os.org/ion-manual/html, which gives an http error 404.
The correct link seems to be https://doc.redox-os.org/ion-manual.Both links to documentation in the README point to https://doc.redox-os.org/ion-manual/html, which gives an http error 404.
The correct link seems to be https://doc.redox-os.org/ion-manual.https://gitlab.redox-os.org/redox-os/ion/-/issues/1007Why does the "dirs" buildin behave the way it does?2021-08-07T09:14:26ZKrisWhy does the "dirs" buildin behave the way it does?bug: description
expect: outcome description
related: none
code: input
```
cd Downloads/
dirs
shell code
```
cd Downloads/
dirs
expect: output
```
~/Downloads
result
```
/home/user/Downloads
kernel: linux5.12.14_1
version: `ion 1....bug: description
expect: outcome description
related: none
code: input
```
cd Downloads/
dirs
shell code
```
cd Downloads/
dirs
expect: output
```
~/Downloads
result
```
/home/user/Downloads
kernel: linux5.12.14_1
version: `ion 1.0.0-alpha (x86_64-unknown-linux-gnu)
rev 2bc8826a97929b1878375a5c747e5c4cfed2b10b`
interaction: none
behavior of bash/dash/zsh/fish/oil: in bash and zsh the dirs buildin doesn't show the user's home directoryhttps://gitlab.redox-os.org/redox-os/ion/-/issues/1009IS The Shell Being Maintained2021-08-07T09:02:28Zlinux6osIS The Shell Being Maintainedis ion shell being manintained if it is then in the AUR(aur.archlinux.org) it is not being updated from 2 years and how do i compile it so i can update whenever there is a bug fix or release
i want to put it in my distro so thats why i a...is ion shell being manintained if it is then in the AUR(aur.archlinux.org) it is not being updated from 2 years and how do i compile it so i can update whenever there is a bug fix or release
i want to put it in my distro so thats why i am raising the issuehttps://gitlab.redox-os.org/redox-os/ion/-/issues/272Implement Set Command2021-07-04T11:13:36ZMichael Aaron Murphymmstick@pm.meImplement Set CommandWe need to implement basic support for controlling shell parameters within the interpreter. I'd like to see a flags field that's either a u8 or u16, depending on how many flags we want to support. At the very least, we need to support th...We need to implement basic support for controlling shell parameters within the interpreter. I'd like to see a flags field that's either a u8 or u16, depending on how many flags we want to support. At the very least, we need to support the `-e` flag at the moment.
It shouldn't be too hard. Just implement it as a builtin command, then add some associated logic in the **FlowLogic** to check certain parameters, such as the **errexit** flag.
From Bash as a guideline:
```
set: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
Set or unset values of shell options and positional parameters.
Change the value of shell attributes and positional parameters, or
display the names and values of shell variables.
Options:
-a Mark variables which are modified or created for export.
-b Notify of job termination immediately.
-e Exit immediately if a command exits with a non-zero status.
-f Disable file name generation (globbing).
-h Remember the location of commands as they are looked up.
-k All assignment arguments are placed in the environment for a
command, not just those that precede the command name.
-m Job control is enabled.
-n Read commands but do not execute them.
-o option-name
Set the variable corresponding to option-name:
allexport same as -a
braceexpand same as -B
emacs use an emacs-style line editing interface
errexit same as -e
errtrace same as -E
functrace same as -T
hashall same as -h
histexpand same as -H
history enable command history
ignoreeof the shell will not exit upon reading EOF
interactive-comments
allow comments to appear in interactive commands
keyword same as -k
monitor same as -m
noclobber same as -C
noexec same as -n
noglob same as -f
nolog currently accepted but ignored
notify same as -b
nounset same as -u
onecmd same as -t
physical same as -P
pipefail the return value of a pipeline is the status of
the last command to exit with a non-zero status,
or zero if no command exited with a non-zero status
posix change the behavior of bash where the default
operation differs from the Posix standard to
match the standard
privileged same as -p
verbose same as -v
vi use a vi-style line editing interface
xtrace same as -x
-p Turned on whenever the real and effective user ids do not match.
Disables processing of the $ENV file and importing of shell
functions. Turning this option off causes the effective uid and
gid to be set to the real uid and gid.
-t Exit after reading and executing one command.
-u Treat unset variables as an error when substituting.
-v Print shell input lines as they are read.
-x Print commands and their arguments as they are executed.
-B the shell will perform brace expansion
-C If set, disallow existing regular files to be overwritten
by redirection of output.
-E If set, the ERR trap is inherited by shell functions.
-H Enable ! style history substitution. This flag is on
by default when the shell is interactive.
-P If set, do not resolve symbolic links when executing commands
such as cd which change the current directory.
-T If set, the DEBUG and RETURN traps are inherited by shell functions.
-- Assign any remaining arguments to the positional parameters.
If there are no remaining arguments, the positional parameters
are unset.
- Assign any remaining arguments to the positional parameters.
The -x and -v options are turned off.
Using + rather than - causes these flags to be turned off. The
flags can also be used upon invocation of the shell. The current
set of flags may be found in $-. The remaining n ARGs are positional
parameters and are assigned, in order, to $1, $2, .. $n. If no
ARGs are given, all shell variables are printed.
Exit Status:
Returns success unless an invalid option is given.
```Michael Aaron Murphymmstick@pm.meMichael Aaron Murphymmstick@pm.mehttps://gitlab.redox-os.org/redox-os/ion/-/issues/610Recursive aliases2021-06-24T22:13:19ZMichael Aaron Murphymmstick@pm.meRecursive aliases*Created by: passcod*
**Reproduction**: [describe how you are able to reproduce ("trigger") this bug/issue.]
```ion
$ alias y=pacaur
$ alias ys='y -Ss'
```
**Expected behavior**: [describe the behavior you would expect the repr...*Created by: passcod*
**Reproduction**: [describe how you are able to reproduce ("trigger") this bug/issue.]
```ion
$ alias y=pacaur
$ alias ys='y -Ss'
```
**Expected behavior**: [describe the behavior you would expect the repro to yield.]
```ion
$ ys foo
<`pacaur -Ss foo` runs>
```
**Actual behavior**: [describe the actual behavior, which is presented through the repro.].
```ion
$ ys
ion: command not found: y
```
**Build information**: [output of `rustc -V`, `git rev-parse HEAD`, `qemu-i386 -version`, `uname -a`, `ion --version`, etc.]
```
passcod:~# uname -a
Linux kaydel-ko 4.13.12-1-ARCH #1 SMP PREEMPT Wed Nov 8 11:54:06 CET 2017 x86_64 GNU/Linux
passcod:~# rustc +nightly -V
rustc 1.23.0-nightly (e97ba8328 2017-11-25)
passcod:~# ion --version
ion 1.0.5 (x86_64-unknown-linux-gnu)
rev bfe7dffe507bb2565cf9feb92b46da6059b7757b
```
Built from git using cargo install.https://gitlab.redox-os.org/redox-os/ion/-/issues/975Manual: super and global namespaces example doesn't demonstrate the feature2021-06-02T19:24:13ZbakaManual: super and global namespaces example doesn't demonstrate the featureThe [Scopes (super and global namespaces)](https://doc.redox-os.org/ion-manual/html/variables/07-namespaces.html#scopes-super-and-global-namespaces) example is as follows:
```
let a = 1
fn demo
let b = 2
fn nested
echo ${super...The [Scopes (super and global namespaces)](https://doc.redox-os.org/ion-manual/html/variables/07-namespaces.html#scopes-super-and-global-namespaces) example is as follows:
```
let a = 1
fn demo
let b = 2
fn nested
echo ${super::b}
echo ${global::a}
end
nested
end
demo
```
This code is functionally equivalent to:
```
let a = 1
fn demo
let b = 2
fn nested
echo $b
echo $a
end
nested
end
demo
```
This doesn't demonstrate the super and global namespace feature since $a and $b can be accessed just fine without using them.
In fact, I could not find any situation where this feature would apply. The [Scopes chapter](https://doc.redox-os.org/ion-manual/html/variables/06-scopes.html) says `Functions have the scope they were defined in.` which from my understanding implies a function always has access to the "super" scope (and if applied recursively, the global scope).
One guess was that this feature was meant to a situation like this where the variable is defined in the scope the function was called from:
```
fn print_vars
echo ${super::y}
end
if test 1 == 1
let y = 3
print_vars
end
```
However that doesn't work (and I guess is unnecessary since you can pass variables to functions as a parameter).Ion Shell v1.0.0betahttps://gitlab.redox-os.org/redox-os/ion/-/issues/962alias of a fn: allow function alias2021-06-02T14:09:37Zkoliaalias of a fn: allow function alias(coerce trailing arguments into an array) -> not sure why this is needed with the inbuilds.
feat:
`alias cmd = _cmd_fn` where RHS `_cmd_fn` is a fn
with the semantics that `cmd args...` calls `_cmd_fn args...` while coercing trailing a...(coerce trailing arguments into an array) -> not sure why this is needed with the inbuilds.
feat:
`alias cmd = _cmd_fn` where RHS `_cmd_fn` is a fn
with the semantics that `cmd args...` calls `_cmd_fn args...` while coercing trailing args into an array.
Alternatively, a new keyword other than the existing `alias` keyword could be used.
This would be non-breaking syntactic sugar. It would allow you to do for example:
```
fn _f arg1 trailing:[str]
...
end
alias f = _f
f arg1
f arg1 arg2
f arg1 arg2 arg3
...
```
which would call:
```
_f arg1 []
_f arg1 [ arg2 ]
_f arg1 [ arg2 arg3 ]
```
The use case is exposing commands for which typing the `[]` is prohibitive. For example, to use [zoxide](https://github.com/ajeetdsouza/zoxide/issues/66) with ion, the best that can be currently done as far as I can tell is `z [ dirname ]`, which is not ergonomic enough for a command that needs to be very fast to type, since its purpose is to be a faster more convenient `cd`. This would allow `z dirname`.
This comes up in other issues like #952.
This proposal is aiming at the same use case as #834, without changing `fn` or `let` definitions. Instead, the proposed alias would just be syntactic sugar that avoids requiring the brackets. (Supporting functions with variadic args would make `fn` definitions more complicated and less clear.)
bash/dash/zsh/fish all allow functions to have variable numbers of arguments.unplannedhttps://gitlab.redox-os.org/redox-os/ion/-/issues/893Failed running Ion with AlpineLinux2021-06-01T17:24:11ZNiklas Rosencrantzniklasr@protonmail.comFailed running Ion with AlpineLinuxI tried building it in a dockerized AlpineLinux. It did build the target but there is an error message when I tried to execute commands (echo $0, pwd, ls...). I can try again with some other Linux but my first attempt with Alpine failed.I tried building it in a dockerized AlpineLinux. It did build the target but there is an error message when I tried to execute commands (echo $0, pwd, ls...). I can try again with some other Linux but my first attempt with Alpine failed.Ion Shell v1.0.0betahttps://gitlab.redox-os.org/redox-os/ion/-/issues/777Array Index Range Assignment2021-06-01T13:04:51ZMichael Aaron Murphymmstick@pm.meArray Index Range AssignmentAs per the Ion specification:
### Array Index Range Assignment
[array-index-range-assignment]: #array-index-range-assignment
It is also possible to assign an array to replace a range of values. The array being assigned to
that region m...As per the Ion specification:
### Array Index Range Assignment
[array-index-range-assignment]: #array-index-range-assignment
It is also possible to assign an array to replace a range of values. The array being assigned to
that region may be smaller or larger than the region it is replacing.
```
$ let FOO = [1 2 3 4]
$ let FOO[..1] = [4 5 6]
$ let FOO[2..3] = [7]
$ echo @FOO
4 5 6 7
```Ion Shell v1.0.0stratactstratact1@gmail.comstratactstratact1@gmail.com