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

crypto: "error Never include this file directly. Use <lzma.h> instead." during test #25240

Closed
dlsniper opened this issue May 3, 2018 · 18 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@dlsniper
Copy link
Contributor

dlsniper commented May 3, 2018

Hi,

We just got the following report, https://youtrack.jetbrains.com/issue/GO-5653, on our issue tracker but I believe this is a Go issue.

By the looks of it, the user is using at least Go 1.10 on a macOS. I suspect this has something to do with the fact that we force Go to compile the test binary with -gcflags="all=-N -l" in order to improve the debugging experience for the users.

Thank you.

OS: Mac OS X (10.13.4, x86_64) 
GOROOT=/usr/local/go
GOPATH=/Users/xueqzhan/source/go

/usr/local/go/bin/go test -c -o /private/var/folders/fx/2f29vz253_z8grcj9cbkq3jw0000gn/T/___TestFollowerOnly_in_planner_scheduler_election -gcflags "all=-N -l" planner-scheduler/election

# crypto/x509
In file included from /usr/local/go/src/crypto/x509/root_cgo_darwin.go:16:
In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:43:
In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:72:
/usr/local/include/Block.h:16:3: error: Never include this file directly. Use <lzma.h> instead.
#       error Never include this file directly. Use <lzma.h> instead.
        ^
1 error generated.

Compilation finished with exit code 2
@adamdecaf
Copy link
Contributor

@dlsniper can we tell what version of CoreFoundation.framework source code they're on?

I don't have a /usr/local/include/Block.h on my OSX (10.13.4) install.

@andybons andybons changed the title crypto: Never include this file directly. Use <lzma.h> instead crypto: use lzma.h instead of Block.h May 4, 2018
@andybons andybons changed the title crypto: use lzma.h instead of Block.h crypto: "error Never include this file directly. Use <lzma.h> instead." during test May 4, 2018
@andybons andybons added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label May 4, 2018
@andybons andybons added this to the Unplanned milestone May 4, 2018
@dlsniper
Copy link
Contributor Author

dlsniper commented May 5, 2018

Unfortunately, I cannot. However, I asked the user about this: https://youtrack.jetbrains.com/issue/GO-5653#comment=27-2855172

@cc14514
Copy link

cc14514 commented May 10, 2018

I get same error when I copy Applications from one Macbook to another , maybe the copy that overlay the "/usr/local/include" dir , so move it and use global librarys .
you can execute :
sudo mv /usr/local/include /usr/local/include_old

and try again

@DavidWangWood
Copy link

DavidWangWood commented May 11, 2018

I have same issue too.
Can someone tell us which way we should go?

@cc14514
Copy link

cc14514 commented May 17, 2018

sudo mv /usr/local/include /usr/local/include_old

@byrain
Copy link

byrain commented Jun 21, 2018

@cc14514 This solved my issue. Thank you so much :)

@jacklinton
Copy link

Why doesn't Apple's migration assistant take care of something like this???? Thank you for posting.

@adamdecaf
Copy link
Contributor

adamdecaf commented Jun 29, 2018

cc @FiloSottile several users seem to be running into this, but I'm not sure what Go could do.

@mzying2013
Copy link

@cc14514 How did you know about this solution? It has been bothering me for a long time. thank you very much.

@ulampinoy
Copy link

I get same error when I copy Applications from one Macbook to another , maybe the copy that overlay the "/usr/local/include" dir , so move it and use global librarys .
you can execute :
sudo mv /usr/local/include /usr/local/include_old

and try again

Thanks, solved my issues too!

@mkval
Copy link

mkval commented Dec 18, 2018

I get same error when I copy Applications from one Macbook to another , maybe the copy that overlay the "/usr/local/include" dir , so move it and use global librarys .
you can execute :
sudo mv /usr/local/include /usr/local/include_old

and try again

Works perfectly! Just migrated to my new machine and came across the issue when I ran a Swift script. Thanks again.

@kgoodrick
Copy link

sudo mv /usr/local/include /usr/local/include_old

Worked perfectly! Thanks @cc14514

@ggilder
Copy link

ggilder commented Jan 28, 2019

In case you don't want to mess with the whole /usr/local/include directory - you can also just rm /usr/local/include/block.h

@cc14514
Copy link

cc14514 commented Feb 10, 2019

@cc14514 This solved my issue. Thank you so much :)

I'm glad to help you.

@cc14514
Copy link

cc14514 commented Feb 10, 2019

@cc14514 How did you know about this solution? It has been bothering me for a long time. thank you very much.

you are welcome, It's been bothering me for a long time too.

@zhulinwei
Copy link

In case you don't want to mess with the whole /usr/local/include directory - you can also just rm /usr/local/include/block.h

It helped me a lot, thanks very much.

@tmthrgd
Copy link
Contributor

tmthrgd commented Nov 12, 2020

The crypto/x509 darwin cgo code was deleted entirely only the other day in CL 232397. That will be part of go1.16 so this issue should be fixed now for the next release.

@FiloSottile
Copy link
Contributor

Yay!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests