-
-
Notifications
You must be signed in to change notification settings - Fork 11.4k
Fix docker-machine-driver-xhyve HEAD #49467
Fix docker-machine-driver-xhyve HEAD #49467
Conversation
git_hash = "HEAD-#{git_hash}" | ||
ENV["CGO_LDFLAGS"] = "#{build_root}/vendor/build/lib9p/lib9p.a -L#{build_root}/vendor/lib9p" | ||
ENV["CGO_CFLAGS"] = "-I#{build_root}/vendor/lib9p" | ||
mkdir "vendor/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.
Why is this not being handled by the below make
step?
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.
lib9p doesn't need the LDFLAGS, it's so the go build below will find them properly
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.
Apologies, I meant the mkdir
directives rather than the flags.
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.
Ah, I see. TBH, I'm not sure why the build system is the way it is. It's my first go project I've dug into the source for, and one of my first attempts at making a brew formula. The directories are in .gitignore, so they're really not supposed to be in the source tree. Why the build doesn't doesn't make them itself is a mystery to me.
What would you like for me to do in this case? Would it be better to patch the Makefile instead of the formula? I've notified the upstream of the problem, so I'm wary that such a patch would fail to apply once the issue is solved.
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.
Sorry for the slow reply; not around Homebrew a huge amount this past week. Let's shorten it a bit:
(buildpath/"vendor/build/lib9p/backend").mkpath
(buildpath/"vendor/build/lib9p/transport").mkpath
(buildpath/"vendor/build/lib9p/sbuf").mkpath
That saves us two extra lines. If this is being addressed upstream as well it'd be nice to include a link to that PR/Issue so we know when it's safe to remove.
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 Ruby version of mkdir -p
is just mkdir_p
, and mkpath
is an alias of that :). Outside of Homebrew you'd call it with FileUtils.mkdir_p
for example, which may be why it didn't show up on searching.
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.
Ping on the small cleanup? 😃
Any thoughts on this @zchee?
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.
Would it be best if I make the suggested cleanup and add the formula as-is? Once HEAD becomes the released version, another change will have to be made, and we can make another pass at tidying it all up.
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 fix make
job in machine-drivers/docker-machine-driver-xhyve#106
mkdir
line is no longer required. It creates build directory automatically even Homebrew.
I tested local brew
command.
@DomT4 WDYT?
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.
Let me update the patch with your suggestions. One sec.
Working w/upstream @ machine-drivers/docker-machine-driver-xhyve#98 |
@PerilousApricot @DomT4 Sorry for a late reply 😖 |
@@ -22,13 +22,21 @@ def install | |||
(buildpath/"gopath/src/github.com/zchee/docker-machine-driver-xhyve").install Dir["{*,.git,.gitignore}"] |
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.
make lib9p
job will be run git submodule update --init
.
In Homebrew, will occur
==> make lib9p
git submodule update --init
fatal: no submodule mapping found in .gitmodules for path 'vendor/lib9p'
mk/lib9p.mk:36: recipe for target 'vendor/lib9p/%.c' failed
make: *** [vendor/lib9p/%.c] Error 128
So, needs fix Dir["{*,.git,.gitignore}"]
-> Dir["{*,.git,.gitignore,.gitmodules}"]
The new patch works for me. |
Sorry for not catching this sooner, but it would be ideal to include the submodules as |
url "https://github.com/zchee/docker-machine-driver-xhyve/archive/v0.2.2.tar.gz" to url "https://github.com/zchee/docker-machine-driver-xhyve.git",
:tag => "v0.2.2",
:revision => "7a7e30b80a9ee444e5e67fd1839422e201a1b328" |
Cool, updated with your suggestions and added a caveat |
🙀
|
"Oh, let me just make one quick addition before I commit this. It's such a It's dark in this basement. |
This seems good to merge, and it fixes the --HEAD build. |
@BrewTestBot test this please |
@PerilousApricot I think it's just the trailing whitespace, can you clean it up please? :) |
@FiloSottile certainly. I guess I need to re-open a new PR against the |
No, we can merge this PR into |
Merged in Homebrew/homebrew-core@691ca49 and Homebrew/homebrew-core@e1bd08c (some style adjustments). Thank you for this contribution to Homebrew, @PerilousApricot! 🎉 |
Tested with and w/o --HEAD, and with audit.