-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
nest: migrate to homebrew/core #21561
Conversation
Failing because of dependency on |
It's unlikely matplotlib will be accepted into homebrew/core. You should vendor as is done with most python resources. |
👍 will do so. |
Formula/nest.rb
Outdated
|
||
requires_py3 = [] | ||
requires_py3 << "with-python3" if build.with? "python3" | ||
depends_on "numpy" => requires_py3 |
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.
depends_on "foo" => "with-bar"
is an audit failure, which this use of a variable manages to circumvent. It's also unnecessary here since numpy
builds with both python2 and python3 by default. Unless we're building both python2 and python3 bindings by default for nest, numpy will need to be vendored.
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.
In Python for Formula Authors the matplotlib
formula is given as an example for python dependencies and I followed their lead - and they use the variable to circumvent audit failure. Vendoring scipy
and numpy
now. matplotlib
actually is not a necessary requirement - only used in examples, hence removing it from dependencies.
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.
That documentation is dated.
Formula/nest.rb
Outdated
requires_py3 = [] | ||
requires_py3 << "with-python3" if build.with? "python3" | ||
depends_on "numpy" => requires_py3 | ||
depends_on "scipy" => requires_py3 |
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 comment as above
Formula/nest.rb
Outdated
end | ||
|
||
def install | ||
ENV.delete("CFLAGS") |
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 should never be needed. Ditto CXXFLAGS below.
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.
Removed.
Formula/nest.rb
Outdated
option "without-openmp", "Build without OpenMP support." | ||
needs :openmp if build.with? "openmp" | ||
|
||
depends_on "gsl" => :recommended |
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.
just require it
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.
Done.
Formula/nest.rb
Outdated
|
||
option "with-python3", "Build Python3 bindings (PyNEST) instead of Python2 bindings." | ||
option "without-openmp", "Build without OpenMP support." | ||
needs :openmp if build.with? "openmp" |
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 need this option
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 do not understand, why we don't need this option? nest can be build with or without OpenMP. Are you suggesting, we build with OpenMP by default?
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'm saying we should have no openmp option.
Formula/nest.rb
Outdated
needs :openmp if build.with? "openmp" | ||
|
||
depends_on "gsl" => :recommended | ||
depends_on :mpi => [:optional, :cc, :cxx] |
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 need this option
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. Are you suggesting we build with MPI by default?
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'm saying we should have no mpi option.
Formula/nest.rb
Outdated
ENV.prepend_create_path "PATH", buildpath/"cython/bin" | ||
ENV.prepend_create_path "PYTHONPATH", buildpath/"cython/lib/python#{python_version}/site-packages" | ||
|
||
# "out of source" build |
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.
comment isn't needed
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.
Removed.
Formula/nest.rb
Outdated
inreplace bin/"nest-config", | ||
%r{#{HOMEBREW_REPOSITORY}/Library/Homebrew/shims.*/super}, | ||
"#{HOMEBREW_PREFIX}/bin", | ||
FALSE |
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 sure what the deal is with this inreplace
but any use of the false
argument is essentially a bug by definition.
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.
See https://github.com/Homebrew/homebrew-science/pull/6479 why we introduced the inreplace
and https://github.com/Homebrew/homebrew-science/pull/6488 for the FALSE
part.
Formula/nest.rb
Outdated
homepage "http://www.nest-simulator.org/" | ||
url "https://github.com/nest/nest-simulator/archive/v2.14.0.tar.gz" | ||
sha256 "afaf7d53c2d5305fac1257759cc0ea6d62c3cebf7d5cc4a07d4739af4dbb9caf" | ||
head "https://github.com/nest/nest-simulator.git" |
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 need this
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.
Without this, the --HEAD
option is gone. Is this intended?
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.
yes.
Formula/nest.rb
Outdated
depends_on "matplotlib" => requires_py3 | ||
|
||
depends_on "libtool" => :run | ||
depends_on "readline" => :run |
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.
the => :run
isn't needed. readline
would never be => :build
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.
Removed.
Formula/nest.rb
Outdated
|
||
depends_on "libtool" => :run | ||
depends_on "readline" => :run | ||
depends_on "cmake" => :build |
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.
=> :build
should go above the rest
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.
Moved.
Formula/nest.rb
Outdated
|
||
fails_with :clang do | ||
cause <<-EOS.undent | ||
Building NEST with clang is not stable. See https://github.com/nest/nest-simulator/issues/74 . |
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.
If this is true, it doesn't belong in homebrew/core.
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.
Seems fixed, see nest/nest-simulator#732. On the other hand, clang from macOS does not support OpenMP (last time i checked) and we would have to rely on gcc anyway. Removing fails_with
part.
Formula/nest.rb
Outdated
depends_on "libtool" => :run | ||
depends_on "readline" | ||
|
||
patch :DATA |
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.
New formulae must build without patching.
|
It takes under a minute to build and we don't usually package python libraries. I'm considering removing numpy and scipy too. |
Formula/nest.rb
Outdated
] {join} Fold | ||
} Function def | ||
EOS | ||
File.open(ENV["HOME"]+"/.nestrc", "w") { |file| file.write(nestrc) } |
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.
(testpath/".nestrc").write nestrc
, no?
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.
nest will look in HOME
for .nestrc
... if testpath
is equal to HOME
in the testing-sandbox, then this would be ok. But since there will not be a MPI build, .nestrc
is not needed and those lines will go anyway.
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.
Yeah, testpath
is HOME
here, as is buildpath
during def install
, although the latter may one day change as it has some side-effects that aren't completely desirable.
I will prepare a PR upstream with changes making the patch unnecessary, but I doubt there will be release in the near future (2.14 is relative fresh for nest ~20. Oct.). Also, I am a bit reluctant to vendor matplotlib: I found no other formula in core vendoring matplotlib; and besides the dead code in the tests (in the patch), matplotlib is actually not necessary for nest; also looking at matplotlib formula, there is some complexity I do not want to mirror in nest's formula just for vendoring. I am ok with the other requests, but this might be a deal breaker until a new release of nest? I guess it is not possible to use a git-commit instead of a stable release? |
If the patch has been accepted upstream, we can apply it with a |
Due to `brew audit --strict homebrew/core/nest`: * removing `revision 1` * removing `depends_on :python unless OS.mac?`
* vendor python packages * make OpenMP and MPI default * some restructuring
@BrewTestBot test this please |
end | ||
|
||
# add nosetest executable to path | ||
ENV.prepend_create_path "PATH", libexec/"bin" |
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 just be prepend_path
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
I am still working on an upstream PR. Please do not close. |
@tammoippen How's it going? |
@vinyldarkscratch Still waiting for the upstream PR... |
I see, thanks for the update, @tammoippen! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingbrew install <formula>
)?Migrating because of: https://github.com/Homebrew/homebrew-science/issues/6331
Companion PR: https://github.com/Homebrew/homebrew-science/pull/6489