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

[SR-15747] cmark test failure results in incomplete compiler build #58024

Closed
kylesluder opened this issue Jan 18, 2022 · 7 comments
Closed

[SR-15747] cmark test failure results in incomplete compiler build #58024

kylesluder opened this issue Jan 18, 2022 · 7 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. build-script Area → utils: The build script unexpected error Bug: Unexpected error utils Area: the build system and other accessory scripts under the "utils" directory Xcode

Comments

@kylesluder
Copy link

Previous ID SR-15747
Radar rdar://problem/87714696
Original Reporter @kylesluder
Type Bug
Additional Detail from JIRA
Votes 1
Component/s
Labels Bug
Assignee None
Priority Medium

md5: d432e51908aec301e43aa7646dfb2a44

Issue Description:

I’m trying to build swift using the GettingStarted.md. Here’s my build-script command:

./utils/build-script --skip-build-benchmarks --skip-ios --skip-watchos --skip-tvos --swift-darwin-supported-archs arm64 --sccache --release-debuginfo --swift-disable-dead-stripping --test --Xcode

cmark fails to build:

The following build commands failed:
    PhaseScriptExecution CMake\ PostBuild\ Rules /Users/kyle/Source/swift-project/build/Xcode-RelWithDebInfoAssert/cmark-macosx-arm64/cmark.build/RelWithDebInfo/RUN_TESTS.build/Script-003C8D08B0008F35F218E126.sh (in target 'RUN_TESTS' from project 'cmark')
(1 failure)
ERROR: command terminated with a non-zero exit status 65, aborting

The following tests FAILED:
      3 - spectest_library (Failed)
      4 - pathological_tests_library (Failed)
      5 - roundtriptest_library (Failed)
      6 - entity_library (Failed)
      7 - spectest_executable (Failed)
      8 - smartpuncttest_executable (Failed)
      9 - regressiontest_executable (Failed)

This halts the compiler build. Shouldn’t the instructions in GettingStarted.md either skip the tests or ignore test failures?

@kylesluder
Copy link
Author

Maybe this is a Python issue?

Traceback (most recent call last):
  File "/Users/kyle/Source/swift-project/cmark/test/spec_tests.py", line 137, in <module>
    converter = CMark(prog=args.program, library_dir=args.library_dir).to_html
  File "/Users/kyle/Source/swift-project/cmark/test/cmark.py", line 59, in __init__
    cmark = CDLL(libpath)
UnboundLocalError: local variable 'libpath' referenced before assignment

python defaults to Python 2.7 on my machine.

@swift-ci
Copy link
Collaborator

Comment by Pranav Kasetti (JIRA)

I have the same issue and it's not python related, because I have Python 3.9

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@nashysolutions
Copy link

I also have status 65 error, but I don't see which tests failed.

The following build commands failed:
	PhaseScriptExecution CMake\ PostBuild\ Rules /Users/robertnash/Developer/swift-project/build/Xcode-RelWithDebInfoAssert/cmark-macosx-arm64/cmark-gfm.build/RelWithDebInfo/RUN_TESTS.build/Script-003C8D08B0008F35F218E126.sh (in target 'RUN_TESTS' from project 'cmark-gfm')
(1 failure)
ERROR: command terminated with a non-zero exit status 65, aborting

@Fidetro
Copy link
Contributor

Fidetro commented Jul 31, 2022

I think it's caused by the python version.
I try to use system python version:

brew unlink python@3.9

following error:

Unable to find executable: /opt/homebrew/bin/python3
 6/13 Test  #6: entity_library .........................***Not Run   0.00 sec
      Start  7: spectest_executable
Could not find executable /opt/homebrew/bin/python3
Looked in the following places:
/opt/homebrew/bin/python3
/opt/homebrew/bin/python3
/opt/homebrew/bin/RelWithDebInfo/python3
/opt/homebrew/bin/RelWithDebInfo/python3
RelWithDebInfo//opt/homebrew/bin/python3
RelWithDebInfo//opt/homebrew/bin/python3
opt/homebrew/bin/python3
opt/homebrew/bin/python3
opt/homebrew/bin/RelWithDebInfo/python3
opt/homebrew/bin/RelWithDebInfo/python3
RelWithDebInfo/opt/homebrew/bin/python3
RelWithDebInfo/opt/homebrew/bin/python3

Still doesn't seem to be using system python,I'm still looking for a solution.

@tbkka
Copy link
Contributor

tbkka commented Aug 1, 2022

python defaults to Python 2.7 on my machine.

Python 2.7 is no longer supported in the Swift build system. At this point, I think most uses of python in the Swift builds explicitly require Python 3, though it's possible we missed some things.

@Fidetro
Copy link
Contributor

Fidetro commented Aug 1, 2022

After I used python3, I got the following error:

PhaseScriptExecution CMake\ PostBuild\ Rules /Users/karimzhang/Desktop/swift-project/build/Xcode-RelWithDebInfoAssert/cmark-macosx-arm64/cmark-gfm.build/RelWithDebInfo/RUN_TESTS.build/Script-003C8D08B0008F35F218E126.sh (in target 'RUN_TESTS' from project 'cmark-gfm')
    cd /Users/karimzhang/Desktop/swift-project/cmark
    /bin/sh -c /Users/karimzhang/Desktop/swift-project/build/Xcode-RelWithDebInfoAssert/cmark-macosx-arm64/cmark-gfm.build/RelWithDebInfo/RUN_TESTS.build/Script-003C8D08B0008F35F218E126.sh
Test project /Users/karimzhang/Desktop/swift-project/build/Xcode-RelWithDebInfoAssert/cmark-macosx-arm64
      Start  1: api_test
 1/13 Test  #1: api_test ...............................   Passed    1.08 sec
      Start  2: html_normalization
 2/13 Test  #2: html_normalization .....................   Passed    0.62 sec
      Start  3: spectest_library
 3/13 Test  #3: spectest_library .......................***Failed    0.07 sec
Traceback (most recent call last):
  File "/Users/karimzhang/Desktop/swift-project/cmark/test/spec_tests.py", line 147, in <module>
    converter = CMark(prog=args.program, library_dir=args.library_dir, extensions=args.extensions).to_html
  File "/Users/karimzhang/Desktop/swift-project/cmark/test/cmark.py", line 100, in __init__
    cmark = CDLL(libpath)
UnboundLocalError: local variable 'libpath' referenced before assignment

      Start  4: pathological_tests_library
 4/13 Test  #4: pathological_tests_library .............***Failed    2.53 sec
Testing pathological cases:
nested strong emph ... Process Process-1:
Traceback (most recent call last):
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/karimzhang/Desktop/swift-project/cmark/test/pathological_tests.py", line 112, in run_test
    cmark = CMark(prog=args.program, library_dir=args.library_dir, extensions="table")
  File "/Users/karimzhang/Desktop/swift-project/cmark/test/cmark.py", line 100, in __init__
    cmark = CDLL(libpath)
UnboundLocalError: local variable 'libpath' referenced before assignment
Traceback (most recent call last):
  File "/Users/karimzhang/Desktop/swift-project/cmark/test/pathological_tests.py", line 146, in <module>
    if allowed_failures[description]:
KeyError: 'nested strong emph'

      Start  5: roundtriptest_library
 5/13 Test  #5: roundtriptest_library ..................***Failed    0.04 sec
Traceback (most recent call last):
  File "/Users/karimzhang/Desktop/swift-project/cmark/test/roundtrip_tests.py", line 47, in <module>
    do_test(converter, test, args.normalize, result_counts)
  File "/Users/karimzhang/Desktop/swift-project/cmark/test/spec_tests.py", line 44, in do_test
    [retcode, actual_html, err] = converter(test['markdown'], test['extensions'])
  File "/Users/karimzhang/Desktop/swift-project/cmark/test/roundtrip_tests.py", line 29, in converter
    cmark = CMark(prog=args.program, library_dir=args.library_dir, extensions=args.extensions)
  File "/Users/karimzhang/Desktop/swift-project/cmark/test/cmark.py", line 100, in __init__
    cmark = CDLL(libpath)
UnboundLocalError: local variable 'libpath' referenced before assignment

      Start  6: entity_library
 6/13 Test  #6: entity_library .........................***Failed    0.03 sec
Traceback (most recent call last):
  File "/Users/karimzhang/Desktop/swift-project/cmark/test/entity_tests.py", line 30, in <module>
    cmark = CMark(prog=args.program, library_dir=args.library_dir)
  File "/Users/karimzhang/Desktop/swift-project/cmark/test/cmark.py", line 100, in __init__
    cmark = CDLL(libpath)
UnboundLocalError: local variable 'libpath' referenced before assignment

@AnthonyLatsis AnthonyLatsis added build-script Area → utils: The build script Xcode utils Area: the build system and other accessory scripts under the "utils" directory unexpected error Bug: Unexpected error labels Apr 14, 2023
@AnthonyLatsis
Copy link
Collaborator

We no longer support building the compiler via the Xcode generator. The recommended workflow using Xcode is described here.

For posterity, you do not need --test if the intention is to get started with the compiler — it will only slow you down.

@AnthonyLatsis AnthonyLatsis closed this as not planned Won't fix, can't repro, duplicate, stale Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. build-script Area → utils: The build script unexpected error Bug: Unexpected error utils Area: the build system and other accessory scripts under the "utils" directory Xcode
Projects
None yet
Development

No branches or pull requests

6 participants