Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blesh: init at 2022-07-24 #181963

Merged
merged 8 commits into from
Jul 25, 2022
Merged

blesh: init at 2022-07-24 #181963

merged 8 commits into from
Jul 25, 2022

Conversation

aiotter
Copy link
Member

@aiotter aiotter commented Jul 18, 2022

Description of changes

Adds bre.shble.sh.

Use this package by executing source ble.sh on bash.
Users can modify their ~/.bashrc to have it loaded on login:

# bashrc

# Add this lines at the top of .bashrc:
[[ $- == *i* ]] && source ble.sh --noattach

# your bashrc settings come here...

# Add this line at the end of .bashrc:
[[ ${BLE_VERSION-} ]] && ble-attach

See https://github.com/akinomyoga/ble.sh#13-set-up-bashrc for more detail.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@aiotter
Copy link
Member Author

aiotter commented Jul 18, 2022

@akinomyoga Pinging the creator of bre.sh ble.sh for his reference. Please let me know if you find something that I missed!

@aiotter aiotter changed the title ble-sh: init at 0.3.3 ble.sh: init at 0.3.3 Jul 18, 2022
Copy link

@akinomyoga akinomyoga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for creating a package of ble.sh!

There seems to be already a similar PR #160857, though it is for the devel version 0.4. You might find the comments therein useful.

btw, not bre.sh but ble.sh.

pkgs/shells/bash/ble.sh/default.nix Outdated Show resolved Hide resolved
@akinomyoga
Copy link

Maybe @SuperSandro2000 also have comments as @SuperSandro2000 seemed to have once attempted to use ble.sh with NixOS.

@aiotter
Copy link
Member Author

aiotter commented Jul 18, 2022

Oh sorry for typo😅

I didn't noticed of #160857. I wish I had found it; it might sped up my work.
I wonder @axelf4 can take a look at my work? He reviewed the previous work, so he might interested.

The existence of bin/ble.sh will be the main target of discussion. And also the explicit gawk dependency?

@aiotter
Copy link
Member Author

aiotter commented Jul 18, 2022

This is a quick note for reviewers:

I made this derivation first for the latest unstable ble.sh not v0.3.3, and downgraded it afterwards. v0.3.3 does not require git, but I left it on purpose to make it easier to upgrade. Those who want to use the latest version can override it with ease.

name = "ble.sh";
version = "0.3.3";

