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
python3Packages.click: fix 'locale' path #41843
Conversation
patches = [ | ||
(substituteAll { | ||
src = ./fix-paths.patch; | ||
locale = "${glibc.bin}/bin/locale"; |
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.
Should be only applied on linux.
btw. @dtzWill how does musl handle locales?
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 think we could probably add this to unix-tools.nix. Right now I don't think Musl comes with a locale implementation but NetBSD has a portable version.
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.
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.
so if you can use "unixtools.locale" here that would be more portable. we will eventually add more implementations - right now it is just the glibc one.
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.
Apparently there's this: https://gitlab.com/rilian-la-te/musl-locales which I've packaged here: https://github.com/dtzWill/nixpkgs/tree/feature/musl-locales
The tool maybe kinda works--IIRC there's some environment variable to set that tells musl where to look? Honestly not sure :).
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.
How about os x in that case? Would the netbsd version work there?
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.
Maybe... i think apple also has its own version
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.
Is this part of darwin.system_cmds
?
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.
so if you can use "unixtools.locale" here that would be more portable. we will eventually add more implementations - right now it is just the glibc one.
@matthewbauer unixtools.locale
doesn't seem to exist currently, or am I'm missing something obvious? ;-)
The tool maybe kinda works--IIRC there's some environment variable to set that tells musl where to look? Honestly not sure :).
@dtzWill looks like that might be MUSL_LOCPATH
for musl-locales
, similar to LOCALE_ARCHIVE
for glibc
. But I'm not sure if it's the same when running applications linked against musl…
@GrahamcOfBorg build python3Packages.click |
Success on aarch64-linux (full log) Attempted: python3Packages.click Partial log (click to expand)
|
No attempt on x86_64-darwin (full log) The following builds were skipped because they don't evaluate on x86_64-darwin: python3Packages.click Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: python3Packages.click Partial log (click to expand)
|
importing click shells out to 'locale', which currently needs to be in PATH. Fix by setting patching locale command at runtime.
2f0c61e
to
c358e1d
Compare
Changed the drv to only patch on linux and if not musl. |
That's okay for now. Eventually we want to provide locale everywhere though. |
@matthewbauer nope, that's an error after having found |
Anyways, thanks for the merge! |
But why doesn't click pick up the settings in the locale binary? |
We now replace the |
It seems that this breaks building for platformio, as it overrides the package for an older version of click. It fails while applying the patch
Edit: See PR #42254 for a fix |
importing click shells out to 'locale', which currently needs to be in
PATH. Fix by setting patching locale command at runtime.
Motivation for this change
Tried dockerizing a flask application, which uses click, which failed to import due to above error
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)