facebook / buck

A fast build system that encourages the creation of small, reusable modules over a variety of platforms and languages.
https://buck.build
Apache License 2.0
8.56k stars 1.16k forks source link

Support MacOS Big Sur #2568

Open khoadotan12 opened 3 years ago

khoadotan12 commented 3 years ago

Did buck support for MacOS BigSur? I have same issue as #2491 with buck and can't build dev branch with ant. Maybe there're problems with java SDK

alyfreym commented 3 years ago

After installing JDK open terminal and write

after write *echo $JAVA_HOME

And its print should be like this - /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home --> IMPORTANT U SEE adoptopenjdk-11.jdk!!! java 8 not working only 11

after

after just copy past

ant ./bin/buck build --show-output buck buck-out/gen/programs/buck.pex --help

Done. Tested fucking macOs Big Sure 11.1

Some Links

build example - https://buck.build/setup/getting_started.html java download - https://adoptopenjdk.net/archive.html?variant=openjdk11&jvmVariant=hotspot

khoadotan12 commented 3 years ago

After installing JDK open terminal and write

  • export JAVA_HOME=$(/usr/libexec/java_home)

after write *echo $JAVA_HOME

And its print should be like this - /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home --> IMPORTANT U SEE adoptopenjdk-11.jdk!!! java 8 not working only 11

after

  • cd "my buck folder path"

after just copy past

ant ./bin/buck build --show-output buck buck-out/gen/programs/buck.pex --help

Done. Tested fucking macOs Big Sure 11.1

Some Links

build example - https://buck.build/setup/getting_started.html java download - https://adoptopenjdk.net/archive.html?variant=openjdk11&jvmVariant=hotspot

Thanks @alyfreym , but when I build buck with ant, there are some errors with javac. My javac version is 11.0.9.1

