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

rmapi: init at v0.0.7 #74657

Closed
wants to merge 3 commits into from
Closed

Conversation

Enteee
Copy link
Contributor

@Enteee Enteee commented Nov 29, 2019

Motivation for this change

Add the rMAPI client for the reMarkable cloud.

Related pull request to juruen/rmapi

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 nix-review --run "nix-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.
Notify maintainers

cc @

@Enteee Enteee mentioned this pull request Nov 29, 2019
4 tasks
@Enteee Enteee force-pushed the feature/add-rmapi-derivation branch 2 times, most recently from 67b4837 to e7785e1 Compare November 29, 2019 20:24
@Enteee
Copy link
Contributor Author

Enteee commented Nov 30, 2019

I am struggling to understand / reproduce the CI error.

@Enteee
Copy link
Contributor Author

Enteee commented Dec 3, 2019

with this

outpath.nix

#!/usr/bin/env nix-shell
# When using as a callable script, passing `--argstr path some/path` overrides $PWD.
#!nix-shell -p nix -i "nix-env -qaP --no-name --out-path --arg checkMeta true --argstr path $PWD -f"
{ checkMeta
, path ? ./.
}:
let
  lib = import (path + "/lib");
  hydraJobs = import (path + "/pkgs/top-level/release.nix")
    # Compromise: accuracy vs. resources needed for evaluation.
    {
      supportedSystems = [
        "aarch64-linux"
        "i686-linux"
        "x86_64-linux"
        "x86_64-darwin"
      ];

      nixpkgsArgs = {
        config = {
          allowBroken = true;
          allowUnfree = true;
          allowInsecurePredicate = x: true;
          checkMeta = checkMeta;

          handleEvalIssue = reason: errormsg:
            let
              fatalErrors = [
                "unknown-meta" "broken-outputs"
              ];
            in if builtins.elem reason fatalErrors
              then abort errormsg
              else true;

          inHydra = true;
        };
      };
    };
  recurseIntoAttrs = attrs: attrs // { recurseForDerivations = true; };

  # hydraJobs leaves recurseForDerivations as empty attrmaps;
  # that would break nix-env and we also need to recurse everywhere.
  tweak = lib.mapAttrs
    (name: val:
      if name == "recurseForDerivations" then true
      else if lib.isAttrs val && val.type or null != "derivation"
              then recurseIntoAttrs (tweak val)
      else val
    );

  # Some of these contain explicit references to platform(s) we want to avoid;
  # some even (transitively) depend on ~/.nixpkgs/config.nix (!)
  blacklist = [
    "tarball" "metrics" "manual"
    "darwin-tested" "unstable" "stdenvBootstrapTools"
    "moduleSystem" "lib-tests" # these just confuse the output
  ];

in
  tweak (builtins.removeAttrs hydraJobs blacklist)

and running:

GC_INITIAL_HEAP_SIZE=4g nix-env -f ./outpaths.nix -qaP --no-name --out-path --arg checkMeta true

I can reproduce the error:

error: cannot import '/nix/store/j6xvkiilmdb23hjxgp3j9pri1qz2w9sc-source/derivation.nix', since path '/nix/store/y74warfhqa098y60zv40v312lf9kfnz5-source.drv' is not valid, at /home/user/workspace/nixpkgs/lib/customisation.nix:119:45
(use '--show-trace' to show detailed location information)

But I still don't understand what goes wrong.

@Enteee Enteee force-pushed the feature/add-rmapi-derivation branch from e7785e1 to c840f56 Compare December 4, 2019 11:21
@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/is-importing-ad-erivation-from-another-repository-bad-practice/5016/1

@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/prs-ready-for-review-may-2019/3032/113

pkgs/applications/office/rmapi/default.nix Outdated Show resolved Hide resolved
pkgs/applications/office/rmapi/default.nix Outdated Show resolved Hide resolved
# callPackage "${repo}/derivation.nix" {

callPackage ./derivation.nix {
buildGoModule = super: buildGoModule (super // {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I understand what's "import from derivation", but I think the meaning is that using simply buildGoModule as is doesn't work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No that's not what IFS means. I updated the pull request with a link to the wiki which explains IFS derivations. I am nor 100% sure if I should leave this comment or if I should get rid of it entirely.

Enteee and others added 2 commits March 1, 2020 01:40
Co-Authored-By: Doron Behar <doron.behar@gmail.com>
@Enteee Enteee force-pushed the feature/add-rmapi-derivation branch from 9b8abf5 to 5358f23 Compare March 1, 2020 00:40
@NickHu
Copy link
Contributor

NickHu commented May 24, 2020

Possibly this pull request is superceded by mine: #85898

That'll teach me to make a PR without searching for it first (again)...

@Enteee
Copy link
Contributor Author

Enteee commented May 25, 2020

@NickHu: I have already mentioned this pr on the discourse thread, so I am not quite sure what to do about this so that it can get merged. But I would suggest the following:

  1. I will bump the version of this to match the current rmapi version
  2. then you can possibly close your pr?..
  3. you review this pr and mention it again on the discourse thread

what do you think about this?

@doronbehar doronbehar mentioned this pull request May 25, 2020
10 tasks
@Enteee
Copy link
Contributor Author

Enteee commented May 25, 2020

replaced by: #85898

@Enteee Enteee closed this May 25, 2020
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

4 participants