Skip to content

Conversation

jurahul
Copy link
Contributor

@jurahul jurahul commented Sep 29, 2025

Require all files to use Unix line endings, formalizing an already followed convention.

Require all C/C++ source files to use Unix style line endings. This
is just formalizing an already loosely followed convention and not doing
so can cause build failure for some downstream clients of LLVM.
@jurahul jurahul marked this pull request as ready for review September 29, 2025 17:01
@jurahul
Copy link
Contributor Author

jurahul commented Sep 29, 2025

Copy link
Collaborator

@rnk rnk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding clang-format checks seems like a good next step, but I don't see any reason to block landing this on that.

@jurahul
Copy link
Contributor Author

jurahul commented Sep 29, 2025

Thanks. I'll leave it open for a few days for folks to comment (here or in the thread).

Copy link
Collaborator

@jh7370 jh7370 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to the general idea, but as nikic has mentioned, it's my understanding that the line endings should be \n for all cases except for a few very specific exceptions, which probably don't need enumerating in the coding standard (assuming they are obvious from the specific contexts, i.e. the tests that rely on line endings).

@jurahul jurahul force-pushed the cs_unix_line_endings branch from eb26b62 to e93fcfe Compare September 30, 2025 13:04
@jurahul
Copy link
Contributor Author

jurahul commented Sep 30, 2025

I also removed the use of the word "style" as just using Unix line endings is sufficient.

@jurahul jurahul requested review from nikic and jh7370 September 30, 2025 13:06
@jurahul jurahul changed the title [CodingStandard] Require Unix line endings for C/C++ source and headers [CodingStandard] Require Unix line endings for all source files Sep 30, 2025
Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jurahul jurahul force-pushed the cs_unix_line_endings branch from e93fcfe to 985ef74 Compare September 30, 2025 13:08
@jurahul jurahul requested a review from jh7370 September 30, 2025 15:41
Copy link
Collaborator

@jh7370 jh7370 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but you should change the PR title and description to remove the use of "source" too, so that it doesn't appear in the commit message.

@jurahul jurahul changed the title [CodingStandard] Require Unix line endings for all source files [CodingStandard] Require Unix line endings for all files Sep 30, 2025
@jurahul
Copy link
Contributor Author

jurahul commented Sep 30, 2025

LGTM, but you should change the PR title and description to remove the use of "source" too, so that it doesn't appear in the commit message.

Done.

@jurahul jurahul merged commit 4e404d0 into llvm:main Sep 30, 2025
10 checks passed
@jurahul jurahul deleted the cs_unix_line_endings branch September 30, 2025 23:31
@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 1, 2025

LLVM Buildbot has detected a new failure on builder lldb-arm-ubuntu running on linaro-lldb-arm-ubuntu while building llvm at step 6 "test".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/18/builds/21609

Here is the relevant piece of the build log for the reference
Step 6 (test) failure: build (failure)
...
PASS: lldb-unit :: Core/./LLDBCoreTests/97/470 (2452 of 3698)
PASS: lldb-unit :: Core/./LLDBCoreTests/98/470 (2453 of 3698)
PASS: lldb-unit :: DAP/./DAPTests/1/76 (2454 of 3698)
PASS: lldb-unit :: DAP/./DAPTests/0/76 (2455 of 3698)
PASS: lldb-unit :: Core/./LLDBCoreTests/99/470 (2456 of 3698)
PASS: lldb-unit :: DAP/./DAPTests/13/76 (2457 of 3698)
PASS: lldb-unit :: DAP/./DAPTests/12/76 (2458 of 3698)
PASS: lldb-unit :: DAP/./DAPTests/15/76 (2459 of 3698)
PASS: lldb-unit :: DAP/./DAPTests/14/76 (2460 of 3698)
PASS: lldb-unit :: DAP/./DAPTests/11/76 (2461 of 3698)
FAIL: lldb-unit :: DAP/./DAPTests/10/76 (2462 of 3698)
******************** TEST 'lldb-unit :: DAP/./DAPTests/10/76' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/tools/lldb/unittests/DAP/./DAPTests-lldb-unit-3711734-10-76.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=76 GTEST_SHARD_INDEX=10 /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/tools/lldb/unittests/DAP/./DAPTests
--

Script:
--
/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/tools/lldb/unittests/DAP/./DAPTests --gtest_filter=DisconnectRequestHandlerTest.DisconnectTriggersTerminateCommands
--
../llvm-project/lldb/unittests/DAP/Handler/DisconnectTest.cpp:51: Failure
Actual function call count doesn't match EXPECT_CALL(client, Received(Output("1\n")))...
         Expected: to be called once
           Actual: never called - unsatisfied and active

../llvm-project/lldb/unittests/DAP/Handler/DisconnectTest.cpp:52: Failure
Actual function call count doesn't match EXPECT_CALL(client, Received(Output("2\n")))...
         Expected: to be called twice
           Actual: called once - unsatisfied and active


../llvm-project/lldb/unittests/DAP/Handler/DisconnectTest.cpp:51
Actual function call count doesn't match EXPECT_CALL(client, Received(Output("1\n")))...
         Expected: to be called once
           Actual: never called - unsatisfied and active

../llvm-project/lldb/unittests/DAP/Handler/DisconnectTest.cpp:52
Actual function call count doesn't match EXPECT_CALL(client, Received(Output("2\n")))...
         Expected: to be called twice
           Actual: called once - unsatisfied and active



********************
PASS: lldb-unit :: DAP/./DAPTests/19/76 (2463 of 3698)
PASS: lldb-unit :: DAP/./DAPTests/17/76 (2464 of 3698)
PASS: lldb-unit :: DAP/./DAPTests/16/76 (2465 of 3698)
PASS: lldb-unit :: DAP/./DAPTests/18/76 (2466 of 3698)

mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Oct 3, 2025
Require all files to use Unix line endings, formalizing an already
followed convention.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants