[SwiftPM] [swift-build] Question about invalid module name error

Hi, I'm JPMartha.

Can I ask about module name?

The following error has occured when package's name or module's name
consists of figures only. Is it invalid as the error message says?

Error:

fatal error: Invalid module name: file
/Users/buildnode/jenkins/workspace/oss-swift-package-osx/swiftpm/Sources/PackageType/c99name().swift,
line 202

I saw `Sources/PackageType/c99name().swift`, then I found the following
document.

/**
Removes characters from name that are invalid in C99 module-names.
*/

So, I checked C99. Also, I saw the API Design Guideline and the
swift-build-dev Archives.
But I'm not sure that it is invalid.

Even though I miss a naming rule, I think this error should been prevented
beforehand.
So, I reported https://bugs.swift.org/browse/SR-1224\.

Best regards,
JPMartha

Hi JPMartha,

I am not 100% sure what your question is. Is it whether this name should be valid, or just whether we should diagnose it earlier?

It is an invalid "C99 Extended Identifier", which is the technical specification these names need to follow (a digit is not a valid initial character).

- Daniel

···

On Apr 13, 2016, at 10:56 PM, Martha JP via swift-build-dev <swift-build-dev@swift.org> wrote:

Hi, I'm JPMartha.

Can I ask about module name?

The following error has occured when package's name or module's name consists of figures only. Is it invalid as the error message says?

Error:

fatal error: Invalid module name: file /Users/buildnode/jenkins/workspace/oss-swift-package-osx/swiftpm/Sources/PackageType/c99name().swift, line 202

I saw `Sources/PackageType/c99name().swift`, then I found the following document.

/**
Removes characters from name that are invalid in C99 module-names.
*/

So, I checked C99. Also, I saw the API Design Guideline and the swift-build-dev Archives.
But I'm not sure that it is invalid.

Even though I miss a naming rule, I think this error should been prevented beforehand.
So, I reported https://bugs.swift.org/browse/SR-1224\.

Best regards,
JPMartha
_______________________________________________
swift-build-dev mailing list
swift-build-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-build-dev

Hi Daniel and JPMartha

From what I understand we we should provide better error handling. We should check is the package name is correct when run swift build --init
If it’s not then descriptive show error message and don’t create a Package.

Did I understood it correctly JPMartha?

- Kostiantyn

···

On 14 Apr 2016, at 17:54, Daniel Dunbar via swift-build-dev <swift-build-dev@swift.org> wrote:

Hi JPMartha,

I am not 100% sure what your question is. Is it whether this name should be valid, or just whether we should diagnose it earlier?

It is an invalid "C99 Extended Identifier", which is the technical specification these names need to follow (a digit is not a valid initial character).

- Daniel

On Apr 13, 2016, at 10:56 PM, Martha JP via swift-build-dev <swift-build-dev@swift.org <mailto:swift-build-dev@swift.org>> wrote:

Hi, I'm JPMartha.

Can I ask about module name?

The following error has occured when package's name or module's name consists of figures only. Is it invalid as the error message says?

Error:

fatal error: Invalid module name: file /Users/buildnode/jenkins/workspace/oss-swift-package-osx/swiftpm/Sources/PackageType/c99name().swift, line 202

I saw `Sources/PackageType/c99name().swift`, then I found the following document.

/**
Removes characters from name that are invalid in C99 module-names.
*/

So, I checked C99. Also, I saw the API Design Guideline and the swift-build-dev Archives.
But I'm not sure that it is invalid.

Even though I miss a naming rule, I think this error should been prevented beforehand.
So, I reported https://bugs.swift.org/browse/SR-1224\.

Best regards,
JPMartha
_______________________________________________
swift-build-dev mailing list
swift-build-dev@swift.org <mailto:swift-build-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-build-dev

_______________________________________________
swift-build-dev mailing list
swift-build-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-build-dev

Hi, Daniel

Thank you for the quick reply.

I'm really sorry I couldn't explain it well.
If I had to say, I think it is the latter (just whether we should diagnose
it earlier).

# In other words

I don't think this name should be valid. (e.g. "20160412")
Just I'd like to know why this name is invalid.

It is an invalid "C99 Extended Identifier", which is the technical

specification these names need to follow (a digit is not a valid initial
character).

Thanks for telling me. It is what I'd like to know.

# Details

I had created a package named "20160412" with `$ swift build --init`.
It had been succeed, but an error had occured when running '$ swift build'.

I had understood it needs to follow called "C99", but I didn't know about
"C99". Also, I didn't know why this name is invalid.
I don't think it should be valid.

# Sammary

"20160412" is not valid because a digit is not a valid initial character.
"t20160412" is valid name.
"2t0160412" is not valid, but it has been buildable. Because it has renamed
"t0160412".

Best regards,
JPMartha

···

2016-04-15 0:54 GMT+09:00 Daniel Dunbar <daniel_dunbar@apple.com>:

Hi JPMartha,

I am not 100% sure what your question is. Is it whether this name should
be valid, or just whether we should diagnose it earlier?

It is an invalid "C99 Extended Identifier", which is the technical
specification these names need to follow (a digit is not a valid initial
character).

- Daniel

On Apr 13, 2016, at 10:56 PM, Martha JP via swift-build-dev < > swift-build-dev@swift.org> wrote:

Hi, I'm JPMartha.

Can I ask about module name?

The following error has occured when package's name or module's name
consists of figures only. Is it invalid as the error message says?

Error:

fatal error: Invalid module name: file
/Users/buildnode/jenkins/workspace/oss-swift-package-osx/swiftpm/Sources/PackageType/c99name().swift,
line 202

I saw `Sources/PackageType/c99name().swift`, then I found the following
document.

/**
Removes characters from name that are invalid in C99 module-names.
*/

So, I checked C99. Also, I saw the API Design Guideline and the
swift-build-dev Archives.
But I'm not sure that it is invalid.

Even though I miss a naming rule, I think this error should been prevented
beforehand.
So, I reported https://bugs.swift.org/browse/SR-1224\.

Best regards,
JPMartha
_______________________________________________
swift-build-dev mailing list
swift-build-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-build-dev

Hi, Kostiantyn

Thank you for the quick reply.

You guess correctly.
I'm really sorry that I couldn't explain it well.

The reason why I asked that I didn't know about C99 in spite of looking up
it.
And, the reason why I reported [SR-1224] [SwiftPM] [swift-build] Invalid module name error · Issue #5459 · apple/swift-package-manager · GitHub is
what Kostiantyn said.

we should provide better error handling.

Best regards,
JPMartha

···

2016-04-15 5:23 GMT+09:00 Kostiantyn Koval <konstantin.koval1@gmail.com>:

Hi Daniel and JPMartha

From what I understand we we should provide better error handling. We
should check is the package name is correct when run swift build --init
If it’s not then descriptive show error message and don’t create a Package.

Did I understood it correctly JPMartha?

- Kostiantyn

On 14 Apr 2016, at 17:54, Daniel Dunbar via swift-build-dev < > swift-build-dev@swift.org> wrote:

Hi JPMartha,

I am not 100% sure what your question is. Is it whether this name should
be valid, or just whether we should diagnose it earlier?

It is an invalid "C99 Extended Identifier", which is the technical
specification these names need to follow (a digit is not a valid initial
character).

- Daniel

On Apr 13, 2016, at 10:56 PM, Martha JP via swift-build-dev < > swift-build-dev@swift.org> wrote:

Hi, I'm JPMartha.

Can I ask about module name?

The following error has occured when package's name or module's name
consists of figures only. Is it invalid as the error message says?

Error:

fatal error: Invalid module name: file
/Users/buildnode/jenkins/workspace/oss-swift-package-osx/swiftpm/Sources/PackageType/c99name().swift,
line 202

I saw `Sources/PackageType/c99name().swift`, then I found the following
document.

/**
Removes characters from name that are invalid in C99 module-names.
*/

So, I checked C99. Also, I saw the API Design Guideline and the
swift-build-dev Archives.
But I'm not sure that it is invalid.

Even though I miss a naming rule, I think this error should been prevented
beforehand.
So, I reported https://bugs.swift.org/browse/SR-1224\.

Best regards,
JPMartha
_______________________________________________
swift-build-dev mailing list
swift-build-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-build-dev

_______________________________________________
swift-build-dev mailing list
swift-build-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-build-dev