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
mkspiffs: init at 0.2.3 #46674
Conversation
d36b4fa
to
c36363f
Compare
c36363f
to
afc683c
Compare
version = "0.2.3"; | ||
|
||
src = fetchgit { | ||
url = "https://github.com/igrr/mkspiffs"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use fetchFromGitHub
instead
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ? "" |
There was a problem hiding this comment.
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 | ||
); |
There was a problem hiding this comment.
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}" |
There was a problem hiding this comment.
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
b2f0c85
to
1f8d105
Compare
@GrahamcOfBorg build mkspiffs mkspiffs-presets.arduino-esp8266 mkspiffs-presets.arduino-esp32 mkspiffs-presets.esp-idf |
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)
|
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)
|
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)
|
If you happen to know how to fix the darwin failure that would be nice. If not, you should disable darwin (maybe set |
Adapted the comments to the previous fixup
Added `platforms = platforms.linux` since it doesn't build on darwin
I currently don't know how to fix the failure, so I added the suggested code. |
(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 |
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)
|
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)
|
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
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)