-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
try to bring some sanity to the embedding makefile #21427
Conversation
3a9a4d6
to
92c09e5
Compare
I don't think we should be building it by default as a requirement of |
Are we installing it or not. This half-wise state has lead to some really awful makefiles. This fixes that so that it works correctly. |
I don't think we should do so by default, only upon request. |
examples/Makefile
Outdated
|
||
embedding_binary := $(abspath $(outdir)/embedding$(JULIA_LIBSUFFIX)$(EXE)) | ||
embedding-args := \ |
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.
underscores would be preferable to dashes in variable names IMO
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.
likewise with CFLAGS_ADD
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 shouldn't be anything wrong with using more of the allowed characters
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.
stylistically preferable and more uniform to stick with underscores consistently though
examples/embedding/Makefile
Outdated
@@ -11,16 +11,19 @@ ifndef BIN | |||
endif | |||
|
|||
#============================================================================= | |||
SPAWN ?= $1 |
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 needs a comment
contrib/julia-config.jl
Outdated
return windowsInitDir() | ||
end | ||
dir, bin = splitdir(JULIA_HOME) | ||
return joinpath(dir, "include", "julia") |
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 PR isn't making it worse, but this is incorrect if the layout has been set differently, like in a distro build
ac6682a
to
78f1627
Compare
appveyor.yml
Outdated
.\bin\julia.exe --check-bounds=yes share\julia\test\runtests.jl libgit2-online download pkg embedding | ||
#- cd julia-* && .\bin\julia.exe --check-bounds=yes share\julia\test\runtests.jl all && | ||
# .\bin\julia.exe --check-bounds=yes share\julia\test\runtests.jl libgit2-online download pkg | ||
- usr\bin\embedding 2>NUL | usr\bin\julia usr\share\doc\julia\examples\embedding\embedding-test.jl |
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 redirect error output
why are you making test/embedding.jl so much harder to invoke? |
Have you tried to invoke the current embedding test? It sounded to me like Jeff almost went mad trying to figure out how to make it run on just our CI configuration. |
Yes, my last commit in that PR got it working. |
The version on master is far from perfect, but if you run in the right order, |
examples/Makefile
Outdated
release: # default target | ||
# forward all variables expected by the embedding example | ||
JULIA:=$(call spawn,$(JULIA_EXECUTABLE)) | ||
BIN:=$(build_bindir) |
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.
from past discussion it was agreed it should be put in libexecdir, not bindir
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.
Past discussion (#18688 (comment)) was about not installing it. So irrelevant to this PR (which simply doesn't install broken copies of it, like we do now).
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.
Broken how? Usually we try to make the build tree mostly mirror the install tree, except that the former has some things in it that the latter doesn't. Including this executable for now, but if we were to start installing it in the future, I think the structure would be cleaner if it were put in a build-tree location that matched the install-tree location it would get distributed under. And we've discussed that the install tree location shouldn't be publicly exposing such a generic executable name alongside the julia executable. So for the sake of consistency, the build tree shouldn't put it alongside the julia executable either.
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.
Because we currently can't and don't build or install it in a way that mirrors the install tree (this PR gives you more of that flexibility, although more design work in libjulia is still 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.
It's in libexecdir on master. It's not in build_libexecdir in this PR.
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.
shouldn't have ever been using the
libexecdir
variable since it isn't even a defined location.
What do you mean? Of course it's defined, $(prefix)/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.
prefix
doesn't have a valid value except when executing the install
target
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.
When it was a relative path for no good reason it was nonsense, but now that it isn't? Your unstated rules for "valid" aren't making a whole lot of sense.
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 am building off your observations on the issues with the original PR (#21299 (comment)):
"It's kind of lying to the makefiles"
"would need changing if you're doing an out-of-tree"
"the embedding executable wouldn't run in a binary install"
Why are you giving me such a hard time about addressing those issues?
With this PR, the "example/embedding" directory is now a complete, independent stand-alone example of how to begin a project with Julia; the example/Makefile
is a minimal shim to make it easy to run tests against the example; and the CI configuration includes a directive to test that the example project build works.
Anyways, PR updated to make the embedding example directory independent from the Julia 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.
"It's kind of lying to the makefiles"
"would need changing if you're doing an out-of-tree"
those were in response to manually overriding prefix=usr
which is no longer happening
"the embedding executable wouldn't run in a binary install"
not fixed yet by this pr, some of this will help get there but refactoring the way the test runs and changing the location the executable gets built aren't needed to do that
Why are you giving me such a hard time about addressing those issues?
You haven't been communicating what is broken that you're fixing, just saying how awful and wrong it is without explanation. And the changes here, for the most part, haven't been addressing the acknowledged issues.
3110140
to
cdb160d
Compare
Need to turn back on the rest of the tests, but otherwise cdb160d will do. |
cdb160d
to
1fb267f
Compare
contrib/windows/msys_build.sh
Outdated
@@ -203,7 +203,7 @@ fi | |||
echo 'FORCE_ASSERTIONS = 1' >> Make.user | |||
|
|||
cat Make.user | |||
make -j3 VERBOSE=1 install | |||
make -j3 VERBOSE=1 |
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.
may as well keep the install, it takes an extra couple minutes but we have the capacity and it's worth covering
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 thought that this file was supposed to be a general-purpose msys build helper, not specific to appveyor, so I was trying to minimize the testing-specific work it was doing.
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.
"general purpose" is overstating it, but it should be possible to run outside of appveyor. running make install
isn't testing specific
05f5c93
to
fe0cd38
Compare
we'll still want to eventually decide how to make julia-config.jl output correct relative rpaths but this should at least get `make -C embedding' working correctly
fe0cd38
to
bc90122
Compare
we'll still want to eventually decide how to make julia-config.jl output correct relative rpaths
but this should at least get `make -C embedding' working correctly
[x-ref #21299 and precursors]