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

mkspiffs: init at 0.2.3 #46674

Merged
merged 5 commits into from Oct 1, 2018
Merged

mkspiffs: init at 0.2.3 #46674

merged 5 commits into from Oct 1, 2018

Conversation

haslersn
Copy link
Contributor

@haslersn haslersn commented Sep 14, 2018

Motivation for this change

There wasn't a derivation for mkspiffs yet, so I made one.

Supersedes #46623 as it does, besides the generic version, also contain the versions for arduino-esp32, arduino-esp8266 and esp-idf.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-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)
  • Fits CONTRIBUTING.md.

@haslersn haslersn changed the title Mkspiffs 0.2.3 mkspiffs: init at 0.2.3 Sep 14, 2018
@haslersn haslersn force-pushed the mkspiffs-0.2.3 branch 5 times, most recently from d36b4fa to c36363f Compare September 19, 2018 02:07
version = "0.2.3";

src = fetchgit {
url = "https://github.com/igrr/mkspiffs";
Copy link
Member

Choose a reason for hiding this comment

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

Use fetchFromGitHub instead

Copy link
Contributor Author

@haslersn haslersn Sep 20, 2018

Choose a reason for hiding this comment

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

fetchFromGitHub doesn't support deepClone as far as I know.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

However, for fetchFromGitHub there is fetchSubmodules = true; which does what I want.

@@ -0,0 +1,33 @@
{ stdenv, fetchgit, git
, extraBuildFlags ? ""
Copy link
Member

Choose a reason for hiding this comment

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

Don't take this as an argument

let
buildMkspiffs = overrides : import ./default.nix (
{ inherit stdenv fetchgit git; } // overrides
);
Copy link
Member

Choose a reason for hiding this comment

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

I suggest doing this instead along with the above change:

{ lib, mkspiffs }:

lib.mapAttrs (name: { extraBuildFlags }:
  (mkspiffs.override {
    buildConfigName = name;
  }).overrideAttrs (drv: {
    buildFlags = drv.buildFlags ++ extraBuildFlags;
  })
) {
  arduino-esp32 = {
    extraBuildFlags = [ "-DSPIFFS_OBJ_META_LEN=4" ];
  };

  # ...
}

nativeBuildInputs = [ git ];
installPhase = ''
make clean
make dist CPPFLAGS="${extraBuildFlags}" BUILD_CONFIG_NAME="-${buildConfigName}"
Copy link
Member

Choose a reason for hiding this comment

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

Isn't the dist target the build phase? If so, you should use buildFlags = [ "dist" ] instead, along with passing the flags via makeFlags = [ "CPPFLAGS=..." "..." ]; or via buildFlags as well. (buildFlags is applied to only the build phase, while makeFlags to all other make phases as well), while using the install phase for the install only. This should also remove the need to make clean (you probably put it there because the default build phase calls make without any arguments).

* Replaced `fetchgit` by `fetchFromGitHub` with `fetchSubmodules = true;`
* Removed the args extraBuildFlags and buildConfigNames from default.nix.
  They used to set the environment variables CPPFLAGS and BUILD_CONFIG_NAME
  which can be achieved by just overriding the corresponding attributes.
* Adapted presets.nix accordingly based on Infinisil's proposal
@infinisil
Copy link
Member

@GrahamcOfBorg build mkspiffs mkspiffs-presets.arduino-esp8266 mkspiffs-presets.arduino-esp32 mkspiffs-presets.esp-idf

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: mkspiffs, mkspiffs-presets.arduino-esp8266, mkspiffs-presets.arduino-esp32, mkspiffs-presets.esp-idf

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/kvdvw2ky489rjz00ngrzxg0va9kijr5v-mkspiffs-0.2.3
shrinking /nix/store/kvdvw2ky489rjz00ngrzxg0va9kijr5v-mkspiffs-0.2.3/bin/mkspiffs
strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/kvdvw2ky489rjz00ngrzxg0va9kijr5v-mkspiffs-0.2.3/bin
patching script interpreter paths in /nix/store/kvdvw2ky489rjz00ngrzxg0va9kijr5v-mkspiffs-0.2.3
checking for references to /build in /nix/store/kvdvw2ky489rjz00ngrzxg0va9kijr5v-mkspiffs-0.2.3...
/nix/store/jxs1rd5n7g1gha3x8d7sfzj8qpi2ga5b-mkspiffs-0.2.3
/nix/store/kvdvw2ky489rjz00ngrzxg0va9kijr5v-mkspiffs-0.2.3
/nix/store/ngx3n33v4lnd6r22phzfds8cpy5qhf7c-mkspiffs-0.2.3
/nix/store/ji2x8i36ywxyxmqwy8wak5m42fykz2b6-mkspiffs-0.2.3

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Attempted: mkspiffs, mkspiffs-presets.arduino-esp8266, mkspiffs-presets.arduino-esp32, mkspiffs-presets.esp-idf

Partial log (click to expand)

      _spiffs_object_create in spiffs_nucleus.o
      _spiffs_object_update_index_hdr in spiffs_nucleus.o
  "start", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture i386
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:106: mkspiffs] Error 1
builder for '/nix/store/93qih1v1wmkv812zrsfb2yldfk1398f1-mkspiffs-0.2.3.drv' failed with exit code 2
builder for '/nix/store/x8c30s9216yczz90f0jafab0p20j53dj-mkspiffs-0.2.3.drv' failed with exit code 2
error: build of '/nix/store/145akjfyrcd7nbphr8a0vimg44499iz1-mkspiffs-0.2.3.drv', '/nix/store/93qih1v1wmkv812zrsfb2yldfk1398f1-mkspiffs-0.2.3.drv', '/nix/store/qv3k2rbsg737xcgd6pzl3n9v0bwwwfhy-mkspiffs-0.2.3.drv', '/nix/store/x8c30s9216yczz90f0jafab0p20j53dj-mkspiffs-0.2.3.drv' failed

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: mkspiffs, mkspiffs-presets.arduino-esp8266, mkspiffs-presets.arduino-esp32, mkspiffs-presets.esp-idf

Partial log (click to expand)

strip is /nix/store/y4ymnvgxygpq05h03kyzbj572zmh6zla-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/d8rcj9miyf6camdwvx87wn74n5xcdlng-mkspiffs-0.2.3/bin
patching script interpreter paths in /nix/store/d8rcj9miyf6camdwvx87wn74n5xcdlng-mkspiffs-0.2.3
patching script interpreter paths in /nix/store/jlvr0smc2kj4f5m6xkc8h7wg1z3rhhyd-mkspiffs-0.2.3
checking for references to /build in /nix/store/jlvr0smc2kj4f5m6xkc8h7wg1z3rhhyd-mkspiffs-0.2.3...
checking for references to /build in /nix/store/d8rcj9miyf6camdwvx87wn74n5xcdlng-mkspiffs-0.2.3...
/nix/store/cr6n6d8qg0kp3lnbjrcyvl7y9ji77vsd-mkspiffs-0.2.3
/nix/store/92y0llfm9pqcv2rp3binal0jdp92l0lf-mkspiffs-0.2.3
/nix/store/d8rcj9miyf6camdwvx87wn74n5xcdlng-mkspiffs-0.2.3
/nix/store/jlvr0smc2kj4f5m6xkc8h7wg1z3rhhyd-mkspiffs-0.2.3

@infinisil
Copy link
Member

If you happen to know how to fix the darwin failure that would be nice. If not, you should disable darwin (maybe set meta.platforms = platforms.linux)

haslersn added 2 commits September 23, 2018 03:37
Adapted the comments to the previous fixup
Added `platforms = platforms.linux` since it doesn't build on darwin
@haslersn
Copy link
Contributor Author

If you happen to know how to fix the darwin failure that would be nice. If not, you should disable darwin (maybe set meta.platforms = platforms.linux)

I currently don't know how to fix the failure, so I added the suggested code.

@Ekleog
Copy link
Member

Ekleog commented Oct 1, 2018

(triage) The concerns from @infinisil appear to have been taken care of, this looks ready to me. Triggering a build just in case.

@GrahamcOfBorg build mkspiffs mkspiffs-presets.arduino-esp8266 mkspiffs-presets.arduino-esp32 mkspiffs-presets.esp-idf

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: mkspiffs, mkspiffs-presets.arduino-esp8266, mkspiffs-presets.arduino-esp32, mkspiffs-presets.esp-idf

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/g3cbn2bh54xwd06jgl2n0q8a87lsq9nh-mkspiffs-0.2.3
shrinking /nix/store/g3cbn2bh54xwd06jgl2n0q8a87lsq9nh-mkspiffs-0.2.3/bin/mkspiffs
strip is /nix/store/y4ymnvgxygpq05h03kyzbj572zmh6zla-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/g3cbn2bh54xwd06jgl2n0q8a87lsq9nh-mkspiffs-0.2.3/bin
patching script interpreter paths in /nix/store/g3cbn2bh54xwd06jgl2n0q8a87lsq9nh-mkspiffs-0.2.3
checking for references to /build in /nix/store/g3cbn2bh54xwd06jgl2n0q8a87lsq9nh-mkspiffs-0.2.3...
/nix/store/ysp2rshi2qzvhg8kz9ijssh9mi90xsnr-mkspiffs-0.2.3
/nix/store/79z6vn5wk9v1nzrijkin5nqdz8bk13x2-mkspiffs-0.2.3
/nix/store/xiy132mplnjqp3cm4drjlp27zi6wb3iv-mkspiffs-0.2.3
/nix/store/g3cbn2bh54xwd06jgl2n0q8a87lsq9nh-mkspiffs-0.2.3

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: mkspiffs, mkspiffs-presets.arduino-esp8266, mkspiffs-presets.arduino-esp32, mkspiffs-presets.esp-idf

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/qcf1gyingyvfwvw2j80927x1rshfpm5g-mkspiffs-0.2.3
shrinking /nix/store/qcf1gyingyvfwvw2j80927x1rshfpm5g-mkspiffs-0.2.3/bin/mkspiffs
strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/qcf1gyingyvfwvw2j80927x1rshfpm5g-mkspiffs-0.2.3/bin
patching script interpreter paths in /nix/store/qcf1gyingyvfwvw2j80927x1rshfpm5g-mkspiffs-0.2.3
checking for references to /build in /nix/store/qcf1gyingyvfwvw2j80927x1rshfpm5g-mkspiffs-0.2.3...
/nix/store/qcf1gyingyvfwvw2j80927x1rshfpm5g-mkspiffs-0.2.3
/nix/store/f6z5g0lcyrfp6nrn30vf48wxgan4njr3-mkspiffs-0.2.3
/nix/store/qrd0k8zv3bfaap0657rskbzvfy97ghkm-mkspiffs-0.2.3
/nix/store/qhikr38fxc141kyam6z02g3p7s8vwikr-mkspiffs-0.2.3

@fpletz fpletz merged commit 62bf19d into NixOS:master Oct 1, 2018
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

5 participants