Git Product home page Git Product logo

Comments (4)

Tatskaari avatar Tatskaari commented on August 15, 2024 1

Ah, I've dug a bit more and realised this is the same issue as #115. Going to close this one as I've got more info there.

from go-rules.

VJftw avatar VJftw commented on August 15, 2024

Was about to open an issue for this too! Not sure if any of this helps but this is as far as I've got so far:

  1. go build supposedly handles this by dynamically emitting a go_asm.h file
  2. Bazel had a similar issue before: bazelbuild/rules_go#1262 but it looks like they fixed it by adding -asmhdr <path to create go_asm.h> to go tool compile.
  3. I followed https://maori.geek.nz/how-go-build-works-750bb2ba6d8e to see what happens when building klauspost/compress' example (zstd requires the cpuinfo pkg), but it looks like the generated go_asm.hs are all empty anyway. So i've just done this as a really hacky workaround VJftw@40e82a2 which seems to work.

from go-rules.

Tatskaari avatar Tatskaari commented on August 15, 2024

Yeah I remember solving this issue for go_module now. go build just does this:

go build -x github.com/klauspost/compress/internal/cpuinfo
WORK=/tmp/go-build4167323964
mkdir -p $WORK/b001/
cat >$WORK/b001/go_asm.h << 'EOF' # internal

please_go install just does touch /home/jpoole/please-servers/plz-out/tmp/third_party/go/_zstd#a_rule._build/_work/third_party/go/zstd/internal/cpuinfo/go_asm.h

Do you want to open a PR with the fix then? I think that's good enough for almost all use cases it seems.

from go-rules.

Tatskaari avatar Tatskaari commented on August 15, 2024

Ah, I can see the tools update the file:

cat _work/third_party/go/zstd/internal/cpuinfo/go_asm.h 
// generated by compile -asmhdr from package cpuinfo

I think it might emit things in that file on different platforms? Not sure. Seems like we just have to make sure the file is there though.

from go-rules.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.