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

platformio: 3.4.1 -> 3.5.0 #33367

Merged
merged 1 commit into from Jan 6, 2018
Merged

platformio: 3.4.1 -> 3.5.0 #33367

merged 1 commit into from Jan 6, 2018

Conversation

mogorman
Copy link
Contributor

@mogorman mogorman commented Jan 3, 2018

Motivation for this change

i wanted to use an esp32 so i needed to update platformio. it needs a specific version of lru_cache because arrow 0.12.0 needs a specific version it seems. also the wrapper function had to be changed as it was not linking to the lru package correctly.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • [X ] 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"
  • [ X] Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@mogorman mogorman requested a review from FRidh as a code owner January 3, 2018 05:09
@mogorman mogorman changed the title platformio: 3.4.1 -> 3.5.0c platformio: 3.4.1 -> 3.5.0 Jan 3, 2018
@@ -16,7 +16,7 @@ buildPythonPackage rec {
'';

checkInputs = [ nose chai simplejson ];
propagatedBuildInputs = [ dateutil backports_functools_lru_cache ];
propagatedBuildInputs = [ dateutil backports_functools_lru_cache_121 ];
Copy link
Member

Choose a reason for hiding this comment

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

I would rather patch the line install_requires.append('backports.functools_lru_cache==1.2.1') from setup.py to read install_requires.append('backports.functools_lru_cache>=1.2.1').

Copy link
Member

Choose a reason for hiding this comment

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

I've patched the setup.py in 340cadd.

@@ -1007,6 +1007,8 @@ in {

backports_functools_lru_cache = callPackage ../development/python-modules/backports_functools_lru_cache { };

backports_functools_lru_cache_121 = callPackage ../development/python-modules/backports_functools_lru_cache_121 { };
Copy link
Member

Choose a reason for hiding this comment

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

Even if arrow really does require a very specific version of lru_cache this version should not be exposed in python-packages.nix.

Ideally arrow should be patched to not require a very explicit version but if it really does this override should be moved to the arrow directory.

Copy link
Member

Choose a reason for hiding this comment

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

Additional versions of packages are not permitted in python-packages.nix at all as they cause collisions, so also not inside expressions. Applications that are defined outside python-packages.nix can override the package set to insert whatever version they need.

@@ -1007,6 +1007,8 @@ in {

backports_functools_lru_cache = callPackage ../development/python-modules/backports_functools_lru_cache { };

backports_functools_lru_cache_121 = callPackage ../development/python-modules/backports_functools_lru_cache_121 { };
Copy link
Member

Choose a reason for hiding this comment

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

Additional versions of packages are not permitted in python-packages.nix at all as they cause collisions, so also not inside expressions. Applications that are defined outside python-packages.nix can override the package set to insert whatever version they need.

@mogorman
Copy link
Contributor Author

mogorman commented Jan 3, 2018

made changes requested by @FRidh and @adisbladis and verified it still worked on my box. I also added pio alias as it has been bugging me its not there

@@ -30,5 +32,9 @@ buildFHSUserEnv {
platforms = with platforms; linux;
};

extraInstallCommands = ''
ln -s $out/bin/platformio $out/bin/pio
''a
Copy link
Member

Choose a reason for hiding this comment

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

typo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@@ -23,6 +23,13 @@ buildPythonPackage rec {

patches = [ ./fix-searchpath.patch ];

postInstall = ''
Copy link
Member

Choose a reason for hiding this comment

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

Why is this needed? wrapPythonPrograms already sets PATH and injects PYTHONPATH.
Note also that the postFixup (or fixupPhase in general) is preferred for wrappers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you are right its no longer needed with the other fixes in place. earlier i was not seeing the lru getting linked in properly.

@mogorman mogorman force-pushed the platformio-3.5.0 branch 3 times, most recently from f3d2507 to 147abaa Compare January 3, 2018 17:59
@FRidh
Copy link
Member

FRidh commented Jan 3, 2018

What are the packages in the chrootenv for? They all seem to be dependencies of platformio already. Did you get an import error if you did not add say the backports package?

@mogorman
Copy link
Contributor Author

mogorman commented Jan 3, 2018

Earlier i thought I did. I just tested it with them removed and it runs fine as well. I pushed updated code just now @FRidh

@FRidh
Copy link
Member

FRidh commented Jan 3, 2018

I think you may as well write python.withPackages(ps: with ps; [ platformio ]) instead of the current dependencies.

@mogorman
Copy link
Contributor Author

mogorman commented Jan 3, 2018

@FRidh i am happy to make that change but im not sure how. i looked at some of the packages that make use of it but not sure i completely grok whats going on.

@FRidh
Copy link
Member

FRidh commented Jan 4, 2018

@mogorman it creates a tree of symbolic links including the listed packages and Python dependencies.

@mogorman
Copy link
Contributor Author

mogorman commented Jan 4, 2018

right @FRidh , im just not sure how to correctly to use it in the expression and have the resulting fhsuserenv work. i tried saying let pythonUserEnv = python.withPackages(ps: with ps; [ platformio ]) and then including that instead of the python deps and it failed to run

@FRidh
Copy link
Member

FRidh commented Jan 6, 2018

i tried saying let pythonUserEnv = python.withPackages(ps: with ps; [ platformio ]) and then including that instead of the python deps and it failed to run

That's a pity, I thought that could work. How did it fail? With what error?

@FRidh FRidh merged commit b78c42c into NixOS:master Jan 6, 2018
@FRidh
Copy link
Member

FRidh commented Jan 6, 2018

In any case, that's an improvement that can be made separate from this PR.

@mogorman mogorman deleted the platformio-3.5.0 branch January 6, 2018 22:44
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