nativeBuildInputs = [ git ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is git needed for a... line editor?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, it should be after src.

Copy link

@akinomyoga akinomyoga Jul 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a build-time dependency.

Edit: The GNUmakefile internally calls git submodule update, but I guess we don't need it as far as we specify fetchSubmodules = true?

Copy link
Member Author

@aiotter aiotter Jul 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On latest unstable ble.sh it is used to ensure submodule is fetched. v0.3.3 does not require it thou.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After removing git, it is unable to be built anymore although fetchSubmodules = true. I'll leave this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git submodule update

If ble.sh works inside the store or the sandbox this will not work. If we fetch the submodules anyway we don't need git and should rather remove that line of code.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Git is a dependency of make here. It's not a runtime-dependency.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SuperSandro2000 Let me correct myself. I have written above that

I guess we don't need it as far as we specify fetchSubmodules = true?

but I was forgetting that the build-time dependency on git is not only for fetching submodules. We also need git to determine the embedded version string of ble.sh. The command git is called by this line and this line at the build time.

pkgs/shells/bash/ble.sh/default.nix Outdated Show resolved Hide resolved
pkgs/shells/bash/ble.sh/default.nix Outdated Show resolved Hide resolved
@aiotter
Copy link
Member Author

aiotter commented Jul 19, 2022

Resolved all the discussion above🎉
Thanks all of you guys for your review! Please let me know if I still missing something

Follow more standard approach
@aiotter
Copy link
Member Author

aiotter commented Jul 22, 2022

Added one commit from discussion at akinomyoga/ble.sh#212 (reply in thread).
This PR is still ready to merge!

@aiotter
Copy link
Member Author

aiotter commented Jul 22, 2022

I don't know what I should do to fix the EditorConfig error...
It is right that I mixed up tabs and spaces, but it is intended. Here-document requires tabs.

Can I just ignore the failing test?

cat <<-EOS >/dev/stderr
You cannot update ble.sh automatically via Nix.
The latest ble.sh from master branch can be installed by overriding nixpkgs like following.
pkgs.ble-sh.overrideAttrs (_: {
src = pkgs.fetchgit {
url = "https://github.com/akinomyoga/ble.sh.git";
rev = "\$rev";
hash = "\$hash";
fetchSubmodules = true;
leaveDotGit = true;
};
doCheck = false;
});
EOS

@SuperSandro2000
Copy link
Member

SuperSandro2000 commented Jul 22, 2022

Maybe @SuperSandro2000 also have comments as @SuperSandro2000 seemed to have once attempted to use ble.sh with NixOS.

I am using it right now but I just cloned the repository.

I made this derivation first for the latest unstable ble.sh not v0.3.3, and downgraded it afterwards. v0.3.3 does not require git, but I left it on purpose to make it easier to upgrade. Those who want to use the latest version can override it with ease.

I would recommend to not package the latest stable but unstable. We also don't want to keep compatibility code for a version thats two years old. Also upstream would likely not take any bug reports for that old version and I already reported a handful of bugs and I am barely using its full potential.


I didn't noticed of #160857. I wish I had found it; it might sped up my work.

Thats a very default file which should only save you a few minutes at best.


It is right that I mixed up tabs and spaces, but it is intended. Here-document requires tabs.

It does not. It also works with spaces.

Can I just ignore the failing test?

nope

@SuperSandro2000 SuperSandro2000 mentioned this pull request Jul 22, 2022
13 tasks
@gi-yt
Copy link

gi-yt commented Jul 22, 2022

great to see work done on ble.sh on nix!
i stopped using nixos for a while, hence couldn't really work on the PR

pkgs/shells/bash/ble.sh/default.nix Outdated Show resolved Hide resolved
pkgs/shells/bash/ble.sh/default.nix Outdated Show resolved Hide resolved
pkgs/shells/bash/ble.sh/default.nix Outdated Show resolved Hide resolved
Comment on lines 21 to 28
postInstall = ''
mkdir -p "$out/bin"
cat <<SCRIPT >"$out/bin/ble.sh-share"
#!${runtimeShell}
# Run this script to find the ble.sh shared folder
# where all the shell scripts are living.
echo "$out/share/ble.sh"
SCRIPT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this at all. We can just source the files inside of programs.bash.interactiveShellInit where we can refer to $pkgs.ble-sh.

Copy link
Member Author

@aiotter aiotter Jul 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not all the users are using configuration.nix. And this way is described on the nixpkgs docs, which is why I assumed it is the current standard way of packaging programs like ble.sh.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is that described in the docs?

If you are not on NixOS you install this with either home-manager or nix-env and would source it from the symlink in your home directory.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pkgs/top-level/all-packages.nix Show resolved Hide resolved
@aiotter
Copy link
Member Author

aiotter commented Jul 22, 2022

It does not. It also works with spaces.

Are you sure? I made a quick test for this, and the spaces does not work as intended (EOS at the end caused the error).
man bash does not say that <<- (here-document starting mark variant) works with spaces, it only says it works with tabs.

You can just throw away the readability of the bash script by deleting the indent and use << mark. It seems the only solution for me as long as we use here-document.

@aiotter
Copy link
Member Author

aiotter commented Jul 22, 2022

I don't think latest master should be packaged. ble.sh is a frequently updated project. I don't think it's a good idea that I keep deciding which commit is valuable enough to update the nix package as a package maintainer.

Do you think it's a good idea to distribute the "nightly" version, @akinomyoga? Do you have a plan to update the nightly tag?

@aiotter
Copy link
Member Author

aiotter commented Jul 23, 2022

What!? Ofborg reports no error! On my environment (darwin x86-64) the check phase is broken😭
It's okay if it is just a problem on my environment. It helps if anyone can clone this PR and check it locally.

@akinomyoga
Copy link

I have never run the check on macOS. Could you share the error messages for the make check?

@aiotter
Copy link
Member Author

aiotter commented Jul 23, 2022

This is a result when I execute `make check` on bash prompt:
$ make check
bash make_command.sh check
MACHTYPE: x86_64-apple-darwin21
BLE_VERSION: 0.4.0-devel3+1c7f7a1
BASH_VERSION: 3.2.57(1)-release
/Users/aiotter/repo/github.com/akinomyoga/ble.sh/out/lib/test-main.sh:54 ():
    ble/util/readlink f.txt
    [[ $ret != /* ]] && ret=${PWD%/}/$ret
--- 81028.ret.expect    2022-07-23 22:13:13.000000000 +0900
+++ 81028.ret.result    2022-07-23 22:13:13.000000000 +0900
@@ -1 +1 @@
-/tmp/blesh/501/80939.test/81028.d/ab/cd/ef/file.txt
+/private/tmp/blesh/501/80939.test/81028.d/ab/cd/link1/ef/file.txt

 94.7% [section] ble/main: 18/19 (1 fail, 0 crash, 0 skip)
/Users/aiotter/repo/github.com/akinomyoga/ble.sh/out/lib/test-util.sh:1445 (): ret=$BASHPID
--- 81194.ret.expect    2022-07-23 22:13:16.000000000 +0900
+++ 81194.ret.result    2022-07-23 22:13:16.000000000 +0900
@@ -1,2 +1 @@
--n 81194
-
+81194

/Users/aiotter/repo/github.com/akinomyoga/ble.sh/out/lib/test-util.sh:1452 (): [[ $BASHPID == $ppid ]]
--- 81202.exit.expect   2022-07-23 22:13:16.000000000 +0900
+++ 81202.exit.result   2022-07-23 22:13:16.000000000 +0900
@@ -1 +1 @@
-0
+1

 99.8% [section] ble/util: 1183/1185 (2 fail, 0 crash, 41 skip)
100.0% [section] ble/canvas/trace (relative:confine:measure-bbox): 5/5 (0 fail, 0 crash, 12 skip)
100.0% [section] ble/canvas/trace (cfuncs): 17/17 (0 fail, 0 crash, 1 skip)
100.0% [section] ble/canvas/trace (justify): 2/2 (0 fail, 0 crash, 22 skip)
100.0% [section] ble/canvas/trace-text: 11/11 (0 fail, 0 crash, 0 skip)
100.0% [section] ble/textmap#update: 5/5 (0 fail, 0 crash, 0 skip)
100.0% [section] ble/unicode/GraphemeCluster/c2break: 38/38 (0 fail, 0 crash, 34 skip)
---.-% [section] ble/unicode/GraphemeCluster/c2break (GraphemeBreakTest.txt): 0/0 (0 fail, 0 crash, 3251 skip)
100.0% [section] ble/decode: 33/33 (0 fail, 0 crash, 0 skip)
100.0% [section] ble/edit: 2/2 (0 fail, 0 crash, 0 skip)
100.0% [section] ble/syntax: 22/22 (0 fail, 0 crash, 0 skip)
100.0% [section] ble/complete: 7/7 (0 fail, 0 crash, 0 skip)
ble: The test log was saved to '/Users/aiotter/repo/github.com/akinomyoga/ble.sh/out/cache.d/501/test.20220723.221312.log'.
make: *** [check] Error 1
And this is a log created on building a derivation of this PR (quite long):
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/fw6nappbiz2p6h6d24aa8hx43bp94sg3-source
source root is source
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
no configure script, doing nothing
@nix { "action": "setPhase", "phase": "buildPhase" }
building
build flags: SHELL=/nix/store/8269022kjb67pdc375mjcmnx0a5xhz3r-bash-5.1-p16/bin/bash
mkdir -p out
DEPENDENCIES_PHONY=1 DEPENDENCIES_OUTPUT=out/ble.dep DEPENDENCIES_TARGET=out/ble.sh FULLVER=0.4.0-devel3 \
  /nix/store/lmcw4d36hax9zshc54gv1pqkyvjhak08-gawk-5.1.1/bin/gawk -f make/mwg_pp.awk ble.pp >/dev/null
mkdir -p out/keymap
cp -p keymap/emacs.sh out/keymap/emacs.sh
cp -p keymap/vi.sh out/keymap/vi.sh
cp -p keymap/vi_digraph.sh out/keymap/vi_digraph.sh
cp -p keymap/vi_digraph.txt out/keymap/vi_digraph.txt
cp -p keymap/vi_test.sh out/keymap/vi_test.sh
mkdir -p out/lib
cp -p lib/init-term.sh out/lib/init-term.sh
cp -p lib/init-bind.sh out/lib/init-bind.sh
cp -p lib/init-cmap.sh out/lib/init-cmap.sh
/nix/store/lmcw4d36hax9zshc54gv1pqkyvjhak08-gawk-5.1.1/bin/gawk -f make/mwg_pp.awk lib/init-msys1.sh > out/lib/init-msys1.sh
cp -p lib/core-complete.sh out/lib/core-complete.sh
/nix/store/lmcw4d36hax9zshc54gv1pqkyvjhak08-gawk-5.1.1/bin/gawk -f make/mwg_pp.awk lib/core-syntax.sh > out/lib/core-syntax.sh
cp -p lib/core-test.sh out/lib/core-test.sh
cp -p lib/core-cmdspec.sh out/lib/core-cmdspec.sh
cp -p lib/core-debug.sh out/lib/core-debug.sh
cp -p lib/core-edit.ignoreeof-messages.txt out/lib/core-edit.ignoreeof-messages.txt
cp -p lib/core-decode.emacs-rlfunc.txt out/lib/core-decode.emacs-rlfunc.txt
cp -p lib/core-decode.vi_imap-rlfunc.txt out/lib/core-decode.vi_imap-rlfunc.txt
cp -p lib/core-decode.vi_nmap-rlfunc.txt out/lib/core-decode.vi_nmap-rlfunc.txt
cp -p lib/vim-surround.sh out/lib/vim-surround.sh
cp -p lib/vim-arpeggio.sh out/lib/vim-arpeggio.sh
cp -p lib/vim-airline.sh out/lib/vim-airline.sh
cp -p lib/test-main.sh out/lib/test-main.sh
cp -p lib/test-util.sh out/lib/test-util.sh
/nix/store/lmcw4d36hax9zshc54gv1pqkyvjhak08-gawk-5.1.1/bin/gawk -f make/mwg_pp.awk lib/test-canvas.sh > out/lib/test-canvas.sh
cp -p lib/test-decode.sh out/lib/test-decode.sh
cp -p lib/test-edit.sh out/lib/test-edit.sh
cp -p lib/test-syntax.sh out/lib/test-syntax.sh
cp -p lib/test-complete.sh out/lib/test-complete.sh
mkdir -p out/contrib
mkdir -p out/contrib/airline
mkdir -p out/contrib/config
mkdir -p out/contrib/integration
cp -p contrib/bash-preexec.bash out/contrib/bash-preexec.bash
cp -p contrib/fzf-completion.bash out/contrib/fzf-completion.bash
cp -p contrib/fzf-git.bash out/contrib/fzf-git.bash
cp -p contrib/fzf-initialize.bash out/contrib/fzf-initialize.bash
cp -p contrib/fzf-key-bindings.bash out/contrib/fzf-key-bindings.bash
cp -p contrib/prompt-defer.bash out/contrib/prompt-defer.bash
cp -p contrib/prompt-elapsed.bash out/contrib/prompt-elapsed.bash
cp -p contrib/prompt-git.bash out/contrib/prompt-git.bash
cp -p contrib/prompt-vim-mode.bash out/contrib/prompt-vim-mode.bash
cp -p contrib/airline/atomic.bash out/contrib/airline/atomic.bash
cp -p contrib/airline/dark.bash out/contrib/airline/dark.bash
cp -p contrib/airline/dark_minimal.bash out/contrib/airline/dark_minimal.bash
cp -p contrib/airline/google_dark.bash out/contrib/airline/google_dark.bash
cp -p contrib/airline/google_light.bash out/contrib/airline/google_light.bash
cp -p contrib/airline/landscape.bash out/contrib/airline/landscape.bash
cp -p contrib/airline/light.bash out/contrib/airline/light.bash
cp -p contrib/airline/minimalist.bash out/contrib/airline/minimalist.bash
cp -p contrib/airline/monochrome.bash out/contrib/airline/monochrome.bash
cp -p contrib/airline/solarized.bash out/contrib/airline/solarized.bash
cp -p contrib/airline/solarized_flood.bash out/contrib/airline/solarized_flood.bash
cp -p contrib/airline/term.bash out/contrib/airline/term.bash
cp -p contrib/airline/term_light.bash out/contrib/airline/term_light.bash
cp -p contrib/airline/transparent.bash out/contrib/airline/transparent.bash
cp -p contrib/airline/xtermlight.bash out/contrib/airline/xtermlight.bash
cp -p contrib/config/execmark.bash out/contrib/config/execmark.bash
cp -p contrib/integration/zoxide.bash out/contrib/integration/zoxide.bash
mkdir -p out/doc
cp -p README.md out/doc/README.md
cp -p README-ja_JP.md out/doc/README-ja_JP.md
cp -p LICENSE.md out/doc/LICENSE.md
cp -p docs/CONTRIBUTING.md out/doc/CONTRIBUTING.md
cp -p docs/ChangeLog.md out/doc/ChangeLog.md
cp -p docs/Release.md out/doc/Release.md
mkdir -p out/doc/contrib
cp -p contrib/LICENSE out/doc/contrib/LICENSE
cp -p contrib/README-ja.md out/doc/contrib/README-ja.md
cp -p contrib/README.md out/doc/contrib/README.md
@nix { "action": "setPhase", "phase": "checkPhase" }
running tests
check flags: SHELL=/nix/store/8269022kjb67pdc375mjcmnx0a5xhz3r-bash-5.1-p16/bin/bash VERBOSE=y check
bash make_command.sh check
ble.sh: insane environment: The command(s), `ps', not found. Check your environment variable PATH.
ble.sh: modified PATH=/usr/bin:/bin:/usr/sbin:/sbin:$PATH
ble.sh: insane environment: $USER is empty.
ble.sh: modified USER=_nixbld1
ble/term.sh: updating tput cache for TERM=xterm-256color... 
ble/term.sh: updating tput cache for TERM=xterm-256color... done
MACHTYPE: x86_64-apple-darwin17.7.0
BLE_VERSION: 0.4.0-devel3+a450775
BASH_VERSION: 5.1.16(1)-release
�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-main.sh:54�[m: �[91m
    ble/util/readlink f.txt
    [[ $ret != /* ]] && ret=${PWD%/}/$ret�[m
--- 89905.ret.expect	2022-07-23 11:52:21.000000000 +0000
+++ 89905.ret.result	2022-07-23 11:52:21.000000000 +0000
@@ -1 +1 @@
-/tmp/blesh/301/89806.test/89905.d/ab/cd/ef/file.txt
+/private/tmp/blesh/301/89806.test/89905.d/ab/cd/link1/ef/file.txt

�[31m 94.7%�[m [section] ble/main: �[31m18/19�[m (1 fail, 0 crash, 0 skip)
/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh: line 685: warning: setlocale: LC_ALL: cannot change locale (en_US.utf8): No such file or directory
�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:785�[m: �[91mble/string#create-unicode-progress-bar  1 24 3�[m
--- 89989.ret.expect	2022-07-23 11:52:22.000000000 +0000
+++ 89989.ret.result	2022-07-23 11:52:22.000000000 +0000
@@ -1 +1 @@
-‚ñè  
+1  

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:786�[m: �[91mble/string#create-unicode-progress-bar  2 24 3�[m
--- 89989.ret.expect	2022-07-23 11:52:22.000000000 +0000
+++ 89989.ret.result	2022-07-23 11:52:22.000000000 +0000
@@ -1 +1 @@
-‚ñé  
+2  

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:787�[m: �[91mble/string#create-unicode-progress-bar  3 24 3�[m
--- 89989.ret.expect	2022-07-23 11:52:22.000000000 +0000
+++ 89989.ret.result	2022-07-23 11:52:22.000000000 +0000
@@ -1 +1 @@
-‚ñç  
+3  

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:788�[m: �[91mble/string#create-unicode-progress-bar  4 24 3�[m
--- 89989.ret.expect	2022-07-23 11:52:22.000000000 +0000
+++ 89989.ret.result	2022-07-23 11:52:22.000000000 +0000
@@ -1 +1 @@
-‚ñå  
+4  

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:789�[m: �[91mble/string#create-unicode-progress-bar  5 24 3�[m
--- 89989.ret.expect	2022-07-23 11:52:22.000000000 +0000
+++ 89989.ret.result	2022-07-23 11:52:22.000000000 +0000
@@ -1 +1 @@
-‚ñã  
+5  

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:790�[m: �[91mble/string#create-unicode-progress-bar  6 24 3�[m
--- 89989.ret.expect	2022-07-23 11:52:22.000000000 +0000
+++ 89989.ret.result	2022-07-23 11:52:22.000000000 +0000
@@ -1 +1 @@
-‚ñä  
+6  

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:791�[m: �[91mble/string#create-unicode-progress-bar  7 24 3�[m
--- 89989.ret.expect	2022-07-23 11:52:22.000000000 +0000
+++ 89989.ret.result	2022-07-23 11:52:22.000000000 +0000
@@ -1 +1 @@
-‚ñâ  
+7  

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:792�[m: �[91mble/string#create-unicode-progress-bar  8 24 3�[m
--- 89989.ret.expect	2022-07-23 11:52:22.000000000 +0000
+++ 89989.ret.result	2022-07-23 11:52:22.000000000 +0000
@@ -1 +1 @@
-‚ñà  
+*  

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:793�[m: �[91mble/string#create-unicode-progress-bar  9 24 3�[m
--- 89989.ret.expect	2022-07-23 11:52:22.000000000 +0000
+++ 89989.ret.result	2022-07-23 11:52:22.000000000 +0000
@@ -1 +1 @@
-‚ñà‚ñè 
+*1 

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:794�[m: �[91mble/string#create-unicode-progress-bar 15 24 3�[m
--- 89989.ret.expect	2022-07-23 11:52:22.000000000 +0000
+++ 89989.ret.result	2022-07-23 11:52:22.000000000 +0000
@@ -1 +1 @@
-‚ñà‚ñâ 
+*7 

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:795�[m: �[91mble/string#create-unicode-progress-bar 16 24 3�[m
--- 89989.ret.expect	2022-07-23 11:52:22.000000000 +0000
+++ 89989.ret.result	2022-07-23 11:52:22.000000000 +0000
@@ -1 +1 @@
-‚ñà‚ñà 
+** 

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:796�[m: �[91mble/string#create-unicode-progress-bar 17 24 3�[m
--- 89989.ret.expect	2022-07-23 11:52:22.000000000 +0000
+++ 89989.ret.result	2022-07-23 11:52:22.000000000 +0000
@@ -1 +1 @@
-‚ñà‚ñà‚ñè
+**1

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:797�[m: �[91mble/string#create-unicode-progress-bar 24 24 3�[m
--- 89989.ret.expect	2022-07-23 11:52:22.000000000 +0000
+++ 89989.ret.result	2022-07-23 11:52:22.000000000 +0000
@@ -1 +1 @@
-‚ñà‚ñà‚ñà
+***

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:798�[m: �[91mble/string#create-unicode-progress-bar  0 24 4 unlimited�[m
--- 89989.ret.expect	2022-07-23 11:52:22.000000000 +0000
+++ 89989.ret.result	2022-07-23 11:52:22.000000000 +0000
@@ -1 +1 @@
-‚ñà   
+*   

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:799�[m: �[91mble/string#create-unicode-progress-bar  1 24 4 unlimited�[m
--- 89989.ret.expect	2022-07-23 11:52:22.000000000 +0000
+++ 89989.ret.result	2022-07-23 11:52:22.000000000 +0000
@@ -1 +1 @@
-�[7m‚ñè�[27m‚ñè  
+�[7m1�[27m1  

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:800�[m: �[91mble/string#create-unicode-progress-bar  2 24 4 unlimited�[m
--- 89989.ret.expect	2022-07-23 11:52:22.000000000 +0000
+++ 89989.ret.result	2022-07-23 11:52:22.000000000 +0000
@@ -1 +1 @@
-�[7m‚ñé�[27m‚ñé  
+�[7m2�[27m2  

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:801�[m: �[91mble/string#create-unicode-progress-bar  3 24 4 unlimited�[m
--- 89989.ret.expect	2022-07-23 11:52:22.000000000 +0000
+++ 89989.ret.result	2022-07-23 11:52:22.000000000 +0000
@@ -1 +1 @@
-�[7m‚ñç�[27m‚ñç  
+�[7m3�[27m3  

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:802�[m: �[91mble/string#create-unicode-progress-bar  4 24 4 unlimited�[m
--- 89989.ret.expect	2022-07-23 11:52:22.000000000 +0000
+++ 89989.ret.result	2022-07-23 11:52:22.000000000 +0000
@@ -1 +1 @@
-�[7m‚ñå�[27m‚ñå  
+�[7m4�[27m4  

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:803�[m: �[91mble/string#create-unicode-progress-bar  5 24 4 unlimited�[m
--- 89989.ret.expect	2022-07-23 11:52:22.000000000 +0000
+++ 89989.ret.result	2022-07-23 11:52:22.000000000 +0000
@@ -1 +1 @@
-�[7m‚ñã�[27m‚ñã  
+�[7m5�[27m5  

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:804�[m: �[91mble/string#create-unicode-progress-bar  6 24 4 unlimited�[m
--- 89989.ret.expect	2022-07-23 11:52:22.000000000 +0000
+++ 89989.ret.result	2022-07-23 11:52:22.000000000 +0000
@@ -1 +1 @@
-�[7m‚ñä�[27m‚ñä  
+�[7m6�[27m6  

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:805�[m: �[91mble/string#create-unicode-progress-bar  7 24 4 unlimited�[m
--- 89989.ret.expect	2022-07-23 11:52:22.000000000 +0000
+++ 89989.ret.result	2022-07-23 11:52:22.000000000 +0000
@@ -1 +1 @@
-�[7m‚ñâ�[27m‚ñâ  
+�[7m7�[27m7  

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:806�[m: �[91mble/string#create-unicode-progress-bar  8 24 4 unlimited�[m
--- 89989.ret.expect	2022-07-23 11:52:22.000000000 +0000
+++ 89989.ret.result	2022-07-23 11:52:22.000000000 +0000
@@ -1 +1 @@
- ‚ñà  
+ *  

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:807�[m: �[91mble/string#create-unicode-progress-bar  9 24 4 unlimited�[m
--- 89989.ret.expect	2022-07-23 11:52:22.000000000 +0000
+++ 89989.ret.result	2022-07-23 11:52:22.000000000 +0000
@@ -1 +1 @@
- �[7m‚ñè�[27m‚ñè 
+ �[7m1�[27m1 

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:808�[m: �[91mble/string#create-unicode-progress-bar 15 24 4 unlimited�[m
--- 89989.ret.expect	2022-07-23 11:52:22.000000000 +0000
+++ 89989.ret.result	2022-07-23 11:52:22.000000000 +0000
@@ -1 +1 @@
- �[7m‚ñâ�[27m‚ñâ 
+ �[7m7�[27m7 

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:809�[m: �[91mble/string#create-unicode-progress-bar 16 24 4 unlimited�[m
--- 89989.ret.expect	2022-07-23 11:52:22.000000000 +0000
+++ 89989.ret.result	2022-07-23 11:52:22.000000000 +0000
@@ -1 +1 @@
-  ‚ñà 
+  * 

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:810�[m: �[91mble/string#create-unicode-progress-bar 17 24 4 unlimited�[m
--- 89989.ret.expect	2022-07-23 11:52:22.000000000 +0000
+++ 89989.ret.result	2022-07-23 11:52:22.000000000 +0000
@@ -1 +1 @@
-  �[7m‚ñè�[27m‚ñè
+  �[7m1�[27m1

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:811�[m: �[91mble/string#create-unicode-progress-bar 24 24 4 unlimited�[m
--- 89989.ret.expect	2022-07-23 11:52:22.000000000 +0000
+++ 89989.ret.result	2022-07-23 11:52:22.000000000 +0000
@@ -1 +1 @@
-‚ñà   
+*   

/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh: line 827: warning: setlocale: LC_ALL: cannot change locale (en_US.utf8): No such file or directory
�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:1445�[m: �[91mret=$BASHPID�[m
--- 90130.ret.expect	2022-07-23 11:52:24.000000000 +0000
+++ 90130.ret.result	2022-07-23 11:52:24.000000000 +0000
@@ -1,2 +1 @@
--n 90130
-
+90130

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:1452�[m: �[91m[[ $BASHPID == $ppid ]]�[m
--- 90135.exit.expect	2022-07-23 11:52:24.000000000 +0000
+++ 90135.exit.result	2022-07-23 11:52:24.000000000 +0000
@@ -1 +1 @@
-0
+1

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:1811�[m: �[91mble/util/s2c Œº�[m
--- 90241.ret.expect	2022-07-23 11:52:26.000000000 +0000
+++ 90241.ret.result	2022-07-23 11:52:26.000000000 +0000
@@ -1 +1 @@
-956
+206

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:1812�[m: �[91mble/util/c2s 956�[m
--- 90241.ret.expect	2022-07-23 11:52:26.000000000 +0000
+++ 90241.ret.result	2022-07-23 11:52:26.000000000 +0000
@@ -1 +1 @@
-μ
+\u03BC

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:1813�[m: �[91mble/util/s2c „ÅÇ�[m
--- 90241.ret.expect	2022-07-23 11:52:26.000000000 +0000
+++ 90241.ret.result	2022-07-23 11:52:26.000000000 +0000
@@ -1 +1 @@
-12354
+227

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:1814�[m: �[91mble/util/c2s 12354�[m
--- 90241.ret.expect	2022-07-23 11:52:26.000000000 +0000
+++ 90241.ret.result	2022-07-23 11:52:26.000000000 +0000
@@ -1 +1 @@
-„ÅÇ
+\u3042

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:1818�[m: �[91mble/util/s2c ŒºŒΩ�[m
--- 90241.ret.expect	2022-07-23 11:52:26.000000000 +0000
+++ 90241.ret.result	2022-07-23 11:52:26.000000000 +0000
@@ -1 +1 @@
-956
+206

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:1819�[m: �[91mble/util/s2c „ÅÇ„ÅÑ„ÅÜ�[m
--- 90241.ret.expect	2022-07-23 11:52:26.000000000 +0000
+++ 90241.ret.result	2022-07-23 11:52:26.000000000 +0000
@@ -1 +1 @@
-12354
+227

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:1823�[m: �[91mble/util/c2s.cached 956�[m
--- 90241.ret.expect	2022-07-23 11:52:26.000000000 +0000
+++ 90241.ret.result	2022-07-23 11:52:26.000000000 +0000
@@ -1 +1 @@
-μ
+\u03BC

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:1824�[m: �[91mble/util/c2s.cached 12354�[m
--- 90241.ret.expect	2022-07-23 11:52:26.000000000 +0000
+++ 90241.ret.result	2022-07-23 11:52:26.000000000 +0000
@@ -1 +1 @@
-„ÅÇ
+\u3042

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:1851�[m: �[91mble/util/s2chars „ÅÇ„ÅÑ„ÅÜ; ret="${ret[*]}"�[m
--- 90261.ret.expect	2022-07-23 11:52:26.000000000 +0000
+++ 90261.ret.result	2022-07-23 11:52:26.000000000 +0000
@@ -1 +1 @@
-12354 12356 12358
+227 129 130 227 129 132 227 129 134

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:1852�[m: �[91mble/util/chars2s 12354 12356 12358�[m
--- 90261.ret.expect	2022-07-23 11:52:26.000000000 +0000
+++ 90261.ret.result	2022-07-23 11:52:26.000000000 +0000
@@ -1 +1 @@
-„ÅÇ„ÅÑ„ÅÜ
+\u3042\u3044\u3046

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:1857�[m: �[91mble/util/s2chars Œº; ret="${ret[*]}"�[m
--- 90261.ret.expect	2022-07-23 11:52:26.000000000 +0000
+++ 90261.ret.result	2022-07-23 11:52:26.000000000 +0000
@@ -1 +1 @@
-956
+206 188

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:1858�[m: �[91mble/util/s2chars „ÅÇ; ret="${ret[*]}"�[m
--- 90261.ret.expect	2022-07-23 11:52:26.000000000 +0000
+++ 90261.ret.result	2022-07-23 11:52:26.000000000 +0000
@@ -1 +1 @@
-12354
+227 129 130

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:1862�[m: �[91mble/util/chars2s 956�[m
--- 90261.ret.expect	2022-07-23 11:52:26.000000000 +0000
+++ 90261.ret.result	2022-07-23 11:52:26.000000000 +0000
@@ -1 +1 @@
-μ
+\u03BC

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:1863�[m: �[91mble/util/chars2s 12354�[m
--- 90261.ret.expect	2022-07-23 11:52:26.000000000 +0000
+++ 90261.ret.result	2022-07-23 11:52:26.000000000 +0000
@@ -1 +1 @@
-„ÅÇ
+\u3042

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:1870�[m: �[91mble/util/c2keyseq 956�[m
--- 90275.ret.expect	2022-07-23 11:52:26.000000000 +0000
+++ 90275.ret.result	2022-07-23 11:52:26.000000000 +0000
@@ -1 +1 @@
-μ
+\u03BC

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:1871�[m: �[91mble/util/chars2keyseq 956�[m
--- 90275.ret.expect	2022-07-23 11:52:26.000000000 +0000
+++ 90275.ret.result	2022-07-23 11:52:26.000000000 +0000
@@ -1 +1 @@
-μ
+\u03BC

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:1872�[m: �[91mble/util/keyseq2chars 'Œº'; ret="${ret[*]}"�[m
--- 90275.ret.expect	2022-07-23 11:52:26.000000000 +0000
+++ 90275.ret.result	2022-07-23 11:52:26.000000000 +0000
@@ -1 +1 @@
-956
+206 188

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:1873�[m: �[91mble/util/chars2keyseq 98 956 99�[m
--- 90275.ret.expect	2022-07-23 11:52:26.000000000 +0000
+++ 90275.ret.result	2022-07-23 11:52:26.000000000 +0000
@@ -1 +1 @@
-bμc
+b\u03BCc

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:1874�[m: �[91mble/util/keyseq2chars 'bŒºc'; ret="${ret[*]}"�[m
--- 90275.ret.expect	2022-07-23 11:52:26.000000000 +0000
+++ 90275.ret.result	2022-07-23 11:52:26.000000000 +0000
@@ -1 +1 @@
-98 956 99
+98 206 188 99

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:1870�[m: �[91mble/util/c2keyseq 12354�[m
--- 90275.ret.expect	2022-07-23 11:52:26.000000000 +0000
+++ 90275.ret.result	2022-07-23 11:52:26.000000000 +0000
@@ -1 +1 @@
-„ÅÇ
+\u3042

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:1871�[m: �[91mble/util/chars2keyseq 12354�[m
--- 90275.ret.expect	2022-07-23 11:52:26.000000000 +0000
+++ 90275.ret.result	2022-07-23 11:52:26.000000000 +0000
@@ -1 +1 @@
-„ÅÇ
+\u3042

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:1872�[m: �[91mble/util/keyseq2chars '„ÅÇ'; ret="${ret[*]}"�[m
--- 90275.ret.expect	2022-07-23 11:52:26.000000000 +0000
+++ 90275.ret.result	2022-07-23 11:52:26.000000000 +0000
@@ -1 +1 @@
-12354
+227 129 130

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:1873�[m: �[91mble/util/chars2keyseq 98 12354 99�[m
--- 90275.ret.expect	2022-07-23 11:52:26.000000000 +0000
+++ 90275.ret.result	2022-07-23 11:52:26.000000000 +0000
@@ -1 +1 @@
-b„ÅÇc
+b\u3042c

�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh:1874�[m: �[91mble/util/keyseq2chars 'b„ÅÇc'; ret="${ret[*]}"�[m
--- 90275.ret.expect	2022-07-23 11:52:26.000000000 +0000
+++ 90275.ret.result	2022-07-23 11:52:26.000000000 +0000
@@ -1 +1 @@
-98 12354 99
+98 227 129 130 99

�[31m 95.6%�[m [section] ble/util: �[31m1161/1214�[m (53 fail, 0 crash, 12 skip)
�[32m100.0%�[m [section] ble/canvas/trace (relative:confine:measure-bbox): �[32m5/5�[m (0 fail, 0 crash, 12 skip)
�[32m100.0%�[m [section] ble/canvas/trace (cfuncs): �[32m17/17�[m (0 fail, 0 crash, 1 skip)
�[32m100.0%�[m [section] ble/canvas/trace (justify): �[32m2/2�[m (0 fail, 0 crash, 22 skip)
�[1m/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-canvas.sh:303�[m: �[91mble/canvas/trace-text "„Åì„Çå„ÅØÊó•Êú¨Ë™û„ÅÆÊñáÁ´†";ret="$x,$y,$ret"�[m
--- 90309.ret.expect	2022-07-23 11:52:27.000000000 +0000
+++ 90309.ret.result	2022-07-23 11:52:27.000000000 +0000
@@ -1,2 +1,3 @@
-2,2,„Åì„Çå„ÅØ
-日本語の文章
+10,2,„�[7mM-^A�(B�[m
+�[7mM-^S�(B�[m„�[7mM-^B�(B�[m
+�[7mM-^L�(B�[m„�[7mM-^A�(B�[mØ

... (omitted because it is too long)

�[31m 76.3%�[m [section] ble/unicode/GraphemeCluster/c2break (GraphemeBreakTest.txt): �[31m2481/3251�[m (770 fail, 0 crash, 0 skip)
�[32m100.0%�[m [section] ble/decode: �[32m33/33�[m (0 fail, 0 crash, 0 skip)
�[32m100.0%�[m [section] ble/edit: �[32m2/2�[m (0 fail, 0 crash, 0 skip)
�[32m100.0%�[m [section] ble/syntax: �[32m22/22�[m (0 fail, 0 crash, 0 skip)
�[32m100.0%�[m [section] ble/complete: �[32m7/7�[m (0 fail, 0 crash, 0 skip)
ble: The test log was saved to '�[34m/private/tmp/nix-build-ble.sh.drv-0/source/out/cache.d/301/test.20220723.115221.log�(B�[m'.
make: *** [GNUmakefile:206: check] Error 1

Executed bash --version on both environments:

# Local environment which run `make check`. I just noticed that it is too old.
$ bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin21)
Copyright (C) 2007 Free Software Foundation, Inc.

# Getting into nix environment
$ nix develop local#blesh
$ runHook preCheck
$ bash --version
GNU bash, version 5.1.16(1)-release (x86_64-apple-darwin17.7.0)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

EDIT: Sorry, I remembered that I'm using a bash which is outside of PATH as a login shell.
echo $BASH_VERSION printed 5.1.16(1)-release, so the bash version is the same on both environments.

Oh I just noticed that the bash version is already printed in log😆

@aiotter aiotter changed the title ble.sh: init at 0.3.3 ble.sh: init at 2022-07-21 Jul 24, 2022
@akinomyoga
Copy link

@aiotter Thanks for the log of make check! I have fixed some of the problems found in the log (akinomyoga/ble.sh@fa955c1).

But some of the problems found in building the derivation is not yet solved. They seem to be related to the available locales in the building environment of nix. In particular, A UTF-8 locale needs to be set for make check, but even en_US.utf8 doesn't seem to be available in the building environment as far as I see the log. Could you tell which locales are available in the building environment of nix, or can you add UTF-8 locales as build-time dependencies?

@aiotter
Copy link
Member Author

aiotter commented Jul 24, 2022

It's weird that the shell invoked by nix develop has en_US.utf8 whereas it's absent while building derivation. I guess it is related to the isolated environment while building. I'll share it if I find out something related.

@SuperSandro2000
Copy link
Member

ble.sh is a frequently updated project.

Not that frequently to be honest. Sometimes it does not receive a commit for 3 weeks which is totally fine.

I don't think it's a good idea that I keep deciding which commit is valuable enough to update the nix package as a package maintainer.

We don't need to decide that. Whenever something more than a documentation change happens we just update it or when we feel like it. Packaging a two year old version and then requiring everyone to maintain their own overlay is just much more work for everyone.

It's weird that the shell invoked by nix develop has en_US.utf8

Not really. nix develop build on top of your current shell which of course has a locales available. If you want to use them in the checkphase add glibcLocales to checkInputs and then add export LC_ALL=en_US.UTF-8 to preCheck.

Comment on lines 24 to 31
mkdir -p "$out/bin"
cat <<SCRIPT >"$out/bin/blesh-share"
#!${runtimeShell}
# Run this script to find the ble.sh shared folder
# where all the shell scripts are living.
echo "$out/share/ble.sh"
SCRIPT
chmod +x "$out/bin/blesh-share"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be easily replaced with source ~/.nix-profile/share/ble.sh.

Copy link
Member Author

@aiotter aiotter Jul 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it guaranteed to be there even when it is installed by configure.nix?
Then it's okay to remove this part and we can update the docs. Docs say that there is no way to decide the path of share directory and describes a solution of PACKAGE-share.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing that section for the first time. Maybe we can do this but I wouldn't have done it.

@aiotter
Copy link
Member Author

aiotter commented Jul 24, 2022

@akinomyoga Thanks for your fix! I have updated the locale to en_US.UTF-8 (thanks to @SuperSandro2000), almost all the errors have gone while building the derivation, but there still remains one regarding to readlink.

running tests
check flags: SHELL=/nix/store/8269022kjb67pdc375mjcmnx0a5xhz3r-bash-5.1-p16/bin/bash VERBOSE=y check
bash make_command.sh check
ble.sh: insane environment: The command(s), `ps', not found. Check your environment variable PATH.
ble.sh: modified PATH=/usr/bin:/bin:/usr/sbin:/sbin:$PATH
ble.sh: insane environment: $USER is empty.
ble.sh: modified USER=_nixbld1
ble/term.sh: updating tput cache for TERM=xterm-256color... done
MACHTYPE: x86_64-apple-darwin17.7.0
BLE_VERSION: 0.4.0-devel3+0b95d5d
BASH_VERSION: 5.1.16(1)-release
locale: LANG=en_US.UTF-8 LC_ALL= LC_COLLATE=C
/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-main.sh:54:
    ble/util/readlink f.txt
    [[ $ret != /* ]] && ret=${PWD%/}/$ret
--- 39858.ret.expect    2022-07-24 15:32:44.000000000 +0000
+++ 39858.ret.result    2022-07-24 15:32:44.000000000 +0000
@@ -1 +1 @@
-/tmp/blesh/301/39761.test/39858.d/ab/cd/ef/file.txt
+/private/tmp/blesh/301/39761.test/39858.d/ab/cd/ef/file.txt

 94.7% [section] ble/main: 18/19 (1 fail, 0 crash, 0 skip)
/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh: line 685: warning: setlocale: LC_ALL: cannot change locale (en_US.utf8): No such file or directory
/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-util.sh: line 827: warning: setlocale: LC_ALL: cannot change locale (en_US.utf8): No such file or directory
100.0% [section] ble/util: 1214/1214 (0 fail, 0 crash, 12 skip)
100.0% [section] ble/canvas/trace (relative:confine:measure-bbox): 5/5 (0 fail, 0 crash, 12 skip)
100.0% [section] ble/canvas/trace (cfuncs): 17/17 (0 fail, 0 crash, 1 skip)
100.0% [section] ble/canvas/trace (justify): 2/2 (0 fail, 0 crash, 22 skip)
100.0% [section] ble/canvas/trace-text: 11/11 (0 fail, 0 crash, 0 skip)
100.0% [section] ble/textmap#update: 5/5 (0 fail, 0 crash, 0 skip)
100.0% [section] ble/unicode/GraphemeCluster/c2break: 72/72 (0 fail, 0 crash, 0 skip)
100.0% [section] ble/unicode/GraphemeCluster/c2break (GraphemeBreakTest.txt): 3251/3251 (0 fail, 0 crash, 0 skip)
100.0% [section] ble/decode: 33/33 (0 fail, 0 crash, 0 skip)
100.0% [section] ble/edit: 2/2 (0 fail, 0 crash, 0 skip)
100.0% [section] ble/syntax: 22/22 (0 fail, 0 crash, 0 skip)
100.0% [section] ble/complete: 7/7 (0 fail, 0 crash, 0 skip)
ble: The test log was saved to '/private/tmp/nix-build-ble.sh.drv-0/source/out/cache.d/301/test.20220724.153244.log(B'.
make: *** [GNUmakefile:206: check] Error 1

The same check is errored out both on usual environment of macOS and while building nix derivation.

This build is on akinomyoga/ble.sh@0b95d5d, and I made it sure that the change introduced akinomyoga/ble.sh@fa955c1 is actually in ble.pp.

@SuperSandro2000 SuperSandro2000 changed the title ble.sh: init at 2022-07-21 blesh: init at 2022-07-21 Jul 24, 2022
Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last change from me for now.

A failing test should cause an exit status other than 0 and abort the build.

pkgs/shells/bash/blesh/default.nix Outdated Show resolved Hide resolved
@SuperSandro2000
Copy link
Member

@ofborg build blesh

@aiotter
Copy link
Member Author

aiotter commented Jul 25, 2022

@SuperSandro2000 Can I ask one thing about commit message? You renamed this PR from ble.sh to blesh. The name of the derivation is still ble.sh, but the attribute name is now changed from nixpkgs.ble-sh from nixpkgs.blesh. Should I reword all the prefixes of commit messages from ble.sh: to blesh: as well as that of this PR?

@SuperSandro2000 SuperSandro2000 changed the title blesh: init at 2022-07-21 blesh: init at 2022-07-24 Jul 25, 2022
@SuperSandro2000
Copy link
Member

I would have squash merged everything anyway.

@SuperSandro2000
Copy link
Member

@ofborg build blesh

@SuperSandro2000 SuperSandro2000 merged commit d5086eb into NixOS:master Jul 25, 2022
Copy link

@akinomyoga akinomyoga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/private/tmp/nix-build-ble.sh.drv-0/source/out/lib/test-main.sh:54:
    ble/util/readlink f.txt
    [[ $ret != /* ]] && ret=${PWD%/}/$ret
--- 39858.ret.expect    2022-07-24 15:32:44.000000000 +0000
+++ 39858.ret.result    2022-07-24 15:32:44.000000000 +0000
@@ -1 +1 @@
-/tmp/blesh/301/39761.test/39858.d/ab/cd/ef/file.txt
+/private/tmp/blesh/301/39761.test/39858.d/ab/cd/ef/file.txt

 94.7% [section] ble/main: 18/19 (1 fail, 0 crash, 0 skip)

@aiotter I have added a fix for the remaining test failure (#181963 (comment)) in ble.sh commit a22e145 @ akinomyoga/ble.sh. Could you check if the make check problem is finally solved in macOS?

I have also tested the blesh package in nixpkgs, but I have noticed a few points. I have added comments in the code in this PR (although you might want to open a new PR). Could you also take a look at them?

As discussed in #181963 (comment), I have added a stub on the installation instruction in ble.sh Wiki. Could you edit the page?


Another naive question is where the users are supposed to report an issue of a specific package in nixpkgs. Is there a standard place to report them? Or do we need to contact the package maintainer by directly sending emails or by means that each maintainer specifies? Or can we just open an issue in the upstream nixpkgs (this repository)?

checkInputs = [ bashInteractive glibcLocales ];
preCheck = "export LC_ALL=en_US.UTF-8";

installFlags = [ "INSDIR=$(out)/share" ];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
installFlags = [ "INSDIR=$(out)/share" ];
installFlags = [ "PREFIX=$(out)" ];

_ble_base_package_type=nix

function ble/base/package:nix/update {
echo "Ble.sh is installed by Nix. You can update it there." >/dev/stderr

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to use &2 over /dev/stderr. /dev/stderr is not POSIX.

Suggested change
echo "Ble.sh is installed by Nix. You can update it there." >/dev/stderr
echo "Ble.sh is installed by Nix. You can update it there." >&2

#!${runtimeShell}
# Run this script to find the ble.sh shared folder
# where all the shell scripts are living.
echo "$out/share/ble.sh"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blesh-share should return the data directory name but not the script file. Also, the install target is strange. Currently, the related script files are somehow installed in $(out)/share, but they should be installed in $(out)/share/blesh.

Suggested change
echo "$out/share/ble.sh"
echo "$out/share/blesh"

@SuperSandro2000
Copy link
Member

can we just open an issue in the upstream nixpkgs (this repository)?

Yes or write on matrix or if you have a fix just open a PR.

@aiotter
Copy link
Member Author

aiotter commented Jul 30, 2022

@akinomyoga Thank you for your patch and review. I have confirmed that make check exits with no errors🎉
I'll check your review and open another PR to fix what you pointed out. See you soon!

p.s. I'll fix the wiki after fixing blesh-share👍

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/nix-print-dev-env-command-shows-some-assinments-to-readonly-variables/20916/7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants