-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
fmpy: init at 0.3.23 #397658
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
base: master
Are you sure you want to change the base?
fmpy: init at 0.3.23 #397658
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
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.
A few more comments on the commits of the PR: Always make sure the PR has the following commits:
maintainers.tmplt: fix email and name
rpclib: init at 2.3.0
python312Packages.fmpy: init at <fill this>
I'd let go of the sundials commit, and put all the overriding details inside the fmpy
expression. Note how I use python312Packages.fmpy
and not python3Packages.fmpy
- the later is not an attribute directly built by Hydra, and hence the PR does not trigger an ofborg build of it automatically.
Thanks for the review, @doronbehar. I'll handle your comments when all the kinks are ironed out. |
Things to fix:
|
dlopen error due to FMPy extracting FMU under |
Makes sense. Done. |
329dd38
to
6c06b7c
Compare
Release notes via https://github.com/CATIA-Systems/FMPy/releases/tag/v0.3.23 Co-authored-by: Vladimir Korolev <[email protected]>
Could not get the remoting feature to build so I gated it behind a package option,
Unsure what's going on here, or whether this is an upstream issue. |
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.
Lots of comments! Indeed a complex package you are trying to package!
stdenv.mkDerivation rec { | ||
pname = "rpclib"; | ||
version = "2.3.0"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "rpclib"; | ||
repo = "rpclib"; | ||
rev = "v${version}"; | ||
sha256 = "0dlbkl47zd2fkxwbn93w51wmvfr8ssp4zribn5wi4cpiky44a4g9"; |
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.
stdenv.mkDerivation rec { | |
pname = "rpclib"; | |
version = "2.3.0"; | |
src = fetchFromGitHub { | |
owner = "rpclib"; | |
repo = "rpclib"; | |
rev = "v${version}"; | |
sha256 = "0dlbkl47zd2fkxwbn93w51wmvfr8ssp4zribn5wi4cpiky44a4g9"; | |
stdenv.mkDerivation (finalAttrs: { | |
pname = "rpclib"; | |
version = "2.3.0"; | |
src = fetchFromGitHub { | |
owner = "rpclib"; | |
repo = "rpclib"; | |
rev = "v${finalAttrs.version}"; | |
sha256 = "0dlbkl47zd2fkxwbn93w51wmvfr8ssp4zribn5wi4cpiky44a4g9"; |
license = with lib.licenses; [ mit ]; | ||
maintainers = with lib.maintainers; [ tmplt ]; | ||
}; | ||
} |
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.
} | |
}) |
meta = { | ||
description = "RPC library for C++, providing both a client and server implementation"; | ||
homepage = "https://github.com/rpclib/rpclib/"; | ||
license = with lib.licenses; [ mit ]; |
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.
This will probably not change too often to justify opening a with *;
. So I'd suggest:
license = with lib.licenses; [ mit ]; | |
license = lib.licenses.mit; |
homepage = "https://github.com/CATIA-Systems/FMPy"; | ||
license = with lib.licenses; [ bsd2 ]; | ||
maintainers = with lib.maintainers; [ tmplt ]; | ||
platforms = with lib.platforms; linux ++ darwin ++ windows; |
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.
This is pretty much the same as lib.platforms.all;
.
broken = enableRemoting; | ||
description = "Simulate Functional Mockup Units (FMUs) in Python"; | ||
homepage = "https://github.com/CATIA-Systems/FMPy"; | ||
license = with lib.licenses; [ bsd2 ]; |
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.
Same here:
license = with lib.licenses; [ bsd2 ]; | |
license = lib.licenses.bsd2; |
substituteInPlace src/fmpy/gui/__init__.py \ | ||
--replace-fail "@QT6_LIBEXEC_DIR@" "${qt6.qtbase}/libexec/" |
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.
To make it a bit clearer that the derivation is eventually built using Nixpkgs Python setup hooks, maybe it'd be a bit more correct to put this in a postConfigure
.
''; | ||
|
||
# Don't run upstream build scripts as they are too specialized. | ||
# cvode is already built, so we only need to build native binaries. |
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.
Another worth noting thing to comment about could be:
# cvode is already built, so we only need to build native binaries. | |
# cvode is already built, so we only need to build native binaries. | |
# We run these cmake builds and then run the standard Nixpkgs Python | |
# setup-hooks. |
+ lib.optionalString (enableRemoting && stdenv.isLinux) '' | ||
# The reproduction of build_remoting.py | ||
# NB: does not build due do to incorrect open(8) call |
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.
Put that comment near broken = true;
.
+ lib.optionalString (enableRemoting && stdenv.isLinux) '' | |
# The reproduction of build_remoting.py | |
# NB: does not build due do to incorrect open(8) call | |
+ lib.optionalString (enableRemoting && stdenv.isLinux) '' |
# Remove artifacts that we do not build | ||
+ lib.optionalString stdenv.isLinux '' | ||
sed --regexp-extended --in-place '/(.dll|.dylib|.exe)/d' pyproject.toml | ||
'' | ||
+ lib.optionalString stdenv.isDarwin '' | ||
sed --regexp-extended --in-place '/(.dll|.so|linux|.exe)/d' pyproject.toml | ||
'' | ||
+ lib.optionalString (!enableRemoting) '' | ||
sed --regexp-extended --in-place '/(client_tcp|server_tcp)/d' pyproject.toml | ||
''; |
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.
Upstream should be nudged to not require these artifacts depending on the platform... Have you made an effort in that regard? Even if we'd decide to keep removing these lines ourselves, maybe it'd recommend at least for the darwin v.s linux. something like:
# Remove the other system's extension.
''
sed --regexp-extended --in-place '/\.(dll|${
"linux" = "dylib";
"darwin" = "so";
}.${stdenv.hostPlatform.system}|exe)/d' pyproject.toml
''
NOTE: Technically, a bit more sophisticated Nix function should be used here, since exe is always removed although Windows is a supported platform.
In general, I'm very surprised upstream writes all of these extensions, and that you have to remove them because you want to build to a specific platform... I'd try to discuss this with upstream to make it easier for us and for others to build and distribute their software...
--subst-var-by cvode ${cvode} | ||
# Sundials are provided outside of this package | ||
sed --regexp-extended --in-place '/(sundials_)/d' pyproject.toml |
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.
Not to mention they hard-code these sundials paths... Why do they do it?
Good comments, @doronbehar, thanks! It may be a week or two before I can handle these. |
Continuing the work from #131741, FMpy, a library for working with the FMI standard is packaged.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.