| 28 Jan 2025 |
| @vsiles:matrix.org joined the room. | 12:22:17 |
@vsiles:matrix.org | Hi ! We have developed a CLI in Python that we expose using poetry2nix successfully, using poetry2nix.mkPoetryApplication. Now I'd like to call an external package (e.g. I want to execute curl in our CLI). Is there a way so that getting our mkPoetryApplication will also get curl ? Someone suggested we substituteInPlace all the occurrences with ${curl}/bin/curl but that sounds very risky ^^ | 12:25:00 |
elikoga | You could wrap your binary with a wrapper that sets PATH (in postinstall probably?) | 12:26:42 |
@vsiles:matrix.org | oh, clever. Let me try that | 12:27:44 |
| 29 Jan 2025 |
@perchun:matrix.org | (it is not entirely clear but by wrapper they mean https://nixos.org/manual/nixpkgs/stable/#fun-wrapProgram) | 09:04:47 |
@vsiles:matrix.org | Yep, I found that. iiuc it only works for executables, not scripts, so I just used a writeShellApplication to wrap it, with runtime inputs. But that's very good to know ! Thanks you | 09:17:15 |
| matthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192) changed their display name from matthewcroughan to matthewcroughan (already in Brussels). | 15:43:37 |
| Seme joined the room. | 20:52:13 |
| 1 Feb 2025 |
| matthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192) changed their display name from matthewcroughan (already in Brussels) to matthewcroughan (FOSDEM). | 09:30:34 |
| 2 Feb 2025 |
| @tanvir:tchncs.de removed their profile picture. | 15:24:47 |
| @tanvir:tchncs.de removed their display name 𝒕𝒂𝒏𝒗𝒊𝒓. | 15:24:59 |
| @tanvir:tchncs.de left the room. | 15:25:15 |
l0b0 | Thank you for all the help! | 15:36:43 |
| l0b0 left the room. | 15:36:49 |
| pbsds changed their display name from pbsds to pbsds (FOSDEM). | 16:04:07 |
| @tanvir:mozilla.org removed their profile picture. | 16:04:33 |
| @tanvir:mozilla.org removed their display name 𝒕𝒂𝒏𝒗𝒊𝒓. | 16:04:44 |
| @tanvir:mozilla.org left the room. | 16:04:51 |
| 3 Feb 2025 |
| matthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192) changed their display name from matthewcroughan (FOSDEM) to matthewcroughan. | 09:04:22 |
| pbsds changed their display name from pbsds (FOSDEM) to pbsds. | 16:25:28 |
| 5 Feb 2025 |
| @13k:matrix.org left the room. | 07:34:43 |
| 6 Feb 2025 |
| Jeff changed their profile picture. | 06:08:17 |
| 7 Feb 2025 |
@nebucatnetzer13:matrix.org | I have a strange thing happening in one of your projects, maybe someone of you has an idea what is happening. We basically have the following configuration. It is a project where we use Ansible and Ansible Molecule for testing. In the dev shell everythin feels normal. When we have a look at ansible-playbook it seems to be a binary.
Recently we created a custom Ansible module with additional dependencies. They work fine wenn we run it directly from the within the dev shell.
But when run Molecule tests (a container based test framework) the path to ansible-playbook in the store is different and it is now a bash script. Inside which it points to a different Python version which then doesn't have our required dependencies.
Everything gets installed through poetry2nix so I'm a bit lost why it should be different between the dev shell and molecule.
system = "x86_64-linux";
pkgs = inputs.nixpkgs.legacyPackages.${system};
poetry2nix = inputs.poetry2nix.lib.mkPoetry2Nix { inherit pkgs; };
python = pkgs.python310;
root = ./.;
pythonDevEnvironment = poetry2nix.mkPoetryEnv {
groups = [
"main"
"dev"
];
projectDir = root;
inherit python;
};
| 07:04:14 |
| @perchun:matrix.org left the room. | 07:32:28 |
| chess7th joined the room. | 14:56:08 |
@nebucatnetzer13:matrix.org | Upon further investigation it's actually not the binaries but the path to ansible python module location. Output of ansible-playbook --version:
Output inside molecule:
ansible-playbook [core 2.17.8]
config file = /home/andreas/git_repos/work/contria_ansible/.devenv/state/molecule/ansible.cfg
configured module search path = ['/home/andreas/git_repos/work/contria_ansible/library']
ansible python module location = /nix/store/vmjwcq9kq819haqs7r6xrxp75sbai916-python3.10-ansible-core-2.17.8/lib/python3.10/site-packages/ansible
ansible collection location = /nix/store/fpm91wbb3hzm70xdhcf74ik1f04qkxny-galaxy-requirements:/home/andreas/git_repos/work/contria_ansible/collections/ansible_collections
executable location = /nix/store/vmjwcq9kq819haqs7r6xrxp75sbai916-python3.10-ansible-core-2.17.8/bin/ansible-playbook
python version = 3.10.16 (main, Dec 3 2024, 17:27:57) [GCC 13.3.0] (/nix/store/v5x90j46fchzh3b891hcc1h3pajbcsc7-python3-3.10.16/bin/python3.10)
jinja version = 3.1.5
libyaml = True
| 22:43:56 |
@nebucatnetzer13:matrix.org | * Upon further investigation it's actually not the binaries but the path to ansible python module location. Output of ansible-playbook --version:
Expected:
ansible-playbook [core 2.17.8]
config file = None
configured module search path = ['/home/andreas/git_repos/work/contria_ansible/library']
ansible python module location = /nix/store/kz7p8bg8jk3ypa3h6pxlifcsy9q4b5z2-python3-3.10.16-env/lib/python3.10/site-packages/ansible
ansible collection location = /nix/store/fpm91wbb3hzm70xdhcf74ik1f04qkxny-galaxy-requirements:/home/andreas/git_repos/work/contria_ansible/collections/ansible_collections
executable location = /nix/store/vmjwcq9kq819haqs7r6xrxp75sbai916-python3.10-ansible-core-2.17.8/bin/ansible-playbook
python version = 3.10.16 (main, Dec 3 2024, 17:27:57) [GCC 13.3.0] (/nix/store/kz7p8bg8jk3ypa3h6pxlifcsy9q4b5z2-python3-3.10.16-env/bin/python3.10)
jinja version = 3.1.5
libyaml = True
Output inside molecule:
ansible-playbook [core 2.17.8]
config file = /home/andreas/git_repos/work/contria_ansible/.devenv/state/molecule/ansible.cfg
configured module search path = ['/home/andreas/git_repos/work/contria_ansible/library']
ansible python module location = /nix/store/vmjwcq9kq819haqs7r6xrxp75sbai916-python3.10-ansible-core-2.17.8/lib/python3.10/site-packages/ansible
ansible collection location = /nix/store/fpm91wbb3hzm70xdhcf74ik1f04qkxny-galaxy-requirements:/home/andreas/git_repos/work/contria_ansible/collections/ansible_collections
executable location = /nix/store/vmjwcq9kq819haqs7r6xrxp75sbai916-python3.10-ansible-core-2.17.8/bin/ansible-playbook
python version = 3.10.16 (main, Dec 3 2024, 17:27:57) [GCC 13.3.0] (/nix/store/v5x90j46fchzh3b891hcc1h3pajbcsc7-python3-3.10.16/bin/python3.10)
jinja version = 3.1.5
libyaml = True
| 22:44:43 |
@nebucatnetzer13:matrix.org | * Upon further investigation it's actually not the binaries but the path to ansible python module location. Output of ansible-playbook --version:
Expected:
ansible-playbook [core 2.17.8]
config file = /home/andreas/git_repos/work/contria_ansible/ansible.cfg
configured module search path = ['/home/andreas/git_repos/work/contria_ansible/library']
ansible python module location = /nix/store/kz7p8bg8jk3ypa3h6pxlifcsy9q4b5z2-python3-3.10.16-env/lib/python3.10/site-packages/ansible
ansible collection location = /nix/store/fpm91wbb3hzm70xdhcf74ik1f04qkxny-galaxy-requirements:/home/andreas/git_repos/work/contria_ansible/collections/ansible_collections
executable location = /nix/store/vmjwcq9kq819haqs7r6xrxp75sbai916-python3.10-ansible-core-2.17.8/bin/ansible-playbook
python version = 3.10.16 (main, Dec 3 2024, 17:27:57) [GCC 13.3.0] (/nix/store/kz7p8bg8jk3ypa3h6pxlifcsy9q4b5z2-python3-3.10.16-env/bin/python3.10)
jinja version = 3.1.5
libyaml = True
Output inside molecule:
ansible-playbook [core 2.17.8]
config file = /home/andreas/git_repos/work/contria_ansible/.devenv/state/molecule/ansible.cfg
configured module search path = ['/home/andreas/git_repos/work/contria_ansible/library']
ansible python module location = /nix/store/vmjwcq9kq819haqs7r6xrxp75sbai916-python3.10-ansible-core-2.17.8/lib/python3.10/site-packages/ansible
ansible collection location = /nix/store/fpm91wbb3hzm70xdhcf74ik1f04qkxny-galaxy-requirements:/home/andreas/git_repos/work/contria_ansible/collections/ansible_collections
executable location = /nix/store/vmjwcq9kq819haqs7r6xrxp75sbai916-python3.10-ansible-core-2.17.8/bin/ansible-playbook
python version = 3.10.16 (main, Dec 3 2024, 17:27:57) [GCC 13.3.0] (/nix/store/v5x90j46fchzh3b891hcc1h3pajbcsc7-python3-3.10.16/bin/python3.10)
jinja version = 3.1.5
libyaml = True
| 22:45:35 |
| 18 Feb 2025 |
truh | why do you expect to have two different ansible-core store paths for executable and module? Having a single ansible-core store path seems more sensible. | 09:21:50 |
truh | * why do you expect to have two different ansible-core store paths for executable and module? Having a single ansible-core store path seems more sensible.
edit: Ah sorry, didn't see that the message was this old. | 09:22:15 |