compile:
    [javac] Compiling 5 source files to /Users/khoadt2/Downloads/Documents/buck/ant-out/classes
    [javac] [compiled 965 lines in 1005 ms: 960.1 lines/s]
    [javac] [2 .class files generated]
    [javac] ----------
    [javac] 1. ERROR in /Users/khoadt2/Downloads/Documents/buck/src/com/facebook/buck/jvm/java/abi/AccessFlags.java (at line 200)
    [javac]     switch (modifier) {
    [javac]             ^^^^^^^^
    [javac] The enum constant NON_SEALED should have a corresponding case label in this enum switch on Modifier. To suppress this problem, add a comment //$CASES-OMITTED$ on the line above the 'default:'
    [javac] ----------
    [javac] 2. ERROR in /Users/khoadt2/Downloads/Documents/buck/src/com/facebook/buck/jvm/java/abi/AccessFlags.java (at line 200)
    [javac]     switch (modifier) {
    [javac]             ^^^^^^^^
    [javac] The enum constant SEALED should have a corresponding case label in this enum switch on Modifier. To suppress this problem, add a comment //$CASES-OMITTED$ on the line above the 'default:'
    [javac] ----------
    [javac] ----------
    [javac] 3. ERROR in /Users/khoadt2/Downloads/Documents/buck/src/com/facebook/buck/jvm/java/abi/JarReader.java (at line 71)
    [javac]     fileSystem = FileSystems.newFileSystem(jarPath, null);
    [javac]                              ^^^^^^^^^^^^^
    [javac] The method newFileSystem(Path, ClassLoader) is ambiguous for the type FileSystems
    [javac] ----------
    [javac] ----------
    [javac] 4. ERROR in /Users/khoadt2/Downloads/Documents/buck/src/com/facebook/buck/jvm/java/abi/java11/SourceVersionUtils.java (at line 27)
    [javac]     switch (version) {
    [javac]             ^^^^^^^
    [javac] The enum constant RELEASE_12 should have a corresponding case label in this enum switch on SourceVersion. To suppress this problem, add a comment //$CASES-OMITTED$ on the line above the 'default:'
    [javac] ----------
    [javac] 5. ERROR in /Users/khoadt2/Downloads/Documents/buck/src/com/facebook/buck/jvm/java/abi/java11/SourceVersionUtils.java (at line 27)
    [javac]     switch (version) {
    [javac]             ^^^^^^^
    [javac] The enum constant RELEASE_13 should have a corresponding case label in this enum switch on SourceVersion. To suppress this problem, add a comment //$CASES-OMITTED$ on the line above the 'default:'
    [javac] ----------
    [javac] 6. ERROR in /Users/khoadt2/Downloads/Documents/buck/src/com/facebook/buck/jvm/java/abi/java11/SourceVersionUtils.java (at line 27)
    [javac]     switch (version) {
    [javac]             ^^^^^^^
    [javac] The enum constant RELEASE_14 should have a corresponding case label in this enum switch on SourceVersion. To suppress this problem, add a comment //$CASES-OMITTED$ on the line above the 'default:'
    [javac] ----------
    [javac] 7. ERROR in /Users/khoadt2/Downloads/Documents/buck/src/com/facebook/buck/jvm/java/abi/java11/SourceVersionUtils.java (at line 27)
    [javac]     switch (version) {
    [javac]             ^^^^^^^
    [javac] The enum constant RELEASE_15 should have a corresponding case label in this enum switch on SourceVersion. To suppress this problem, add a comment //$CASES-OMITTED$ on the line above the 'default:'
    [javac] ----------
    [javac] ----------
    [javac] 8. ERROR in /Users/khoadt2/Downloads/Documents/buck/src/com/facebook/buck/util/unarchive/Unzip.java (at line 321)
    [javac]     try (FileSystem zipFs = FileSystems.newFileSystem(archiveAbsolutePath, null)) {
    [javac]                                         ^^^^^^^^^^^^^
    [javac] The method newFileSystem(Path, ClassLoader) is ambiguous for the type FileSystems
    [javac] ----------
    [javac] 8 problems (8 errors)
alyfreym commented 3 years ago

After installing JDK open terminal and write

  • export JAVA_HOME=$(/usr/libexec/java_home)

after write *echo $JAVA_HOME And its print should be like this - /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home --> IMPORTANT U SEE adoptopenjdk-11.jdk!!! java 8 not working only 11 after

  • cd "my buck folder path"

after just copy past ant ./bin/buck build --show-output buck buck-out/gen/programs/buck.pex --help Done. Tested fucking macOs Big Sure 11.1 Some Links build example - https://buck.build/setup/getting_started.html java download - https://adoptopenjdk.net/archive.html?variant=openjdk11&jvmVariant=hotspot

Thanks @alyfreym , but when I build buck with ant, there are some errors with javac. My javac version is 11.0.9.1

compile:
    [javac] Compiling 5 source files to /Users/khoadt2/Downloads/Documents/buck/ant-out/classes
    [javac] [compiled 965 lines in 1005 ms: 960.1 lines/s]
    [javac] [2 .class files generated]
    [javac] ----------
    [javac] 1. ERROR in /Users/khoadt2/Downloads/Documents/buck/src/com/facebook/buck/jvm/java/abi/AccessFlags.java (at line 200)
    [javac]   switch (modifier) {
    [javac]           ^^^^^^^^
    [javac] The enum constant NON_SEALED should have a corresponding case label in this enum switch on Modifier. To suppress this problem, add a comment //$CASES-OMITTED$ on the line above the 'default:'
    [javac] ----------
    [javac] 2. ERROR in /Users/khoadt2/Downloads/Documents/buck/src/com/facebook/buck/jvm/java/abi/AccessFlags.java (at line 200)
    [javac]   switch (modifier) {
    [javac]           ^^^^^^^^
    [javac] The enum constant SEALED should have a corresponding case label in this enum switch on Modifier. To suppress this problem, add a comment //$CASES-OMITTED$ on the line above the 'default:'
    [javac] ----------
    [javac] ----------
    [javac] 3. ERROR in /Users/khoadt2/Downloads/Documents/buck/src/com/facebook/buck/jvm/java/abi/JarReader.java (at line 71)
    [javac]   fileSystem = FileSystems.newFileSystem(jarPath, null);
    [javac]                            ^^^^^^^^^^^^^
    [javac] The method newFileSystem(Path, ClassLoader) is ambiguous for the type FileSystems
    [javac] ----------
    [javac] ----------
    [javac] 4. ERROR in /Users/khoadt2/Downloads/Documents/buck/src/com/facebook/buck/jvm/java/abi/java11/SourceVersionUtils.java (at line 27)
    [javac]   switch (version) {
    [javac]           ^^^^^^^
    [javac] The enum constant RELEASE_12 should have a corresponding case label in this enum switch on SourceVersion. To suppress this problem, add a comment //$CASES-OMITTED$ on the line above the 'default:'
    [javac] ----------
    [javac] 5. ERROR in /Users/khoadt2/Downloads/Documents/buck/src/com/facebook/buck/jvm/java/abi/java11/SourceVersionUtils.java (at line 27)
    [javac]   switch (version) {
    [javac]           ^^^^^^^
    [javac] The enum constant RELEASE_13 should have a corresponding case label in this enum switch on SourceVersion. To suppress this problem, add a comment //$CASES-OMITTED$ on the line above the 'default:'
    [javac] ----------
    [javac] 6. ERROR in /Users/khoadt2/Downloads/Documents/buck/src/com/facebook/buck/jvm/java/abi/java11/SourceVersionUtils.java (at line 27)
    [javac]   switch (version) {
    [javac]           ^^^^^^^
    [javac] The enum constant RELEASE_14 should have a corresponding case label in this enum switch on SourceVersion. To suppress this problem, add a comment //$CASES-OMITTED$ on the line above the 'default:'
    [javac] ----------
    [javac] 7. ERROR in /Users/khoadt2/Downloads/Documents/buck/src/com/facebook/buck/jvm/java/abi/java11/SourceVersionUtils.java (at line 27)
    [javac]   switch (version) {
    [javac]           ^^^^^^^
    [javac] The enum constant RELEASE_15 should have a corresponding case label in this enum switch on SourceVersion. To suppress this problem, add a comment //$CASES-OMITTED$ on the line above the 'default:'
    [javac] ----------
    [javac] ----------
    [javac] 8. ERROR in /Users/khoadt2/Downloads/Documents/buck/src/com/facebook/buck/util/unarchive/Unzip.java (at line 321)
    [javac]   try (FileSystem zipFs = FileSystems.newFileSystem(archiveAbsolutePath, null)) {
    [javac]                                       ^^^^^^^^^^^^^
    [javac] The method newFileSystem(Path, ClassLoader) is ambiguous for the type FileSystems
    [javac] ----------
    [javac] 8 problems (8 errors)

if you print command in terminal - echo $JAVA_HOME -> what does he show?

khoadotan12 commented 3 years ago

@alyfreym I compiled buck success but got a problem , when I run buck-out/gen/programs/buck.pex --help, it show The operation couldn’t be completed. Unable to locate a Java Runtime that supports buck. My command echo $JAVA_HOME is /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home

navkast commented 3 years ago

Addepar currently maintains a Java 11 / Python2 fork of Buck: https://github.com/Addepar/buck/releases/tag/v2. This might be helpful.

It's really just some minor edits and selective cherry-picks of the wonderful work of FaceBuck contributors 😄. At some point our dream is to remove our fork, but we have some work to do internally in our CI/CD stack to get there.

If you want to use Python3, I think you'll be able to do so with minor code contributions: revert https://github.com/Addepar/buck/commit/eca27469a5adde0443d9078e5f102e633e842ad0 and apply any recent python3 compatibility commits off of FaceBuck master.

khoadotan12 commented 3 years ago

Addepar currently maintains a Java 11 / Python2 fork of Buck: https://github.com/Addepar/buck/releases/tag/v2. This might be helpful.

It's really just some minor edits and selective cherry-picks of the wonderful work of FaceBuck contributors 😄. At some point our dream is to remove our fork, but we have some work to do internally in our CI/CD stack to get there.

If you want to use Python3, I think you'll be able to do so with minor code contributions: revert Addepar@eca2746 and apply any recent python3 compatibility commits off of FaceBuck master.

I run buck.pex file and terminal show Permission denied. Can you help me how to run it?

navkast commented 3 years ago

@khoadotan12 perhaps you can try chmod 755 buck.pex if you're using a unix-like system?

khoadotan12 commented 3 years ago

@navkast thank you, it's really helpful. I can using buck now

alyfreym commented 3 years ago

@navkast thank you, it's really helpful. I can using buck now

You build back from this link ? -> https://github.com/Addepar/buck/releases/tag/v2

I got error

Total time: 5 seconds [Errno 2] No such file or directory: '/Users/alishershermatov/Desktop/buck/ant-out/buck-info.json' Traceback (most recent call last): File "/Users/alishershermatov/Desktop/buck/bin/../programs/buck.py", line 243, in <module> exit_code_callable = main(sys.argv, reporter) File "/Users/alishershermatov/Desktop/buck/bin/../programs/buck.py", line 220, in main with get_repo(project) as buck_repo: File "/Users/alishershermatov/Desktop/buck/bin/../programs/buck.py", line 199, in get_repo return BuckRepo(THIS_DIR, p, reporter) File "/Users/alishershermatov/Desktop/buck/programs/buck_repo.py", line 62, in __init__ super(BuckRepo, self).__init__(buck_project, buck_reporter) File "/Users/alishershermatov/Desktop/buck/programs/buck_tool.py", line 356, in __init__ self._package_info = self._get_package_info() File "/Users/alishershermatov/Desktop/buck/programs/buck_repo.py", line 90, in _get_package_info return json.loads(self.__read_file(BUCK_INFO_LOCATION)) File "/Users/alishershermatov/Desktop/buck/programs/buck_repo.py", line 93, in __read_file with open(os.path.join(self.buck_dir, filename)) as file:

khoadotan12 commented 3 years ago

@alyfreym no I installed the pre-built binary buck.pex and run script on it

hasayakey commented 3 years ago

open /usr/local/Homebrew/Library/Taps/facebook/homebrew-fb/buck.rb and change openjdk@8 to openjdk@11