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

[Bug (iota-move)]: iota move new fails if using only the required argument <NAME> with uppercase letter(s) #4895

Closed
roman1e2f5p8s opened this issue Jan 17, 2025 · 0 comments · Fixed by #4916
Assignees
Labels
core-protocol sc-platform Issues related to the Smart Contract Platform group.

Comments

@roman1e2f5p8s
Copy link
Contributor

roman1e2f5p8s commented Jan 17, 2025

Bug description

Creating a new Move package with the iota move new command using only the required argument <NAME> fails with No such file or directory (os error 2) if <NAME> contains uppercase letter(s).

Rust version

rustc 1.83.0 (90b35a623 2024-11-26)

Version

develop branch

Hardware specification

  • Operating system: Linux

Steps To reproduce the bug

cargo build
./target/debug/iota move new Xxx

Expected behaviour

$ ./target/debug/iota move new Xxx
$ tree Xxx
Xxx
├── Move.toml
├── sources
│   └── xxx.move
└── tests
    └── xxx_tests.move

3 directories, 3 files

Actual behaviour

$ cargo build
$ ./target/debug/iota move new Xxx
No such file or directory (os error 2)

That is, ./target/debug/iota move new Xxx fails with the following error: No such file or directory (os error 2).

  1. While folder Xxx is created, its content is incomplete: Xxx/sources is empty, Xxx/tests is not created at all:
$ tree Xxx
Xxx
├── Move.toml
└── sources

2 directories, 1 file
  1. Note that if ./target/debug/iota move new Xxx is executed after ./target/debug/iota move new xxx, the former command will not fail. However, ./target/debug/iota move new Xxx will write some contents into xxx instead of Xxx:
$ ./target/debug/iota move new xxx
$ ./target/debug/iota move new Xxx
$ tree xxx
xxx
├── Move.toml
├── sources
│   └── xxx.move
└── tests
    └── xxx_tests.move

3 directories, 3 files
$ tree Xxx
Xxx
├── Move.toml
└── sources

2 directories, 1 file

Errors

- No such file or directory (os error 2)
@roman1e2f5p8s roman1e2f5p8s added core-protocol sc-platform Issues related to the Smart Contract Platform group. labels Jan 17, 2025
@roman1e2f5p8s roman1e2f5p8s self-assigned this Jan 17, 2025
@thibault-martinez thibault-martinez added the dev-tools Issues related to the Developer Tools Team label Jan 20, 2025
@thibault-martinez thibault-martinez removed the dev-tools Issues related to the Developer Tools Team label Jan 29, 2025
mdgeorge4153 pushed a commit to MystenLabs/sui that referenced this issue Feb 27, 2025
…g `<NAME>` with uppercase letter(s) (#21313)

Creating a new Move package with the `sui move new` command using only
the required argument `<NAME>` fails with `No such file or directory (os
error 2)` if `<NAME>` contains uppercase letter(s).

Porting over
[iotaledger/iota/issues/4895](iotaledger/iota#4895).

## Description 

_Describe the changes or additions included in this PR._

- Use the provided `<NAME>` instead of its lowercase variant to obtain
the correct and existing path for writing.
- Update `<NAME>` validation error message: since `<NAME>` is validated
as an `Identifier`, a valid `<NAME>` can also start with an uppercase
letter or underscore.

## Test plan 

_How did you test the new or updated feature?_

The issue can be tested before and after the proposed changes as
follows:

```console
cargo build -p sui
./target/debug/sui move new Xxx
```

> [!NOTE]
> The issue seems to be reproducible only on Linux.
> On MacOS, the bug might not be reproducible due to MacOS default
case-insensitivity.

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] gRPC:
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-protocol sc-platform Issues related to the Smart Contract Platform group.
Projects
None yet
2 participants