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

mastodon-bot: init at 2020-03-22 #84906

Closed
wants to merge 2 commits into from

Conversation

raboof
Copy link
Member

@raboof raboof commented Apr 10, 2020

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@progval
Copy link
Member

progval commented Apr 13, 2020

This is probably an arch-specific issue, but it fails to run on my computer (aarch64):

[nix-shell:~/nixpkgs]$ nixpkgs-review pr 84906
$ git -c fetch.prune=false fetch --force https://github.com/NixOS/nixpkgs master:refs/nixpkgs-review/0 pull/84906/head:refs/nixpkgs-review/1
remote: Enumerating objects: 81, done.
remote: Counting objects: 100% (81/81), done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 108 (delta 66), reused 70 (delta 63), pack-reused 27
Receiving objects: 100% (108/108), 164.32 KiB | 1007.00 KiB/s, done.
Resolving deltas: 100% (70/70), completed with 42 local objects.
From https://github.com/NixOS/nixpkgs
   87d598e310c..64e9b709de1  master     -> refs/nixpkgs-review/0
$ git worktree add /home/val/.cache/nixpkgs-review/pr-84906-6/nixpkgs 64e9b709de127bee205acb1903708185f65db6dc
Preparing worktree (detached HEAD 64e9b709de1)
Updating files: 100% (21440/21440), done.
HEAD is now at 64e9b709de1 Merge pull request #84954 from unode/master
$ git merge --no-commit e984c350ebcd2ed174edbe687703661607115c21
Auto-merging pkgs/top-level/all-packages.nix
Automatic merge went well; stopped before committing as requested
$ nix build --no-link --keep-going --option build-use-sandbox relaxed -f /home/val/.cache/nixpkgs-review/pr-84906-6/build.nix
warning: ignoring the user-specified setting 'sandbox', because it is a restricted setting and you are not a trusted user
https://github.com/NixOS/nixpkgs/pull/84906
1 package built:
mastodon-bot

$ nix-shell /home/val/.cache/nixpkgs-review/pr-84906-6/shell.nix

[nix-shell:~/.cache/nixpkgs-review/pr-84906-6]$ mastodon-bot
Could not locate the bindings file. Tried:
 → /nix/store/2j0nxvkcx6fs5dsabfkl19c0ixkf6bss-node_mastodon-bot-2020-03-22/lib/node_modules/mastodon-bot/node_modules/deasync/build/deasync.node
 → /nix/store/2j0nxvkcx6fs5dsabfkl19c0ixkf6bss-node_mastodon-bot-2020-03-22/lib/node_modules/mastodon-bot/node_modules/deasync/build/Debug/deasync.node
 → /nix/store/2j0nxvkcx6fs5dsabfkl19c0ixkf6bss-node_mastodon-bot-2020-03-22/lib/node_modules/mastodon-bot/node_modules/deasync/build/Release/deasync.node
 → /nix/store/2j0nxvkcx6fs5dsabfkl19c0ixkf6bss-node_mastodon-bot-2020-03-22/lib/node_modules/mastodon-bot/node_modules/deasync/out/Debug/deasync.node
 → /nix/store/2j0nxvkcx6fs5dsabfkl19c0ixkf6bss-node_mastodon-bot-2020-03-22/lib/node_modules/mastodon-bot/node_modules/deasync/Debug/deasync.node
 → /nix/store/2j0nxvkcx6fs5dsabfkl19c0ixkf6bss-node_mastodon-bot-2020-03-22/lib/node_modules/mastodon-bot/node_modules/deasync/out/Release/deasync.node
 → /nix/store/2j0nxvkcx6fs5dsabfkl19c0ixkf6bss-node_mastodon-bot-2020-03-22/lib/node_modules/mastodon-bot/node_modules/deasync/Release/deasync.node
 → /nix/store/2j0nxvkcx6fs5dsabfkl19c0ixkf6bss-node_mastodon-bot-2020-03-22/lib/node_modules/mastodon-bot/node_modules/deasync/build/default/deasync.node
 → /nix/store/2j0nxvkcx6fs5dsabfkl19c0ixkf6bss-node_mastodon-bot-2020-03-22/lib/node_modules/mastodon-bot/node_modules/deasync/compiled/11.13.0/linux/arm64/deasync.node
	 bindings (/nix/store/2j0nxvkcx6fs5dsabfkl19c0ixkf6bss-node_mastodon-bot-2020-03-22/lib/node_modules/mastodon-bot/node_modules/bindings/bindings.cljs:88:9)
	 Object.<anonymous> (/nix/store/2j0nxvkcx6fs5dsabfkl19c0ixkf6bss-node_mastodon-bot-2020-03-22/lib/node_modules/mastodon-bot/node_modules/deasync/index.cljs:30:31)
	 Module._compile (internal/modules/cjs/loader.cljs:805:30)
	 Object.Module._extensions..js (internal/modules/cjs/loader.cljs:816:10)
	 Module.load (internal/modules/cjs/loader.cljs:672:32)
	 tryModuleLoad (internal/modules/cjs/loader.cljs:612:12)
	 Function.Module._load (internal/modules/cjs/loader.cljs:604:3)
	 Module.require (internal/modules/cjs/loader.cljs:711:19)
	 require (internal/modules/cjs/helpers.cljs:14:16)
	 Object.<anonymous> (/nix/store/2j0nxvkcx6fs5dsabfkl19c0ixkf6bss-node_mastodon-bot-2020-03-22/lib/node_modules/.bin/mastodon-bot:2:41)

mkdir $out/bin

# link to lumo executable
patchShebangs $out/lib/node_modules/.bin/mastodon-bot
Copy link
Member

Choose a reason for hiding this comment

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

Please move this to pkgs/development/node-packages.
In default-v10.nix you can see how to override packages.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, having a look!

Copy link
Member Author

Choose a reason for hiding this comment

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

First did it manually to test it works - it does!

Converting this PR to a draft until mastodon-bot is published to npmjs.org so we can autogenerate most of the nixpkgs changes (yogthos/mastodon-bot#39).

Thanks for the nudge!

@raboof
Copy link
Member Author

raboof commented Apr 13, 2020

fails to run on my computer (aarch64):

Interesting, indeed it works for me on NixOS - I'll try to reproduce in a VM

Still a manual PoC to see if this works at all.

It works, so now first let's publish mastodon-but to npmjs.org
so we can auto-generate the main stuff
@raboof
Copy link
Member Author

raboof commented Apr 14, 2020

Superseded by #85234

@raboof raboof closed this Apr 14, 2020
@raboof raboof mentioned this pull request Apr 14, 2020
12 tasks
@raboof
Copy link
Member Author

raboof commented Apr 15, 2020

fails to run on my computer (aarch64):

#85234 works for me (in a x86_64 Arch-based docker container)

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.

None yet

3 participants