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

Remove asm -compiling-runtime flag for go 1.22+ compatible versions (Cherry-pick of #20554) #20562

Merged
merged 1 commit into from
Feb 17, 2024

Conversation

WorkerPants
Copy link
Member

When using go 1.22, trying to compile a go package using pants fails with:

13:07:42.25 [INFO] Initialization options changed: reinitializing scheduler...
13:07:46.62 [INFO] Scheduler initialized.
13:07:51.89 [ERROR] Completed: Compile with Go - runtime/internal/syscall - runtime/internal/syscall failed (exit code 1).
flag provided but not defined: -compiling-runtime
usage: asm [options] file.s ...
Flags:
  -D value
        predefined symbol with optional simple value -D=identifier=value; can be set multiple times
  -I value
        include directory; can be set multiple times
  -S    print assembly and machine code
  -V    print version and exit
  -d value
        enable debugging settings; try -d help
  -debug
        dump instructions as they are parsed
  -dynlink
        support references to Go symbols defined in other shared libraries
  -e    no limit on number of errors reported
  -gensymabis
        write symbol ABI information to output file, don't assemble
  -linkshared
        generate code that will be linked against Go shared libraries
  -o string
        output file; default foo.o for /a/b/c/foo.s as first argument
  -p string
        set expected package import to path (default "<unlinkable>")
  -shared
        generate code that can be linked into a shared library
  -spectre list
        enable spectre mitigations in list (all, ret)
  -trimpath string
        remove prefix from recorded source file paths
  -v    print debug output

This flag has been removed from version 1.22 - asm can now make the determination itself regarding whether or not we're compiling a runtime package, so there's no need to pass that flag anymore.

See: https://cs.opensource.google/go/go/+/72946ae8674a295e7485982fe57c65c7142b2c14

…20554)

When using go 1.22, trying to compile a go package using pants fails
with:

```
13:07:42.25 [INFO] Initialization options changed: reinitializing scheduler...
13:07:46.62 [INFO] Scheduler initialized.
13:07:51.89 [ERROR] Completed: Compile with Go - runtime/internal/syscall - runtime/internal/syscall failed (exit code 1).
flag provided but not defined: -compiling-runtime
usage: asm [options] file.s ...
Flags:
  -D value
        predefined symbol with optional simple value -D=identifier=value; can be set multiple times
  -I value
        include directory; can be set multiple times
  -S    print assembly and machine code
  -V    print version and exit
  -d value
        enable debugging settings; try -d help
  -debug
        dump instructions as they are parsed
  -dynlink
        support references to Go symbols defined in other shared libraries
  -e    no limit on number of errors reported
  -gensymabis
        write symbol ABI information to output file, don't assemble
  -linkshared
        generate code that will be linked against Go shared libraries
  -o string
        output file; default foo.o for /a/b/c/foo.s as first argument
  -p string
        set expected package import to path (default "<unlinkable>")
  -shared
        generate code that can be linked into a shared library
  -spectre list
        enable spectre mitigations in list (all, ret)
  -trimpath string
        remove prefix from recorded source file paths
  -v    print debug output
```

This flag has been removed from version 1.22 - asm can now make the
determination itself regarding whether or not we're compiling a
`runtime` package, so there's no need to pass that flag anymore.

See:
https://cs.opensource.google/go/go/+/72946ae8674a295e7485982fe57c65c7142b2c14
@tdyas tdyas merged commit 47e6a26 into 2.20.x Feb 17, 2024
24 checks passed
@tdyas tdyas deleted the cherry-pick-20554-to-2.20.x branch February 17, 2024 03:34
huonw added a commit that referenced this pull request Apr 5, 2024
This adds a new field `extra_build_args` to `pex_binary` that just
faithfully passes through arbitrary arguments to the `pex ...`
invocation used to build the PEX. This gives users more control and
flexibility for new PEX features that Pants might not (yet) expose
natively.

For instance, the functionality requested in #20227 can now be solved by
passing `extra_build_args=["--no-compress"]`, and similarly people can
now start taking advantage of the `--no-pre-install-wheels`
functionality for their own PEXes (relates to #20562).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:bugfix Bug fixes for released features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants