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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the possibily to install master from a specific commit hash #23

Open
guidoschmidt opened this issue Jul 26, 2023 · 14 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@guidoschmidt
Copy link
Contributor

I've been using zvm for a few months now and it is really helpful, thanks for the effort you've put into it 馃檹馃徑. As I've started to use the master branch zig version more frequently, I sometimes would have needed the possibility to have multiple "master versions" installed from different commit hashes.

sth. like

zvm install master

Would install the latest commit from the zig master branch, and then

zvm install master#972e70b

Would install the given commit hash from the master branch.

I'm not sure if that can be easily done, looks like this feature would need to pull the zig git repository and build the given version then 馃.

@tristanisham
Copy link
Owner

Hey @guidoschmidt ! This is something I've been working on for the past few months. Unfortunately, it's been a bit more of a commitment than I expected. I'd have to save every hash released by the Zig team (multiple a week) and reliably fetch them.

Now, that doesn't mean It's not going to happen. Far from it (I'm thinking v0.3.0), but there are some more QOL things I'd like to get out of the way first on v0.2.* before I fully solve this issue. That being said, I also really like your syntax suggestion. I might just implement it with that exact syntax.

@tristanisham tristanisham self-assigned this Sep 13, 2023
@teobler
Copy link

teobler commented Oct 3, 2023

Thanks @tristanisham for your awesome work! if this is hard to implement right now, could it support install a dev version like 'zvm install 0.12.0-dev.163+6780a6bbf'

@tristanisham
Copy link
Owner

tristanisham commented Oct 3, 2023 via email

@mifopen
Copy link

mifopen commented Nov 16, 2023

Hmm, tbh I do not think that having all the builds available as a list is as important as having ability to install some particular version of choice. The feature is major for current state of Zig when some projects (mach) require some specific version and it's important to develop against master at the same time.

So, I would propose adding ability to run zvm install 0.12.0-dev.706+62a0fbdae. If the version is not published by zig CI (i.e. navigating to https://ziglang.org/builds/.tar.gz gives 403), then it can be simply communicated to the user.

@tristanisham
Copy link
Owner

image

Does the Build CI stores specific hashes of master? I'm getting a 403 error fetching the page anyway. Right now I have a few releases being automatically stored on a personal server I plan to migrate to a public object store and use with ZVM. I'm just wrapping up a class for grad school (and had a death in the family) so I've been unable to dedicate the time to write high-quality software for ZVM. I'll be returning to the project next week.

@OlshaMB
Copy link
Contributor

OlshaMB commented Jan 29, 2024

As there is no way of figuring list of versions, I will try to implement an algorithm:

  1. find version in version map
  2. If fails, try to download from ziglang without manifest.
  3. if fails, report an error

@tristanisham
Copy link
Owner

There is.zvm ls --all. What JSON you're hosting should match the schema of the official version map.

@OlshaMB
Copy link
Contributor

OlshaMB commented Jan 29, 2024

I know. But sometimes you need really specific version. But maybe there is a way of creating a list based on git history of this file https://github.com/ziglang/www.ziglang.org/commits/master/data/releases.json

@OlshaMB
Copy link
Contributor

OlshaMB commented Jan 29, 2024

I can try to make a script to generate version map from history

@tristanisham
Copy link
Owner

I have an archive of daily zig versions covering the past few months. I just need to sit down and build the server for it.

@tristanisham tristanisham added the enhancement New feature or request label Feb 11, 2024
@OlshaMB
Copy link
Contributor

OlshaMB commented Feb 17, 2024

I suggest introducing --force(maybe some better name) flag to install command which would bypass versionmap and download directly from https://ziglang.org/builds/

@tristanisham
Copy link
Owner

Could you expand on good that would work? The version map is how ZVM finds the correct build URL? Regardless of who created the version map?

@OlshaMB
Copy link
Contributor

OlshaMB commented Feb 19, 2024

My idea works like this:

  1. Check if BypassVersionMap flag is available
  2. If so, download from "https://ziglang.org/builds/zig-" + version + ".tar.gz"
  3. and install it

@OlshaMB
Copy link
Contributor

OlshaMB commented Feb 19, 2024

I also have a janky script to generate the full version map of all zig master versions using git:
https://github.com/OlshaMB/olshamb-version-map/blob/main/generate.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants