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

Add os/file.Truncate #4209

Merged
merged 4 commits into from
Aug 2, 2024
Merged

Add os/file.Truncate #4209

merged 4 commits into from
Aug 2, 2024

Conversation

leongross
Copy link
Contributor

Add file.Truncate() to file.go

src/os/truncate_test.go Outdated Show resolved Hide resolved
@leongross leongross force-pushed the os/file/truncate branch 3 times, most recently from e8dac1d to 0851695 Compare April 8, 2024 14:09
@10000TB
Copy link

10000TB commented Apr 30, 2024

any update on next steps ?

@leongross leongross changed the title os/file/truncate Add os/file.Truncate May 17, 2024
@leongross leongross force-pushed the os/file/truncate branch 3 times, most recently from e3e4e5a to 67055fc Compare June 7, 2024 13:33
@leongross
Copy link
Contributor Author

leongross commented Jun 7, 2024

CI error does not seem to be related to the Truncate code, maybe another compiler issue? @deadprogram @aykevl, is this related to #3871?

no Go files in D:\a\tinygo\tinygo\tests\testing
ld.lld: error: undefined symbol: notARealFunction
>>> referenced by main
>>>               C:\Users\RUNNER~1\AppData\Local\Temp\tinygo1547056251\main.o
failed to run tool: ld.lld
--- FAIL: TestBuild (0.00s)
    --- FAIL: TestBuild/Host (0.00s)
        --- FAIL: TestBuild/Host/rand.go (36.58s)
            main_test.go:395: output did not match (expected 35 bytes, got 0 bytes):
FAIL
FAIL	github.com/tinygo-org/tinygo	110.872s

@10000TB
Copy link

10000TB commented Jun 11, 2024

@leongross that seems fixed in 0.29.0

@deadprogram
Copy link
Member

@leongross can you please rebase this PR against the latest dev? Thanks!

@leongross
Copy link
Contributor Author

@deadprogram rebase done

@10000TB
Copy link

10000TB commented Jun 25, 2024

Looking for review / approval ! TY

@leongross
Copy link
Contributor Author

@deadprogram @aykevl

@dgryski
Copy link
Member

dgryski commented Jul 8, 2024

Conflicts after the wasip2 merge. This probably needs a wasip2 implementation but I'm fine to merge this with a ErrNotImplemented error for now.

@leongross leongross force-pushed the os/file/truncate branch 2 times, most recently from 1b3eb6a to 29f7137 Compare July 9, 2024 18:52
@dgryski
Copy link
Member

dgryski commented Jul 9, 2024

You should be able to stub this for wasip2 with this addition to libc_waisp2.go:

// int truncate(const char *path, off_t length);
//
//export truncate
func truncate(path *byte, length int64) int {
	libcErrno = ENOSYS
	return -1
}

@leongross leongross force-pushed the os/file/truncate branch 4 times, most recently from aacb147 to eded7df Compare July 19, 2024 14:31
@deadprogram
Copy link
Member

@leongross please see error here https://github.com/tinygo-org/tinygo/actions/runs/10009754889/job/27670027039?pr=4209#step:7:37

Probably something needs an additional build tag for Windows?

@leongross leongross force-pushed the os/file/truncate branch 2 times, most recently from 5d7ce32 to 48d9ab9 Compare July 31, 2024 08:29
Signed-off-by: leongross <leon.gross@9elements.com>
Signed-off-by: leongross <leon.gross@9elements.com>
Signed-off-by: leongross <leon.gross@9elements.com>
@leongross
Copy link
Contributor Author

leongross commented Jul 31, 2024

Looks like we encountered a similar error as a few weeks ago @deadprogram

The following packages have unmet dependencies:
 libllvm18 : Breaks: llvm-18-dev (< 1:18.1.8~++20240730104741) but 1:18.1.8~++20240730092223+3b5b5c1ec4a3-1~exp1~20240730092238.143 is to be installed
E: Unable to correct problems, you have held broken packages.

llvm/llvm-project#101201

EDIT: apart from the llvm packaging failure the ci passes, would appreciate a review @ayang64 @dgryski @rminnich @deadprogram

Signed-off-by: leongross <leon.gross@9elements.com>
@leongross
Copy link
Contributor Author

llvm issues seem to be resolved by now, re-running the CI

@leongross
Copy link
Contributor Author

CI is green, ready to merge? @aykevl @deadprogram @dgryski @rminnich

Copy link
Member

@aykevl aykevl left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@aykevl aykevl merged commit a8a532f into tinygo-org:dev Aug 2, 2024
17 checks passed
@leongross
Copy link
Contributor Author

Thanks for taking care of that @aykevl!

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