Skip to content
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

Steps towards getting Bazel compiling on Darwin #5

Closed
wants to merge 5 commits into from
Closed

Steps towards getting Bazel compiling on Darwin #5

wants to merge 5 commits into from

Conversation

illicitonion
Copy link
Contributor

No description provided.

@illicitonion
Copy link
Contributor Author

With these changes I can compile and run blaze info:

$ ./compile.sh
PROTOC src/main/protobuf/build.proto
PROTOC src/main/protobuf/extra_actions.proto
PROTOC src/main/protobuf/testing_api.proto
JAVAC src/main/java//.java
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:19: warning: Signal is internal proprietary API and may be removed in a future release
import sun.misc.Signal;
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:20: warning: SignalHandler is internal proprietary API and may be removed in a future release
import sun.misc.SignalHandler;
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:32: warning: Signal is internal proprietary API and may be removed in a future release
private static final Signal SIGINT = new Signal("INT");
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:32: warning: Signal is internal proprietary API and may be removed in a future release
private static final Signal SIGINT = new Signal("INT");
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:34: warning: SignalHandler is internal proprietary API and may be removed in a future release
private SignalHandler oldHandler;
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:42: warning: SignalHandler is internal proprietary API and may be removed in a future release
this.oldHandler = Signal.handle(SIGINT, new SignalHandler() {
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:44: warning: Signal is internal proprietary API and may be removed in a future release
public void handle(Signal signal) {
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:42: warning: Signal is internal proprietary API and may be removed in a future release
this.oldHandler = Signal.handle(SIGINT, new SignalHandler() {
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:55: warning: Signal is internal proprietary API and may be removed in a future release
Signal.handle(SIGINT, oldHandler);
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
9 warnings
UNZIP third_party/{guava,joda-time,jsr305,protobuf}/
.jar
JAR libblaze.jar
JAVAC src/test/java/
/*.java
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
CC src/main/cpp/blaze_startup_options.cc
CC src/main/cpp/blaze_startup_options_common.cc
CC src/main/cpp/blaze_util.cc
CC src/main/cpp/blaze_util_darwin.cc
CC src/main/cpp/blaze.cc
src/main/cpp/blaze.cc:452:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
src/main/cpp/blaze.cc:520:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
src/main/cpp/blaze.cc:603:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
3 warnings generated.
CC src/main/cpp/option_processor.cc
CC src/main/cpp/util/port.cc
CC src/main/cpp/util/strings.cc
CC src/main/cpp/util/file.cc
CC src/main/cpp/util/md5.cc
CC src/main/cpp/util/numbers.cc
LD client
CC src/main/native/localsocket.cc
CC src/main/native/process.cc
CC src/main/native/unix_jni.cc
src/main/native/unix_jni.cc:417:36: warning: 'stat64' is deprecated: first deprecated in OS X 10.6 [-Wdeprecated-declarations]
return ::StatCommon(env, path, ::stat64, true);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/sys/stat.h:380:5: note: 'stat64' declared here
int stat64(const char *, struct stat64 *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5,__MAC_10_6,__IPHONE_NA,__IPHONE_NA);
^
src/main/native/unix_jni.cc:430:36: warning: 'lstat64' is deprecated: first deprecated in OS X 10.6 [-Wdeprecated-declarations]
return ::StatCommon(env, path, ::lstat64, true);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/sys/stat.h:379:5: note: 'lstat64' declared here
int lstat64(const char *, struct stat64 *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5,__MAC_10_6,__IPHONE_NA,__IPHONE_NA);
^
src/main/native/unix_jni.cc:442:36: warning: 'stat64' is deprecated: first deprecated in OS X 10.6 [-Wdeprecated-declarations]
return ::StatCommon(env, path, ::stat64, false);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/sys/stat.h:380:5: note: 'stat64' declared here
int stat64(const char *, struct stat64 *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5,__MAC_10_6,__IPHONE_NA,__IPHONE_NA);
^
src/main/native/unix_jni.cc:454:36: warning: 'lstat64' is deprecated: first deprecated in OS X 10.6 [-Wdeprecated-declarations]
return ::StatCommon(env, path, ::lstat64, false);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/sys/stat.h:379:5: note: 'lstat64' declared here
int lstat64(const char *, struct stat64 *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5,__MAC_10_6,__IPHONE_NA,__IPHONE_NA);
^
4 warnings generated.
CC src/main/native/unix_jni_darwin.cc
CC src/main/cpp/util/md5.cc
LD libunix.dylib
CC build-runfiles
CC process-wrapper
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
updating: libblaze.jar (deflated 12%)
updating: libunix.dylib (deflated 67%)
updating: build-runfiles (deflated 69%)
updating: process-wrapper (deflated 77%)
updating: alarm (stored 0%)
updating: client_info (stored 0%)
updating: install_base_key (stored 0%)

$ /Users/danielwh/wcs/bazel/output/bazel --host_javabase=$(/usr/libexec/java_home) info
Extracting Blaze installation...
Jun 27, 2014 8:48:39 PM com.google.devtools.build.lib.blaze.BlazeRuntime main
INFO: Starting Blaze server with args [--batch, --install_base=/var/tmp/_blaze_danielwh/install/d593fd674b72cdd2f724ed63faf4032d, --output_base=/private/var/tmp/_blaze_danielwh/fba9439d1ee97f86a37db961c5cefbbf, --option_sources=host_Ujavabase:, info, --startup_time=1403916519159, --extract_data_time=49, --binary_path=/Users/danielwh/wcs/bazel/output/bazel, --isatty=1, --terminal_columns=202, ...some-vars-removed..., --client_cwd=/private/tmp/google3]
Jun 27, 2014 8:48:39 PM com.google.devtools.build.lib.blaze.BlazeRuntime setupLogging
INFO: Log level: INFO
blaze-bin: /private/var/tmp/_blaze_danielwh/fba9439d1ee97f86a37db961c5cefbbf/google3/blaze-out/fastbuild/bin
blaze-genfiles: /private/var/tmp/_blaze_danielwh/fba9439d1ee97f86a37db961c5cefbbf/google3/blaze-out/fastbuild/genfiles
blaze-testlogs: /private/var/tmp/_blaze_danielwh/fba9439d1ee97f86a37db961c5cefbbf/google3/blaze-out/fastbuild/testlogs
command_log: /private/var/tmp/_blaze_danielwh/fba9439d1ee97f86a37db961c5cefbbf/command.log
committed-heap-size: 262MB
execution_root: /private/var/tmp/_blaze_danielwh/fba9439d1ee97f86a37db961c5cefbbf/google3
gc-count: 2
gc-time: 42ms
install_base: /var/tmp/_blaze_danielwh/install/d593fd674b72cdd2f724ed63faf4032d
max-heap-size: 4008MB
message_log: /private/var/tmp/_blaze_danielwh/fba9439d1ee97f86a37db961c5cefbbf/message.log
output_base: /private/var/tmp/_blaze_danielwh/fba9439d1ee97f86a37db961c5cefbbf
output_path: /private/var/tmp/_blaze_danielwh/fba9439d1ee97f86a37db961c5cefbbf/google3/blaze-out
package_path: %workspace%:%workspace%/../READONLY/google3
release: development version
server_pid: 18223
used-heap-size: 4401KB
workspace: /private/tmp/google3

@illicitonion
Copy link
Contributor Author

And, creating a fake tools/genrule/genrule-setup.sh I can run genrules :)

$ /Users/danielwh/wcs/bazel/output/bazel --host_javabase=$(/usr/libexec/java_home) build //p:gr
Jun 27, 2014 9:01:37 PM com.google.devtools.build.lib.blaze.BlazeRuntime main
INFO: Starting Blaze server with args [...]
Jun 27, 2014 9:01:37 PM com.google.devtools.build.lib.blaze.BlazeRuntime setupLogging
INFO: Log level: INFO
Jun 27, 2014 9:01:37 PM com.google.devtools.build.lib.buildtool.BuildTool buildTargets
INFO: Build identifier: ab96f790-f9f4-4a97-adb9-a75c0e2cfdfd
Jun 27, 2014 9:01:37 PM com.google.devtools.build.lib.pkgcache.LoadingPhaseRunner execute
INFO: Starting pattern evaluation
INFO: Loading...
Jun 27, 2014 9:01:37 PM com.google.devtools.build.lib.pkgcache.LoadingPhaseRunner doLoadingPhase
INFO: Loading package: tools/genrule
Jun 27, 2014 9:01:37 PM com.google.devtools.build.lib.pkgcache.LoadingPhaseRunner doLoadingPhase
INFO: Loading phase finished
Jun 27, 2014 9:01:38 PM com.google.devtools.build.lib.buildtool.BuildTool buildTargets
INFO: Loading complete. Analyzing...
Jun 27, 2014 9:01:38 PM com.google.devtools.build.lib.view.BuildView update
INFO: Starting analysis
Jun 27, 2014 9:01:38 PM com.google.devtools.build.lib.view.BuildView update
INFO: Found 1 target...
INFO: Building...
Jun 27, 2014 9:01:38 PM com.google.devtools.build.lib.actions.LocalHostCapacity disableProcFsUse
WARNING: Unable to read system load or capacity
java.io.FileNotFoundException: /proc/cpuinfo (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:146)
at com.google.common.io.Files$FileByteSource.openStream(Files.java:126)
at com.google.common.io.Files$FileByteSource.openStream(Files.java:116)
at com.google.common.io.ByteSource$AsCharSource.openStream(ByteSource.java:434)
at com.google.common.io.CharSource.read(CharSource.java:161)
at com.google.common.io.Files.toString(Files.java:367)
at com.google.devtools.build.lib.actions.LocalHostCapacity.readContent(LocalHostCapacity.java:290)
at com.google.devtools.build.lib.actions.LocalHostCapacity.getLocalHostCapacity(LocalHostCapacity.java:246)
at com.google.devtools.build.lib.actions.LocalHostCapacity.getLocalHostCapacity(LocalHostCapacity.java:145)
at com.google.devtools.build.lib.buildtool.ExecutionTool.configureResourceManager(ExecutionTool.java:919)
at com.google.devtools.build.lib.buildtool.ExecutionTool.executeBuild(ExecutionTool.java:396)
at com.google.devtools.build.lib.buildtool.BuildTool.buildTargets(BuildTool.java:199)
at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:261)
at com.google.devtools.build.lib.blaze.commands.BuildCommand.exec(BuildCommand.java:60)
at com.google.devtools.build.lib.blaze.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:413)
at com.google.devtools.build.lib.blaze.BlazeRuntime.batchMain(BlazeRuntime.java:1177)
at com.google.devtools.build.lib.blaze.BlazeRuntime.main(BlazeRuntime.java:1040)
at com.google.devtools.build.lib.bazel.BazelMain.main(BazelMain.java:35)

Jun 27, 2014 9:01:38 PM com.google.devtools.build.lib.actions.ParallelBuilder buildArtifactsHook
[0%] Executing genrule //p:gr
Jun 27, 2014 9:01:38 PM com.google.devtools.build.lib.actions.ParallelBuilder buildArtifactsHook
INFO: Building complete.
Jun 27, 2014 9:01:38 PM com.google.devtools.build.lib.buildtool.ExecutionTool saveCaches
INFO: saving action cache...
Jun 27, 2014 9:01:38 PM com.google.devtools.build.lib.buildtool.ExecutionTool saveCaches
INFO: action cache saved
Jun 27, 2014 9:01:38 PM com.google.devtools.build.lib.buildtool.ExecutionTool saveCaches
INFO: saving metadata cache...
Jun 27, 2014 9:01:38 PM com.google.devtools.build.lib.buildtool.ExecutionTool saveCaches
Target //p:gr up-to-date:
blaze-genfiles/p/o
Jun 27, 2014 9:01:38 PM com.google.devtools.build.lib.blaze.BuildSummaryStatsModule buildComplete
INFO: Critical Path: 0.03s
0.00s TargetCompletionMiddleman _middlemen/target_Ucomplete_U_S_Sp_Cgr
0.02s Executing genrule //p:gr
INFO: Elapsed time: 1403917297.674s, Incrementality: 41%, Critical Path: 0.03s

@illicitonion
Copy link
Contributor Author

@hanwen merged these changes in manually

@ulfjack ulfjack mentioned this pull request Mar 27, 2015
nkoroste pushed a commit to nkoroste/bazel that referenced this pull request Aug 18, 2020
https://jira.sc-corp.net/browse/APP-56636 (option bazelbuild#5)

By default Bazel always performs a manifest merge action for every android_library with resources.

This involves overriding the manifests package attribute with either a package inferred from the java{,tests} source root relative to the BUILD file or from the override specified in the custom_package attribute.

This option disables the automatic stamping for users who would be happy to accept the package specified in the manifest and do not wish to override it.

Saves 270 Actions
Before:   ManifestMerger            271         398 kb          74 kb        64176 s
After:      ManifestMerger              1         302 kb            0 b          489 s

Will mostly affect clean builds.

---
Automatic squash commit from https://github.sc-corp.net/Snapchat/bazel/pull/37
Cooled by jgerrish
comius added a commit to comius/bazel that referenced this pull request Nov 27, 2020
nkoroste pushed a commit to nkoroste/bazel that referenced this pull request Feb 23, 2021
https://jira.sc-corp.net/browse/APP-56636 (option bazelbuild#5)

By default Bazel always performs a manifest merge action for every android_library with resources.

This involves overriding the manifests package attribute with either a package inferred from the java{,tests} source root relative to the BUILD file or from the override specified in the custom_package attribute.

This option disables the automatic stamping for users who would be happy to accept the package specified in the manifest and do not wish to override it.

Saves 270 Actions
Before:   ManifestMerger            271         398 kb          74 kb        64176 s
After:      ManifestMerger              1         302 kb            0 b          489 s

Will mostly affect clean builds.

---
Automatic squash commit from https://github.sc-corp.net/Snapchat/bazel/pull/37
Cooled by jgerrish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant